mirror of
https://github.com/fortressforever/fortressforever-scripts.git
synced 2025-02-07 00:11:42 +00:00
Convert ff_napoli.lua to take advantage of the new base_id.lua
This commit is contained in:
parent
6c5357fd3e
commit
d4eccc6d50
1 changed files with 9 additions and 11 deletions
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -421,5 +421,3 @@ end
|
|||
-- Don't want any body touching/triggering it except the detpack
|
||||
function trigger_detpackable_door:allowed( trigger_entity ) return EVENT_DISALLOWED
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue