mirror of
https://github.com/fortressforever/fortressforever-scripts.git
synced 2025-02-11 22:57:38 +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()
|
function startup()
|
||||||
SetGameDescription("Invade Defend")
|
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
|
-- set up team limits
|
||||||
local team = GetTeam( Team.kBlue )
|
local team = GetTeam( Team.kBlue )
|
||||||
team:SetPlayerLimit( 0 )
|
team:SetPlayerLimit( 0 )
|
||||||
|
@ -99,9 +103,8 @@ function startup()
|
||||||
flags_set_team( attackers )
|
flags_set_team( attackers )
|
||||||
|
|
||||||
ATTACKERS_OBJECTIVE_ENTITY = GetEntityByName( "cp"..phase.."_flag" )
|
ATTACKERS_OBJECTIVE_ENTITY = GetEntityByName( "cp"..phase.."_flag" )
|
||||||
DEFENDERS_OBJECTIVE_ENTITY = GetEntityByName( "cp"..phase.."_cap" )
|
UpdateDefendersObjective()
|
||||||
UpdateTeamObjectiveIcon( GetTeam(attackers), ATTACKERS_OBJECTIVE_ENTITY )
|
UpdateTeamObjectiveIcon( GetTeam(attackers), ATTACKERS_OBJECTIVE_ENTITY )
|
||||||
UpdateTeamObjectiveIcon( GetTeam(defenders), DEFENDERS_OBJECTIVE_ENTITY )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- overwriting these functions so that there aren't repeat messages
|
-- overwriting these functions so that there aren't repeat messages
|
||||||
|
@ -143,7 +146,7 @@ end
|
||||||
|
|
||||||
function base_id_cap:oncapture(player, item)
|
function base_id_cap:oncapture(player, item)
|
||||||
SmartSound(player, "yourteam.flagcap", "yourteam.flagcap", "otherteam.flagcap")
|
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")
|
SmartSpeak(player, "CTF_YOUCAP", "CTF_TEAMCAP", "CTF_THEYCAP")
|
||||||
SmartMessage(player, "#FF_YOUCAP", "#FF_TEAMCAP", "#FF_OTHERTEAMCAP", Color.kGreen, Color.kGreen, Color.kRed)
|
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
|
-- clear objective icon
|
||||||
ATTACKERS_OBJECTIVE_ENTITY = nil
|
ATTACKERS_OBJECTIVE_ENTITY = nil
|
||||||
if DEFENDERS_OBJECTIVE_ONFLAG or DEFENDERS_OBJECTIVE_ONCARRIER then DEFENDERS_OBJECTIVE_ENTITY = nil
|
UpdateDefendersObjective()
|
||||||
else DEFENDERS_OBJECTIVE_ENTITY = GetEntityByName( "cp"..phase.."_cap" ) end
|
|
||||||
UpdateTeamObjectiveIcon( GetTeam(attackers), ATTACKERS_OBJECTIVE_ENTITY )
|
UpdateTeamObjectiveIcon( GetTeam(attackers), ATTACKERS_OBJECTIVE_ENTITY )
|
||||||
UpdateTeamObjectiveIcon( GetTeam(defenders), DEFENDERS_OBJECTIVE_ENTITY )
|
|
||||||
|
|
||||||
setup_tobase_timer()
|
setup_tobase_timer()
|
||||||
update_hud()
|
update_hud()
|
||||||
|
@ -227,9 +228,8 @@ function switch_teams()
|
||||||
|
|
||||||
-- change objective icon
|
-- change objective icon
|
||||||
ATTACKERS_OBJECTIVE_ENTITY = flag
|
ATTACKERS_OBJECTIVE_ENTITY = flag
|
||||||
DEFENDERS_OBJECTIVE_ENTITY = GetEntityByName( "cp"..phase.."_cap" )
|
UpdateDefendersObjective()
|
||||||
UpdateTeamObjectiveIcon( GetTeam(attackers), ATTACKERS_OBJECTIVE_ENTITY )
|
UpdateTeamObjectiveIcon( GetTeam(attackers), ATTACKERS_OBJECTIVE_ENTITY )
|
||||||
UpdateTeamObjectiveIcon( GetTeam(defenders), DEFENDERS_OBJECTIVE_ENTITY )
|
|
||||||
|
|
||||||
-- reset the timer on points
|
-- reset the timer on points
|
||||||
AddScheduleRepeating("addpoints", PERIOD_TIME, addpoints)
|
AddScheduleRepeating("addpoints", PERIOD_TIME, addpoints)
|
||||||
|
@ -420,6 +420,4 @@ end
|
||||||
|
|
||||||
-- Don't want any body touching/triggering it except the detpack
|
-- Don't want any body touching/triggering it except the detpack
|
||||||
function trigger_detpackable_door:allowed( trigger_entity ) return EVENT_DISALLOWED
|
function trigger_detpackable_door:allowed( trigger_entity ) return EVENT_DISALLOWED
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue