From d4eccc6d5005eec15652e0ffb6b919e66e13dc89 Mon Sep 17 00:00:00 2001 From: alaswell Date: Sat, 10 Jan 2015 17:03:45 -0700 Subject: [PATCH] Convert ff_napoli.lua to take advantage of the new base_id.lua --- maps/ff_napoli.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/maps/ff_napoli.lua b/maps/ff_napoli.lua index 0924c39..c5584d4 100644 --- a/maps/ff_napoli.lua +++ b/maps/ff_napoli.lua @@ -24,6 +24,10 @@ end function startup() SetGameDescription("Invade Defend") + DEFENDERS_OBJECTIVE_ONCAP = true + DEFENDERS_OBJECTIVE_ONCARRIER = false --set to true to follow flag when carried + DEFENDERS_OBJECTIVE_ONFLAG = false --set to true to follow flag ALWAYS + -- set up team limits local team = GetTeam( Team.kBlue ) team:SetPlayerLimit( 0 ) @@ -99,9 +103,8 @@ function startup() flags_set_team( attackers ) ATTACKERS_OBJECTIVE_ENTITY = GetEntityByName( "cp"..phase.."_flag" ) - DEFENDERS_OBJECTIVE_ENTITY = GetEntityByName( "cp"..phase.."_cap" ) + UpdateDefendersObjective() UpdateTeamObjectiveIcon( GetTeam(attackers), ATTACKERS_OBJECTIVE_ENTITY ) - UpdateTeamObjectiveIcon( GetTeam(defenders), DEFENDERS_OBJECTIVE_ENTITY ) end -- overwriting these functions so that there aren't repeat messages @@ -143,7 +146,7 @@ end function base_id_cap:oncapture(player, item) SmartSound(player, "yourteam.flagcap", "yourteam.flagcap", "otherteam.flagcap") ---SmartSound(player, "vox.yourcap", "vox.yourcap", "vox.enemycap") + --SmartSound(player, "vox.yourcap", "vox.yourcap", "vox.enemycap") SmartSpeak(player, "CTF_YOUCAP", "CTF_TEAMCAP", "CTF_THEYCAP") SmartMessage(player, "#FF_YOUCAP", "#FF_TEAMCAP", "#FF_OTHERTEAMCAP", Color.kGreen, Color.kGreen, Color.kRed) @@ -189,10 +192,8 @@ function base_id_cap:oncapture(player, item) -- clear objective icon ATTACKERS_OBJECTIVE_ENTITY = nil - if DEFENDERS_OBJECTIVE_ONFLAG or DEFENDERS_OBJECTIVE_ONCARRIER then DEFENDERS_OBJECTIVE_ENTITY = nil - else DEFENDERS_OBJECTIVE_ENTITY = GetEntityByName( "cp"..phase.."_cap" ) end + UpdateDefendersObjective() UpdateTeamObjectiveIcon( GetTeam(attackers), ATTACKERS_OBJECTIVE_ENTITY ) - UpdateTeamObjectiveIcon( GetTeam(defenders), DEFENDERS_OBJECTIVE_ENTITY ) setup_tobase_timer() update_hud() @@ -227,9 +228,8 @@ function switch_teams() -- change objective icon ATTACKERS_OBJECTIVE_ENTITY = flag - DEFENDERS_OBJECTIVE_ENTITY = GetEntityByName( "cp"..phase.."_cap" ) + UpdateDefendersObjective() UpdateTeamObjectiveIcon( GetTeam(attackers), ATTACKERS_OBJECTIVE_ENTITY ) - UpdateTeamObjectiveIcon( GetTeam(defenders), DEFENDERS_OBJECTIVE_ENTITY ) -- reset the timer on points AddScheduleRepeating("addpoints", PERIOD_TIME, addpoints) @@ -420,6 +420,4 @@ end -- Don't want any body touching/triggering it except the detpack function trigger_detpackable_door:allowed( trigger_entity ) return EVENT_DISALLOWED -end - - +end \ No newline at end of file