mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-03-27 07:19:11 +00:00
More ObsFlag Things
This commit is contained in:
parent
7477a11c2f
commit
76511f8938
4 changed files with 56 additions and 0 deletions
|
|
@ -102,6 +102,28 @@ function Observer::onTrigger(%data, %obj, %trigger, %state)
|
|||
}
|
||||
}
|
||||
|
||||
function Observer::setMode(%data, %obj, %mode, %targetObj)
|
||||
{
|
||||
if(%mode $= "")
|
||||
return;
|
||||
|
||||
%client = %obj.getControllingClient();
|
||||
if(%client $= "")
|
||||
return;
|
||||
|
||||
switch$(%mode)
|
||||
{
|
||||
case "followFlag":
|
||||
%transform = %targetObj.getTransform();
|
||||
// observe the flag 2x more far than the normal
|
||||
%obj.setOrbitMode(%targetObj, %transform, 1.0, 9.0, 9.0);
|
||||
|
||||
default:
|
||||
Parent::setMode(%data, %obj, %mode, %targetObj);
|
||||
}
|
||||
%obj.mode = %mode;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
|
|
@ -146,6 +168,9 @@ function serverCmdObserveSecondFlag(%client)
|
|||
observeFlag(%client, %player.client, 2, 2);
|
||||
}
|
||||
|
||||
// observeFlag(%client, %target, %type, %flagTeam)
|
||||
// Info: handle the observe flag feature
|
||||
// observeFlag(%cl, $TeamFlag[%flag.team], 1, %flag.team);
|
||||
function observeFlag(%client, %target, %type, %flagTeam)
|
||||
{
|
||||
if(!isObject(%client) || !isObject(%target) || !isObject(%client.camera))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue