Spies can now sneak into enemy base on Canalzone 2

* Functionality was implemented in base_teamplay.lua, but never used for Command Point maps. This should allow playing Canalzone 2 as intended, where you must also keep enemies Spies and Demomen from detpacking your command center.
** This was implemented in the upcoming [SDK 2013 MP port of Fortress Forever](d5f88a7250), at least a decade after the mod already was out.
This commit is contained in:
BreakinBenny 2024-05-04 17:07:41 +02:00 committed by GitHub
parent c1619e5b07
commit dc2f6ab158
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -843,7 +843,7 @@ end
-- triggers
-----------------------------------------------------------------------------
cp_base_trigger = trigger_ff_script:new({ team = Team.kUnassigned, failtouch_message = "" })
cp_base_trigger = trigger_ff_script:new({ team = Team.kUnassigned, failtouch_message="#FF_NOTALLOWEDDOOR", allowdisguised = true })
function cp_base_trigger:allowed( allowed_entity )
@ -852,6 +852,12 @@ function cp_base_trigger:allowed( allowed_entity )
if player:GetTeamId() == self.team then
return EVENT_ALLOWED
end
if self.allowdisguised then
if player:IsDisguised() and player:GetDisguisedTeam() == self.team then
return EVENT_ALLOWED
end
end
end
return EVENT_DISALLOWED
end
@ -860,12 +866,12 @@ function cp_base_trigger:onfailtouch( touch_entity )
if IsPlayer( touch_entity ) then
local player = CastToPlayer( touch_entity )
BroadCastMessageToPlayer( player, failtouch_message )
BroadCastMessageToPlayer( player, self.failtouch_message )
end
end
cp_team1_door_trigger = cp_base_trigger:new({ team = TEAM1 , failtouch_message = "#FF_NOTALLOWEDDOOR" })
cp_team2_door_trigger = cp_base_trigger:new({ team = TEAM2 , failtouch_message = "#FF_NOTALLOWEDDOOR" })
cp_team1_door_trigger = cp_base_trigger:new({ team = TEAM1 })
cp_team2_door_trigger = cp_base_trigger:new({ team = TEAM2 })
-----------------------------------------------------------------------------
@ -1616,5 +1622,3 @@ red_teleporter_cp2 = cp_team2_teleporter_cp2
red_teleporter_cp3 = cp_team2_teleporter_cp3
red_teleporter_cp4 = cp_team2_teleporter_cp4
red_teleporter_cp5 = cp_team2_teleporter_cp5