v22002: No patch notes.

This commit is contained in:
Robert MacGregor 2017-07-17 22:55:25 -04:00
parent adad8c0787
commit 63560d110c
110 changed files with 5518 additions and 2403 deletions

View file

@ -352,22 +352,18 @@ function BountyGame::buildListValidTargets(%game, %cl)
for (%cIndex = 0; %cIndex < %numClients; %cIndex++)
{
%opponent = ClientGroup.getObject(%cIndex);
//echo ("Predator = " @ %cl @ " PossPrey = " @ %opponent);
if (!%opponent.isNotInGame) //hasn't dropped
{
if (%opponent != %cl) //don't add client himself to list
//make sure the target isn't yourself, or an observer
if (%opponent != %cl && %opponent.team > 0 && !%opponent.isNotInGame)
{
//make sure candidate for list has not already been killed by client
if (!%cl.eliminated[%opponent])
{
if (%opponent.player) //make sure candidate for list has a player
{
if (!%cl.eliminated[%opponent]) //make sure candidate for list has not already been killed by client
{
%cl.validList[%availTargets] = %opponent;
%availTargets++;
}
}
%cl.validList[%availTargets] = %opponent;
%availTargets++;
}
}
}
//returns length of list (number of players eligible as targets to this client)
%game.hudUpdateObjRem(%cl, %availTargets);
if ((%availTargets <= %game.WARN_AT_NUM_OBJREM) && (%cl.hasHadTarget))
@ -412,6 +408,7 @@ function BountyGame::gameOver(%game)
%client = ClientGroup.getObject(%i);
%game.resetScore(%client);
cancel(%client.waypointSchedule);
cancel(%client.forceRespawnThread);
}
}
@ -436,6 +433,18 @@ function BountyGame::AIHasJoined(%game, %client)
//messageAllExcept(%client, -1, 'MsgClientJoinTeam', '%1 has joined the fray.', %client.name, "", %client, 1);
}
function BountyGame::forceRespawn(%game, %client)
{
//make sure the player hasn't already respawned
if (isObject(%client.player))
return;
commandToClient(%client, 'setHudMode', 'Standard');
Game.spawnPlayer( %client, true );
%client.camera.setFlyMode();
%client.setControlObject(%client.player);
}
function BountyGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc)
{
DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc);
@ -446,6 +455,10 @@ function BountyGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %i
// any time a person dies, the kill streak is reset
%clVictim.killStreak = 0;
//force the player to respawn
if (!%clVictim.isAIControlled())
%clVictim.forceRespawnThread = %game.schedule(5000, forceRespawn, %clVictim);
}
function BountyGame::onClientLeaveGame(%game, %clientId)
@ -476,7 +489,10 @@ function BountyGame::onClientLeaveGame(%game, %clientId)
function BountyGame::onClientEnterObserverMode(%game, %clientId)
{
// is this fair? go to observer mode and no one has you as a target any more
//cancel the respawn schedule
cancel(%clientId.forceRespawnThread);
//notify everyone else, and choose a new objective if required...
%numClients = ClientGroup.getCount();
for (%index = 0; %index < %numClients; %index++)
{
@ -815,7 +831,7 @@ function BountyGame::updateScoreHud(%game, %client, %tag)
for (%cIndex = 0; %cIndex < ClientGroup.getCount(); %cIndex++)
{
%opponent = ClientGroup.getObject(%cIndex);
if (!%opponent.isNotInGame && %opponent != %cl && isObject(%opponent.player) && !%cl.eliminated[%opponent])
if (!%opponent.isNotInGame && %opponent.team > 0 && %opponent != %cl && !%cl.eliminated[%opponent])
%clTargets++;
}
@ -840,6 +856,36 @@ function BountyGame::updateScoreHud(%game, %client, %tag)
}
}
// Tack on the list of observers:
%observerCount = 0;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl.team == 0)
%observerCount++;
}
if (%observerCount > 0)
{
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient(%client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush><font:Univers Condensed:22>\tOBSERVERS (%1)<rmargin:260><just:right>TIME<spop>', %observerCount);
%index++;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
//if this is an observer
if (%cl.team == 0)
{
%obsTime = getSimTime() - %cl.observerStartTime;
%obsTimeStr = %game.formatTime(%obsTime, false);
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:20, 310>\t<clip:150>%1</clip><rmargin:260><just:right>%2',
%cl.name, %obsTimeStr );
%index++;
}
}
}
//clear the rest of Hud so we don't get old lines hanging around...
messageClient(%client, 'ClearHud', "", %tag, %index);
}

View file

@ -10,8 +10,11 @@ $ESCAPE_SEQ = "_-_";
$IRCClient::serverList = GetIRCServerList(0);
$IRCClient::serverCount = getRecordCount($IRCClient::serverList);
$IRCClient::retries = -1;
$IRCClient::serverIndex = -1;
$IRCClient::serverport = 6667;
if ($IRCClient::serverCount > 1)
$IRCClient::serverIndex = getRandom($IRCClient::serverCount-1)-1;
else
$IRCClient::serverIndex = -1;
$IRCClient::serverAttempt = 0;
$AWAY_TIMEOUT = 5 * 60 * 1000;
$VERSION_FLOOD_TIMEOUT = 5.0;
@ -35,6 +38,12 @@ $CHANNEL_TOPIC_LIMITED = 128;
$CHANNEL_HAS_KEY = 256;
$CHANNEL_NEW = 512;
// Default messages (if gui is left blank)
$DefaultChatAwayMessage = "Don't be alarmed. I'm going to step away from my computer.";
$DefaultChatKickMessage = "Alright, you\'re outta here!";
$DefaultChatBanMessage = "You, and three generations of your offspring, are banned from this channel.";
//------------------------------------------------------------------------------
function JoinChatDlg::onWake(%this)
{
@ -53,9 +62,17 @@ function JoinChatList::onSelect(%this,%id,%text)
//------------------------------------------------------------------------------
function JoinChatDlg::join(%this)
{
IRCClient::join(IRCClient::channelName(JoinChatName.getValue()));
Canvas.popDialog(JoinChatDlg);
LaunchTabView.viewTab("CHAT",ChatGui,0);
if(trim(JoinChatName.getValue()) $= "")
{
messageBoxOK("ERROR", "Invalid Channel Name");
return;
}
else
{
IRCClient::join(IRCClient::channelName(trim( JoinChatName.getValue()) ));
Canvas.popDialog(JoinChatDlg);
LaunchTabView.viewTab("CHAT", ChatGui, 0);
}
}
//------------------------------------------------------------------------------
@ -95,6 +112,7 @@ function ChatGui::onWake(%this)
ChatGui.awake = true;
ChatTabView.setSelected($IRCClient::currentChannel);
ChatGuiScroll.scrollToBottom();
ChatMessageEntry.schedule(1, makeFirstResponder, true);
}
//------------------------------------------------------------------------------
@ -105,7 +123,8 @@ function ChatGui::setKey(%this,%ignore)
//------------------------------------------------------------------------------
function ChatTabView::onAdd(%this)
{
%this.addTab($IRCClient::channels.getObject(0),"STATUS");
if ($LaunchMode $= "Normal")
%this.addTab($IRCClient::channels.getObject(0),"STATUS");
}
//------------------------------------------------------------------------------
@ -114,6 +133,11 @@ function ChatTabView::onSelect(%this,%obj,%name)
ChatTabFrame.setAltColor(%obj.private);
%i = %obj.findMember($IRCClient::people.getObject(0));
ChatEditChannelBtn.setVisible(%obj.getFlags(%i) & $PERSON_OPERATOR);
//is this the status window? do we need the options button
%vis = (%name $= "STATUS" ? true : false);
ChatEditOptionsBtn.setVisible(%vis);
ChatChannelTopic.setValue(%obj.topic);
if (ChatGui.awake)
{
@ -282,13 +306,7 @@ function ChatRoomMemberList::onRightMouseDown(%this,%column,%row,%mousePos)
// Open the action menu:
ChatMemberPopup.member = %this.getRowId(%row);
ChatMemberPopup.position = %mousePos;
Canvas.pushDialog(ChatMemberActionDlg);
ChatMemberPopup.forceOnAction();
}
//------------------------------------------------------------------------------
function ChatMemberActionDlg::onWake(%this)
{
ChatMemberPopup.clear();
%nick = IRCClient::displayNick(ChatMemberPopup.member);
%is = $IRCClient::currentChannel.findMember(ChatMemberPopup.member);
@ -310,7 +328,7 @@ function ChatMemberActionDlg::onWake(%this)
}
else
{
if (strcmp(ChatMemberPopup.member.getName(),$IRCClient::currentChannel.getName()))
if (strcmp(ChatMemberPopup.member.displayName,$IRCClient::currentChannel.getName()))
ChatMemberPopup.add("Chat",2);
if ($IRCClient::currentChannel.getFlags(%im) & $PERSON_OPERATOR)
@ -338,6 +356,9 @@ function ChatMemberActionDlg::onWake(%this)
ChatMemberPopup.add("Invite to" SPC IRCClient::displayChannel(%c.getName()),%c);
}
}
Canvas.pushDialog(ChatMemberActionDlg);
ChatMemberPopup.forceOnAction();
}
//------------------------------------------------------------------------------
@ -360,7 +381,7 @@ function ChatMemberPopup::onSelect(%this,%id,%text)
case 1: // Set Away
IRCClient::away($pref::IRCClient::awaymsg);
case 2: // Chat
%c = IRCClient::findChannel(ChatMemberPopup.member.getName(),true);
%c = IRCClient::findChannel(ChatMemberPopup.member.displayName,true);
ChatTabView.setSelected(%c);
case 3: // Admin
IRCClient::setOperator(ChatMemberPopup.member);
@ -543,6 +564,75 @@ function AcceptChannelOptions()
IRCClient::setKey(%c,false,"");
}
//========================================================================
// chat options menu
//------------------------------------------------------------------------------
function EditChatOptions()
{
$tempHighlightOn = $pref::IRCClient::HightlightOn;
ButtonChatHighlight.setValue($tempHighlightOn);
$tempHideLinks = $pref::IRCClient::hideLinks;
ButtonChatNameLinkToggle.setValue($tempHideLinks);
//for now
ButtonChatShowJoin.setVisible(false);
ButtonChatChannelHighlight.setVisible(false);
EditChatAwayMessage.setValue($pref::IRCClient::awaymsg);
EditChatKickMessage.setValue($pref::IRCClient::kickmsg);
EditChatBanMessage.setValue($pref::IRCClient::banmsg);
Canvas.pushDialog(ChatOptionsDlg);
}
//------------------------------------------------------------------------------
function acceptChatOptions()
{
//error("Accepting Chat Options....");
$pref::IRCClient::HighlightOn = $tempHighlightOn;
$pref::IRCClient::hideLinks = $tempHideLinks;
if($tempAwayMsg !$= "")
$pref::IRCClient::awaymsg = $tempAwayMsg;
else
$pref::IRCClient::awaymsg = $DefaultChatAwayMessage;
if($tempkickmsg !$= "")
$pref::IRCClient::kickmsg = $tempkickmsg;
else
$pref::IRCClient::kickmsg = $DefaultChatKickMessage;
if($tempbanmsg !$= "")
$pref::IRCClient::banmsg = $tempbanmsg;
else
$pref::IRCClient::banmsg = $DefaultChatBanMessage;
canvas.popDialog(ChatOptionsDlg);
}
//------------------------------------------------------------------------------
function CancelChatOptions()
{
canvas.popDialog(ChatOptionsDlg);
}
//------------------------------------------------------------------------------
function ToggleChatHiglight()
{
$tempHighlightOn = !$tempHighlightOn;
ButtonChatHighlight.setValue($tempHighlightOn);
}
//------------------------------------------------------------------------------
function ToggleChatLinkedNicks()
{
$tempHideLinks = !$tempHideLinks;
ButtonChatNameLinkToggle.setValue($tempHideLinks);
}
//------------------------------------------------------------------------------
function IRCClient::init()
{
@ -553,8 +643,9 @@ function IRCClient::init()
$IRCClient::connectwait = 0;
$IRCClient::room = "";
$IRCClient::numCensorWords = 0;
$IRCClient::previousChannelCount = 0;
$IRCClient::people.add(new SimObject("IRCMe")
$IRCClient::people.add(new SimObject()
{
real = "";
identity = "";
@ -589,9 +680,6 @@ function IRCClient::notify(%event)
MessageBoxOK("No Response","Connection failed. The IRC server did not respond.","");
case IDIRC_ERR_DROPPED:
MessageBoxOK("Connection Dropped","You have been disconnected from IRC server " @ $IRCClient::server @ ".","");
case IDIRC_RECONNECT:
case IDIRC_ERR_RECONNECT:
MessageBoxOK("No Reconnect","Unable to reconnect to IRC server " @ $IRCClient::server @ ".","");
case IDIRC_ERR_BADCHALLENGE:
case IDIRC_ERR_BADCHALRESP_REPLY:
case IDIRC_CHANNEL_LIST:
@ -710,7 +798,7 @@ function IRCClient::findPerson(%nick)
for (%i = 0; %i < $IRCClient::people.getCount(); %i++)
{
%person = $IRCClient::people.getObject(%i);
if (%person.getName() $= %nick)
if (%person.displayName $= %nick)
return %person;
}
}
@ -745,7 +833,7 @@ function IRCClient::findPerson2(%prefix,%create)
if (%create)
{
%p = new SimObject(%nick)
%p = new SimObject()
{
real = "";
identity = "";
@ -753,9 +841,9 @@ function IRCClient::findPerson2(%prefix,%create)
flags = 0;
ping = 0;
ref = 0;
displayName = %nick;
};
if (strlen(%ident))
IRCClient::setIdentity(%p,%ident);
IRCClient::setIdentity(%p,%ident);
$IRCClient::people.add(%p);
%c = IRCClient::findChannel(%nick);
@ -769,9 +857,9 @@ function IRCClient::findPerson2(%prefix,%create)
}
// initiate WHO do determine username
if (!strlen(%ident) && %p != $IRCClient::people.getObject(1) &&
getSubStr(%nick,strlen(%nick)-1,1) $= "^")
IRCClient::whois(%p);
//if (!strlen(%ident) && %p != $IRCClient::people.getObject(1) &&
//getSubStr(%nick,strlen(%nick)-1,1) $= "^")
//IRCClient::whois(%p);
return %p;
}
@ -817,42 +905,35 @@ function IRCClient::undoEscapes(%string)
function IRCClient::setIdentity(%p,%ident)
{
%p.identity = %ident;
if (getSubStr(%p.getName(),strlen(%p.getName())-1,1) $= "^")
{
// identity is set and user is WON-authenticated
%i = strpos(%ident,"@");
while ((%j = strpos(%ident,"@",%i+1)) >= 0)
%i = %j;
%user = IRCToByte(getSubStr(%ident,0,%i));
%delimeter = $ESCAPE_SEQ @ "00";
%delimlen = strlen(%delimeter);
%i = strpos(%user,%delimeter);
%name = getSubStr(%user,0,%i);
%user = getSubStr(%user,%i+%delimlen,
strlen(%user)-(%i+%delimlen));
%i = strpos(%user,%delimeter);
%tag = getSubStr(%user,0,%i);
%append = getSubStr(%user,%i+%delimlen,1);
if (strlen(%tag))
if (%append)
{
%p.nick = %name @ %tag;
%p.tagged = "<tribe:0>" @ %name @ "</tribe><tribe:1>" @ %tag @ "</tribe>";
}
else
{
%p.nick = %tag @ %name;
%p.tagged = "<tribe:1>" @ %tag @ "</tribe><tribe:0>" @ %name @ "</tribe>";
}
else
{
%nick = %p.displayName;
if (strpos(%nick, "^") != -1)
{
%triple = IRCGetTriple(%nick);
%name = getField(%triple, 0);
%tag = getField(%triple, 1);
%append = getField(%triple, 2);
%p.untagged = %name;
if (%tag $= "")
{
%p.nick = %name;
%p.tagged = "<tribe:0>" @ %name @ "</tribe>";
}
}
}
else
if(%append)
{
%p.nick = %name @ %tag;
%p.tagged = "<tribe:0>" @ %name @ "</tribe><tribe:1>" @ %tag @ "</tribe>";
}
else
{
%p.nick = %tag @ %name;
%p.tagged = "<tribe:1>" @ %tag @ "</tribe><tribe:0>" @ %name @ "</tribe>";
}
}
else
{
%p.tagged = %nick;
}
}
//------------------------------------------------------------------------------
@ -862,17 +943,22 @@ function IRCClient::displayNick(%person)
if (strlen(%person.nick))
return %person.nick;
else
return %person.getName();
return %person.displayName;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function IRCClient::taggedNick(%person)
{
//error("IRCClient::taggedNick( "@%person@" )");
// identity is set and user is WON-authenticated
if (strlen(%person.nick))
return %person.tagged;
if($pref::IRCClient::hideLinks)
return %person.nick;
else
return %person.tagged;
else
return %person.getName();
return %person.displayName;
}
//------------------------------------------------------------------------------
@ -881,7 +967,7 @@ function IRCClient::correctNick(%p)
for (%i = 1; %i < $IRCClient::channels.getCount(); %i++)
{
%c = $IRCClient::channels.getObject(%i);
if (%c.getName() $= %p.getName())
if (%c.getName() $= %p.displayName)
{
ChatTabView.setTabText(%c,IRCClient::displayNick(%p));
%c.topic = "Private chat with" SPC IRCClient::displayNick(%p);
@ -906,7 +992,8 @@ function IRCClient::correctNick(%p)
//------------------------------------------------------------------------------
function IRCClient::findChannel(%name,%create)
{
if (%name $= "")
//error("IRCClient::findChannel( "@%name@", "@%create@" )");
if(%name $= "")
return $IRCClient::currentChannel;
for (%i = 0; %i < $IRCClient::channels.getCount(); %i++)
@ -941,7 +1028,7 @@ function IRCClient::findChannel(%name,%create)
%c = new ChannelVector(%name)
{
topic = %topic;
key = "";
key = $IRCClient::key;
flags = $CHANNEL_NEW;
personLimit = 0;
private = %private;
@ -959,6 +1046,17 @@ function IRCClient::findChannel(%name,%create)
$IRCClient::nextChannel = %c;
IRCClient::notify(IDIRC_ADDCHANNEL);
}
else
{
%messages = %name @ "_messages";
if (isobject(%messages))
{
for (%i = 0; %i < %messages.getNumLines(); %i++)
%c.pushBackLine(%messages.getLineText(%i));
%messages.delete();
}
}
return %c;
}
@ -1017,14 +1115,25 @@ function IRCClient::connect()
if($IRCClient::retries == -1 || $IRCClient::retries > 5)
{
$IRCClient::serverIndex++;
$IRCClient::retries = 0;
if($IRCClient::serverIndex >= $IRCClient::serverCount)
if ($IRCClient::serverIndex >= $IRCClient::serverCount)
$IRCClient::serverIndex = 0;
$IRCClient::serverAttempt++;
if ($IRCClient::serverCount == 0 || $IRCClient::serverAttempt > $IRCClient::serverCount)
{
IRCClient::newMessage("","Unable to connect to IRC servers.");
IRCClient::notify(IDIRC_ERR_RECONNECT);
IRCClient::notify(IDIRC_ERR_TIMEOUT);
$IRCClient::state = IDIRC_DISCONNECTED;
$IRCClient::retries = -1;
if($IRCClient::serverCount > 1)
$IRCClient::serverIndex = getRandom($IRCClient::serverCount-1)-1;
else
$IRCClient::serverIndex = -1;
$IRCClient::serverAttempt = 0;
return;
}
else
$IRCClient::retries = 0;
$IRCClient::server = getField(getRecord($IRCClient::serverList, $IRCClient::serverIndex), 0);
}
IRCClient::newMessage("","Connecting to " @ $IRCClient::server);
@ -1075,8 +1184,9 @@ function IRCTCP::onConnectFailed(%this)
else
{
IRCClient::newMessage("","Connection failed. The server did not respond.");
IRCClient::disconnect();
IRCClient::notify(IDIRC_ERR_TIMEOUT);
$IRCClient::retries++;
IRCClient::connect();
}
}
@ -1085,11 +1195,60 @@ function IRCClient::reconnect()
{
if (!$pref::IRCClient::autoreconnect)
return (false);
%i = 0;
while ($IRCClient::channels.getCount() > 1)
{
%c = $IRCClient::channels.getObject(1);
if (%c.private)
{
%c.delete();
$IRCClient::deletedChannel = %c;
if ($IRCClient::currentChannel == %c)
$IRCClient::nextChannel = $IRCClient::channels.getObject(0);
IRCClient::notify(IDIRC_DELCHANNEL);
continue;
}
$IRCClient::previousChannel[%i] = %c.getName();
$IRCClient::previousKey[%i] = %c.key;
%messages = $IRCClient::previousChannel[%i] @ "_messages";
if (isobject(%messages))
%messages.delete();
%m = new MessageVector(%messages);
for (%j = 0; %j < %c.getNumLines(); %j++)
%m.pushBackLine(%c.getLineText(%j));
$IRCClient::channels.remove(%c);
for (%j = 0; %j < %c.numMembers(); %j++)
{
%m = %c.getMemberId(%j);
%m.ref--;
if (%m.ref == 0)
{
$IRCClient::people.remove(%m);
%m.delete();
}
}
%c.delete();
$IRCClient::deletedChannel = %c;
if ($IRCClient::currentChannel == %c)
$IRCClient::nextChannel = $IRCClient::channels.getObject(0);
IRCClient::notify(IDIRC_DELCHANNEL);
%i++;
}
$IRCClient::previousChannelCount = %i;
IRCClient::newMessage("","Attempting to reconnect.");
$IRCClient::retries++;
IRCClient::newMessage("","Try " @ $IRCClient::retries @ ". Attempting to reconnect to " @ $IRCClient::server @ ".");
IRCClient::notify(IDIRC_RECONNECT);
IRCClient::connect();
return true;
}
@ -1112,6 +1271,13 @@ function IRCClient::disconnect()
IRCClient::reset();
}
//------------------------------------------------------------------------------
function IRCClient::relogin()
{
IRCClient::newMessage("","IRCClient: Reauthentication starting");
IRCClient::send("CERT " @ WONLoginIRC());
}
//------------------------------------------------------------------------------
function IRCClient::send(%message)
{
@ -1163,8 +1329,8 @@ function IRCClient::processLine(%line)
if (!IRCClient::dispatch(%prefix,%command,%params))
{
echo("IRCClient: " @ %command @ " not handled by dispatch!");
echo("(cmd:) " @ %prefix @ " " @ %command @ " " @ %params);
//echo("IRCClient: " @ %command @ " not handled by dispatch!");
//echo("(cmd:) " @ %prefix @ " " @ %command @ " " @ %params);
}
}
}
@ -1368,10 +1534,14 @@ function IRCClient::onPrivMsg(%prefix,%params)
if (getSubStr(%msg,0,1) $= ":")
%msg = getSubStr(%msg,1,strlen(%msg)-1);
// should we highlight this message
if($pref::IRCClient::highlightOn)
%msg = IRCClient::nickHighLight(%msg);
%nick = %ch;
if (getSubStr(%ch,0,1) $= "@" || getSubStr(%ch,0,1) $= "+")
%nick = getSubStr(%nick,1,strlen(%nick)-1);
if ( %nick $= %p.getName())
if ( %nick $= %p.displayName)
nextToken(%prefix,ch," !");
if (strcmp(getSubStr(%msg,0,1),"\x01"))
@ -1401,19 +1571,14 @@ function IRCClient::onNick(%prefix,%params)
if (%person)
{
if (!(%person.flags & $PERSON_IGNORE))
IRCClient::newMessage($IRCClient::currentChannel,%person.getName() @ " is now known as " @ %params @ ".");
%old = IRCClient::taggedNick(%person);
%channel = IRCClient::findChannel(%person.getName());
if (%channel)
%channel.setName(%params);
%person.displayName = %params;
IRCClient::setIdentity(%person,%person.ident);
IRCClient::correctNick(%person);
%person.setName(%params);
// If this is me, re-set the console variable
if (%person == $IRCClient::people.getObject(0))
$IRCClient::NickName = %person.getName();
if (!(%person.flags & $PERSON_IGNORE))
IRCClient::newMessage($IRCClient::currentChannel,%old @ " is now known as " @ IRCClient::taggedNick(%person) @ ".");
}
}
@ -1465,7 +1630,7 @@ function IRCClient::onMOTDEnd(%prefix, %params)
// EXAMPLE :StLouis.MO.US.UnderNet.org 372 homer128 :- ==> Disclaimer/ Rules:
if ($IRCClient::state $= IDIRC_CONNECTING_WAITING)
{
IRCClient::newMessage("","Successfully connected to " @ $IRCClient::server @ ":" @ $IRCClient::serverport);
IRCClient::newMessage("","Successfully connected to " @ $IRCClient::server);
$IRCClient::state = IDIRC_CONNECTED;
IRCClient::notify(IDIRC_CONNECTED);
@ -1759,7 +1924,7 @@ function IRCClient::onMode(%prefix,%params)
IRCClient::notify(IDIRC_SORT);
// only display the message if my privilages are modified.
if (strcmp(%arg,$IRCClient::people.getObject(0).getName()))
if (strcmp(%arg,$IRCClient::people.getObject(0).displayName))
break;
nextToken(%prefix,arg,"!");
@ -1782,7 +1947,7 @@ function IRCClient::onMode(%prefix,%params)
IRCClient::notify(IDIRC_SORT);
// only display the message if my privilages are modified.
if (strcmp(%arg,$IRCClient::people.getObject(0).getName()))
if (strcmp(%arg,$IRCClient::people.getObject(0).displayName))
break;
nextToken(%prefix,arg,"!");
@ -2015,7 +2180,7 @@ function IRCClient::onBanListEnd(%prefix,%params)
//------------------------------------------------------------------------------
function IRCClient::onBadNick(%prefix,%params)
{
IRCClient::newMessage("","NOTICE: Nickname (" @ $IRCClient::people.getObject(0).getName() @ ") is already in use.");
IRCClient::newMessage("","NOTICE: Nickname (" @ $IRCClient::people.getObject(0).displayName @ ") is already in use.");
IRCClient::notify(IDIRC_ERR_NICK_IN_USE);
}
@ -2056,11 +2221,14 @@ function IRCClient::onAway(%prefix,%params)
//------------------------------------------------------------------------------
function IRCClient::onAction(%prefix,%params)
{
{
%msg = nextToken(%params,ch," :");
%c = IRCClient::findChannel(%ch,true);
%person = IRCClient::findPerson2(%prefix,true);
%name = IRCClient::taggedNick(%person);
IRCClient::newMessage(%c,%prefix @ " " @ %msg);
IRCClient::newMessage(%c, %name @ " " @ %msg);
}
//------------------------------------------------------------------------------
@ -2254,20 +2422,35 @@ function IRCClient::onChalRespReply(%prefix,%params)
%params = nextToken(%params,ident," ");
%params = nextToken(%params,reply," ");
%me = $IRCClient::people.getObject(0);
%me.setName(%nick);
%me.displayName = %nick;
IRCClient::setIdentity(%me,%ident @ "@localhost");
if (WONLoginIRC(%reply) $= "OK")
{
IRCClient::newMessage("","Successfully connected to " @ $IRCClient::server @ ":" @ $IRCClient::serverport);
$IRCClient::state = IDIRC_CONNECTED;
IRCClient::notify(IDIRC_CONNECTED);
if ($IRCClient::state !$= IDIRC_CONNECTED)
{
IRCClient::newMessage("","Successfully connected to " @ $IRCClient::server);
$IRCClient::state = IDIRC_CONNECTED;
IRCClient::notify(IDIRC_CONNECTED);
if ($IRCClient::awaytimeout)
cancel($IRCClient::awaytimeout);
$IRCClient::awaytimeout = schedule($AWAY_TIMEOUT,0,"ChatAway_Timeout");
// auto join a room if requested
if (strlen($IRCClient::room))
IRCClient::send("JOIN " @ $IRCClient::room);
if ($IRCClient::awaytimeout)
cancel($IRCClient::awaytimeout);
$IRCClient::awaytimeout = schedule($AWAY_TIMEOUT,0,"ChatAway_Timeout");
// auto join a room if requested
if (strlen($IRCClient::room))
IRCClient::send("JOIN " @ $IRCClient::room);
if ($IRCClient::previousChannelCount > 0)
{
for (%i = 0; %i < $IRCClient::previousChannelCount; %i++)
IRCClient::join($IRCClient::previousChannel[%i] @ " " @ $IRCClient::previousKey[%i]);
$IRCClient::previousChannelCount = 0;
}
}
else
{
IRCClient::newMessage("","Successfully reauthenticated with " @ $IRCClient::server);
IRCClient::correctNick($IRCClient::people.getObject(0));
}
}
else
{
@ -2345,7 +2528,7 @@ function IRCClient::sendAction(%message)
{
IRCClient::send("PRIVMSG " @ $IRCClient::currentChannel.getName() @ " :\x01ACTION " @ %message @ "\x01");
%me = $IRCClient::people.getObject(0);
IRCClient::newMessage($IRCClient::currentChannel,%me.getName() @ " " @ %message);
IRCClient::newMessage($IRCClient::currentChannel,IRCClient::taggedNick(%me) @ " " @ %message);
}
}
@ -2368,6 +2551,8 @@ function IRCClient::join(%params)
}
else
{
$IRCClient::key = %key;
IRCClient::send("JOIN " @ %channel @ " " @ %key);
IRCClient::connecting();
}
@ -2387,14 +2572,11 @@ function IRCClient::nick(%nick)
if (($IRCClient::state $= IDIRC_CONNECTED || $IRCClient::state $= IDIRC_CONNECTING_IRC) &&
strlen(nick))
{
if (stricmp(%nick, $IRCClient::people.getObject(0).getName()))
if (stricmp(%nick, $IRCClient::people.getObject(0).displayName))
IRCClient::send("NICK " @ %nick);
}
else
{
$IRCClient::people.getObject(0).setName(%nick);
$IRCClient::NickName = %nick;
}
$IRCClient::people.getObject(0).displayName = %nick;
}
//------------------------------------------------------------------------------
@ -2403,6 +2585,27 @@ function IRCClient::name(%name)
$IRCClient::people.getObject(0).real = %name;
}
//----------------------------------------------------------------------
function IRCClient::nickHighLight(%message)
{
//error("IRCClient::nickHighLight( "@%message@" )");
%nick = $IRCClient::people.getObject(0).untagged;
//%nickLen = strLen(%nick);
// swap in for multiple nick options here
%wordCount = getWordCount(%message);
for(%i = 0; %i < %wordCount; %i++)
{
%word = getWord(%message, %i);
if(%word $= %nick)
{
%message = "\c2" @ %message;
}
}
return %message;
}
//------------------------------------------------------------------------------
function IRCClient::part(%params)
{
@ -2442,8 +2645,8 @@ function IRCClient::part(%params)
IRCClient::notify(IDIRC_DELCHANNEL);
}
break;
}
break;
}
}
//------------------------------------------------------------------------------
@ -2500,7 +2703,7 @@ function IRCClient::ping(%params)
//------------------------------------------------------------------------------
function IRCClient::setOperator(%p)
{
IRCClient::send("MODE " @ $IRCClient::currentChannel.getName() @ " +o " @ %p.getName());
IRCClient::send("MODE " @ $IRCClient::currentChannel.getName() @ " +o " @ %p.displayName);
}
//------------------------------------------------------------------------------
@ -2540,16 +2743,16 @@ function IRCClient::setSpectator(%nick)
//------------------------------------------------------------------------------
function IRCClient::kick(%p,%msg)
{
IRCClient::send("KICK" SPC $IRCClient::currentChannel.getName() SPC %p.getName() @ " :" @ %msg);
IRCClient::send("KICK" SPC $IRCClient::currentChannel.getName() SPC %p.displayName @ " :" @ %msg);
}
//------------------------------------------------------------------------------
function IRCClient::ban(%p,%add)
{
if (%add)
IRCClient::send("MODE " @ $IRCClient::currentChannel.getName() @ " +b " @ %p.getName());
IRCClient::send("MODE " @ $IRCClient::currentChannel.getName() @ " +b " @ %p.displayName);
else
IRCClient::send("MODE " @ $IRCClient::currentChannel.getName() @ " -b " @ %p.getName());
IRCClient::send("MODE " @ $IRCClient::currentChannel.getName() @ " -b " @ %p.displayName);
}
//------------------------------------------------------------------------------
@ -2581,21 +2784,21 @@ function IRCClient::ignore(%p,%tf)
//------------------------------------------------------------------------------
function IRCClient::invite(%p,%c)
{
IRCClient::send("INVITE" SPC %p.getName() SPC %c.getName());
IRCClient::send("INVITE" SPC %p.displayName SPC %c.getName());
}
//------------------------------------------------------------------------------
function IRCClient::who(%p)
{
IRCClient::connecting();
IRCClient::send("WHO" SPC %p.getName());
IRCClient::send("WHO" SPC %p.displayName);
}
//------------------------------------------------------------------------------
function IRCClient::whois(%p)
{
IRCClient::connecting();
IRCClient::send("WHOIS" SPC %p.getName());
IRCClient::send("WHOIS" SPC %p.displayName);
}
//------------------------------------------------------------------------------
@ -2680,7 +2883,10 @@ function IRCClient::onJoinServer(%mission,%server,%address,%mayprequire,%prequir
//------------------------------------------------------------------------------
function IRCClient::onJoinGame(%address,%desc)
{
%msg = "launched into <t2server:" @ %address @ ">" @ %desc @ "</t2server>.";
if (%address $= "")
%msg = $pref::IRCClient::hostMsg;
else
%msg = "launched into <t2server:" @ %address @ ">" @ %desc @ "</t2server>.";
IRCClient::away(%msg);
for (%i = 1; %i < $IRCClient::channels.getCount(); %i++)
{
@ -2690,5 +2896,14 @@ function IRCClient::onJoinGame(%address,%desc)
}
}
IRCClient::init();
IRCClient::connect();
//------------------------------------------------------------------------------
function IRCClient::onLeaveGame()
{
IRCClient::away("");
}
if ($LaunchMode $= "Normal")
{
IRCClient::init();
IRCClient::connect();
}

View file

@ -264,7 +264,7 @@ function clearMissionTypes()
// Add all the mission types found on this machine:
for ( %i = 0; %i < $HostTypeCount; %i++ )
FilterEditMissionType.add( $HostTypeName[%i], %i );
FilterEditMissionType.add( $HostTypeDisplayName[%i], %i );
}
//------------------------------------------------------------------------------

View file

@ -24,8 +24,9 @@ function FlipFlop::playerTouch(%data, %flipflop, %player)
function Flipflop::objectiveInit(%data, %flipflop)
{
%flipflop.teamBonusThread = "";
%flipflop.playerBonusThread = "";
%flipflop.tCapThread = "";
%flipflop.tHoldThread = "";
%flipflop.pCapThread = "";
Parent::objectiveInit(%data, %flipflop);
}
@ -46,9 +47,7 @@ function CnHGame::initGameVars(%game)
%game.SCORE_PER_TURRET_KILL = 1;
%game.SCORE_PER_FLIPFLOP_DEFEND = 1;
%game.SCORE_LIMIT_PER_TOWER = 1200; //default of 1500 points per tower required to win @ 1 pt per %game.TIME_REQ_TEAM_HOLD_BONUS milliseconds
// default of 1500 per switch if not defined in mission file specifically. 2 pts per sec per switch = 10 minute min & 20 minute max mission length
// not counting time spent waiting for first point(s). Should be 15-30ish minute missions depending on turnovers
%game.SCORE_LIMIT_PER_TOWER = 1200; //default of 1200 points per tower required to win @ 1 pt per %game.TIME_REQ_TEAM_HOLD_BONUS milliseconds
%game.TIME_REQ_PLYR_CAP_BONUS = 12 * 1000; //player must hold a switch 12 seconds to get a point for it.
%game.TIME_REQ_TEAM_CAP_BONUS = 12 * 1000; //time after touching it takes for team to get a point
@ -131,11 +130,14 @@ function CnHGame::gameOver(%game)
messageAll('MsgClearObjHud', "");
for(%i = 0; %i < ClientGroup.getCount(); %i ++)
{
%client = %group.getObject(%i);
%client = ClientGroup.getObject(%i);
%game.resetScore(%client);
}
for ( %team = 1; %team <= %game.numTeams; %team++ )
{
$TeamScore[%team] = 0;
messageAll('MsgCnHTeamCap', "", -1, -1, -1, %team, $TeamScore[%team], %game.getScoreLimit());
}
}
function CnHGame::stopScoreTimers(%game)
@ -148,9 +150,9 @@ function CnHGame::stopScoreTimers(%game)
for(%i = 0; %i < %ffGroup.getCount(); %i++)
{
%curFF = %ffGroup.getObject(%i);
cancel(%curFF.tHoldThread);
cancel(%curFF.pCapThread);
cancel(%curFF.tCapThread);
cancel(%curFF.tHoldThread);
}
}
@ -309,7 +311,7 @@ function CnHGame::testPlayerFFDefend(%game, %victimID, %killerID)
while(%objID != 0)
{
%objType = %objID.getDataBlock().getName();
echo("tFD found " @ %objType @ " belonging to team " @ %objID.team);
//echo("tFD found " @ %objType @ " belonging to team " @ %objID.team);
if ((%objType $= "FlipFlop") && (%objID.team == %killerID.team))
return true; //found a killer's team flipflop near the point of victim's death
else
@ -323,31 +325,42 @@ function CnHGame::awardScorePlayerFFDefend(%game, %cl, %this)
%cl.flipFlopDefends++;
//if (%game.SCORE_PER_FLIPFLOP_DEFEND != 0)
//messageClient(%cl, $scoreFliDefMsg, 'You receive a %1 point bonus for defending the %2.', %game.SCORE_PER_FLIPFLOP_DEFEND, %game.cleanWord(%this.name));
%game.recalcScore(%cl);
%game.recalcScore(%cl);
}
function CnHGame::awardScorePlayerFFCap(%game, %cl, %this)
{
if(!($missionRunning))
return;
%cl.flipFlopsCapped++;
%game.recalcScore(%cl);
%game.recalcScore(%cl);
}
function CnHGame::awardScoreTeamFFCap(%game, %team, %this)
{
cancel(%this.tCapThread);
if(!($missionRunning))
return;
$TeamScore[%team] +=%game.SCORE_PER_TEAM_FLIPFLOP_CAP;
%sLimit = %game.getScoreLimit();
if (%game.SCORE_PER_TEAM_FLIPFLOP_CAP)
messageAll('MsgCnHTeamCap', "", -1, -1, -1, %team, $teamScore[%team], %sLimit);
if (%game.SCORE_PER_TEAM_FLIPFLOP_HOLD != 0)
%this.tHoldThread = %game.schedule(%game.TIME_REQ_TEAM_HOLD_BONUS, "awardScoreTeamFFHold", %team, %this, true);
%this.tHoldThread = %game.schedule(%game.TIME_REQ_TEAM_HOLD_BONUS, "awardScoreTeamFFHold", %team, %this);
%game.checkScoreLimit(%team);
}
function CnHGame::awardScoreTeamFFHold(%game, %team, %this, %msg)
function CnHGame::awardScoreTeamFFHold(%game, %team, %this)
{
cancel(%this.tHoldThread);
if(!($missionRunning))
return;
$TeamScore[%team] +=%game.SCORE_PER_TEAM_FLIPFLOP_HOLD;
%sLimit = %game.getScoreLimit();
if (%game.SCORE_PER_TEAM_FLIPFLOP_HOLD)
@ -360,7 +373,7 @@ function CnHGame::awardScoreTeamFFHold(%game, %team, %this, %msg)
%game.checkScoreLimit(%team);
%this.tHoldThread = %game.schedule(%game.TIME_REQ_TEAM_HOLD_BONUS, "awardScoreTeamFFHold", %team, %this, false);
%this.tHoldThread = %game.schedule(%game.TIME_REQ_TEAM_HOLD_BONUS, "awardScoreTeamFFHold", %team, %this);
}
function CnHGame::testValidRepair(%game, %obj)

View file

@ -349,6 +349,36 @@ function DMGame::updateScoreHud(%game, %client, %tag)
}
}
// Tack on the list of observers:
%observerCount = 0;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl.team == 0)
%observerCount++;
}
if (%observerCount > 0)
{
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient(%client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush><font:Univers Condensed:22>\tOBSERVERS (%1)<rmargin:260><just:right>TIME<spop>', %observerCount);
%index++;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
//if this is an observer
if (%cl.team == 0)
{
%obsTime = getSimTime() - %cl.observerStartTime;
%obsTimeStr = %game.formatTime(%obsTime, false);
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:20, 310>\t<clip:150>%1</clip><rmargin:260><just:right>%2',
%cl.name, %obsTimeStr );
%index++;
}
}
}
//clear the rest of Hud so we don't get old lines hanging around...
messageClient( %client, 'ClearHud', "", %tag, %index );
}

View file

@ -10,7 +10,11 @@ function DebriefGui::onWake( %this )
moveMap.pop();
if ( isObject( passengerKeys ) )
passengerKeys.pop();
flyingCameraMove.pop();
if ( isObject( observerBlockMap ) )
observerBlockMap.pop();
if ( isObject( observerMap ) )
observerMap.pop();
//flyingCameraMove.pop();
if ( isObject( debriefMap ) )
{

View file

@ -47,6 +47,13 @@ function GameGui::onSleep( %this )
%ctrl = "GM_" @ %this.pane @ "Pane";
if ( isObject( %ctrl ) )
%ctrl.onDeactivate();
// if( isObject( $dummySeq ) )
// {
// $dummySeq.delete();
// }
Canvas.popDialog(LaunchToolbarDlg);
}
//------------------------------------------------------------------------------
@ -156,7 +163,7 @@ $BrowserColumnCount++;
$BrowserColumnName[6] = "Rules Set";
$BrowserColumnRange[6] = "25 300";
$BrowserColumnCount++;
$BrowserColumnName[7] = "# Players";
$BrowserColumnName[7] = "# Players (Bots)";
$BrowserColumnRange[7] = "25 150";
$BrowserColumnCount++;
$BrowserColumnName[8] = "CPU";
@ -533,7 +540,8 @@ function JoinSelectedGame()
%info = GMJ_Browser.getServerInfoString();
%desc = "a" SPC getField(%info,4) @ "(" @ getField(%info,3) @ ") game on the \"" @ getField(%info,0) @ "\" server. Click here to follow";
IRCClient::onJoinGame($JoinGameAddress,%desc);
IRCClient::onJoinGame($JoinGameAddress,%desc);
JoinGame($JoinGameAddress);
}
@ -550,7 +558,6 @@ function JoinGame(%address)
%playerVoice = getField( %playerPref, 3 );
%playerVoicePitch = getField( %playerPref, 4 );
connect( %address, $JoinGamePassword, %playerName, %playerRaceGender, %playerSkin, %playerVoice, %playerVoicePitch );
ServerConnection.setSimulatedNetParams(0.1, 10);
}
//------------------------------------------------------------------------------
@ -574,19 +581,28 @@ function GM_HostPane::onActivate( %this )
// Select the saved-off prefs:
if ( $Host::MissionType !$= "" )
{
%selId = GMH_MissionType.findText( $Host::MissionType );
if ( %selId != -1 )
// Find the last selected type:
for ( %type = 0; %type < $HostTypeCount; %type++ )
{
GMH_MissionType.setSelected( %selId );
GMH_MissionType.onSelect( %selId, "" );
if ( $HostTypeName[%type] $= $Host::MissionType )
break;
}
if ( %type != $HostTypeCount )
{
GMH_MissionType.setSelected( %type );
GMH_MissionType.onSelect( %type, "" );
if ( $Host::Map !$= "" )
{
%index = GMH_MissionList.findTextIndex( $Host::Map );
if ( %index != -1 )
// Find the last selected mission:
for ( %index = 0; %index < $HostMissionCount[%type]; %index++ )
{
%selId = GMH_MissionList.getRowId( %index );
GMH_MissionList.setSelectedById( %selId );
if ( $HostMissionFile[$HostMission[%type, %index]] $= $Host::Map )
break;
}
if ( %index != $HostMissionCount[%type] )
GMH_MissionList.setSelectedById( $HostMission[%type, %index] );
}
}
}
@ -609,7 +625,31 @@ function buildMissionTypePopup( %popup )
{
%popup.clear();
for( %type = 0; %type < $HostTypeCount; %type++ )
%popup.add( $HostTypeName[%type], %type );
%popup.add( $HostTypeDisplayName[%type], %type );
}
//------------------------------------------------------------------------------
function getMissionTypeDisplayNames()
{
%file = new FileObject();
for ( %type = 0; %type < $HostTypeCount; %type++ )
{
$HostTypeDisplayName[%type] = $HostTypeName[%type];
if ( %file.openForRead( "scripts/" @ $HostTypeName[%type] @ "Game.cs" ) )
{
while ( !%file.isEOF() )
{
%line = %file.readLine();
if ( getSubStr( %line, 0, 17 ) $= "// DisplayName = " )
{
$HostTypeDisplayName[%type] = getSubStr( %line, 17, 1000 );
break;
}
}
}
}
%file.delete();
}
//------------------------------------------------------------------------------
@ -679,6 +719,8 @@ function buildMissionList()
$HostMissionCount[%i]++;
}
}
getMissionTypeDisplayNames();
%fobject.delete();
}
@ -705,6 +747,8 @@ function validateMissionAndType(%misName, %misType)
return true;
}
//------------------------------------------------------------------------------
// This function returns the index of the next mission in the mission list.
//------------------------------------------------------------------------------
function getNextMission( %misName, %misType )
{
@ -749,7 +793,7 @@ function getNextMission( %misName, %misType )
}
}
return $HostMissionFile[$HostMission[%type, %i]];
return $HostMission[%type, %i];
}
//------------------------------------------------------------------------------
@ -823,6 +867,8 @@ function StartHostedGame()
return;
}
IRCClient::onJoinGame("", "");
MessagePopup( "STARTING SERVER", "Initializing..." );
Canvas.repaint();
@ -1173,8 +1219,19 @@ function GMW_PlayerModel::update( %this )
}
%skin = getField( $pref::Player[$pref::Player::Current], 2 );
%this.setModel( %shape @ ".dts", %skin );
// if( isObject( $dummySeq ) )
// {
// $dummySeq.delete();
// }
//
// $dummySeq = new TSShapeConstructor()
// {
// baseShape = %shape @ ".dts";
// sequence0 = %shape @ "_forward.dsq dummyRun";
// };
%this.setModel( %shape, %skin );
}
//------------------------------------------------------------------------------
@ -1344,7 +1401,7 @@ function GMW_SkinPopup::onSelect( %this, %id, %text )
$pref::Player[$pref::Player::Current] = setField( $pref::Player[$pref::Player::Current], 2, %text );
// Update the player model:
GMW_PlayerModel.update();
GMW_PlayerModel.update();
}
//------------------------------------------------------------------------------
@ -1487,9 +1544,9 @@ function NW_NameEdit::checkValidPlayerName( %this )
%name = %this.getValue();
%test = strToPlayerName( %name );
if ( %name !$= %test )
%this.setValue( %name );
%this.setValue( %test );
NW_DoneBtn.setActive( strlen( stripTrailingSpaces( %name ) ) > 2 );
NW_DoneBtn.setActive( strlen( stripTrailingSpaces( %test ) ) > 2 );
}
//------------------------------------------------------------------------------

View file

@ -145,7 +145,6 @@ function HuntersGame::missionLoadDone(%game)
%client = ClientGroup.getObject(%i);
%game.resetScore(%client);
%client.flagCount = 1;
%client.trackClient = 0;
%client.trackWaypoint = "";
%client.playerTrackLine = -1;
}
@ -555,41 +554,6 @@ function HuntersGame::updateFlagHoarder(%game)
}
}
function HuntersGame::updateTrackers(%game, %client)
{
//update anyone who is tracking this player
%count = ClientGroup.getCount();
for (%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl.trackClient == %client)
{
//see if the tracker has a waypoint already
if (!isObject(%cl.trackWaypoint))
{
//create a waypoint at player's location...
%cl.trackWaypoint = new WayPoint()
{
position = %player.position;
rotation = "1 0 0 0";
scale = "1 1 1";
name = "Tracking" SPC getTaggedString(%client.name);
dataBlock = "WayPointMarker";
lockCount = "0";
homingCount = "0";
team = %client.team;
};
//add the waypoint to the cleanup group
MissionCleanup.add(%cl.trackWaypoint);
}
//set the position
%cl.trackWaypoint.setTransform(%player.getWorldBoxCenter() SPC "0 0 1 0");
}
}
}
function HuntersGame::sendFlagCountMessage(%game, %client)
{
//send the messages
@ -1584,8 +1548,6 @@ function HuntersGame::updateScoreHud(%game, %client, %tag)
%col1Style = "<color:00dc00>";
else if ( %col1Client == %client )
%col1Style = "<color:dcdcdc>";
else if ( %col1Client == %client.trackClient )
%col1Style = "<color:dcdc00>";
//see if we have two columns
if (%numColumns == 2)
@ -1608,8 +1570,6 @@ function HuntersGame::updateScoreHud(%game, %client, %tag)
%col2Style = "<color:00dc00>";
else if ( %col2Client == %client )
%col2Style = "<color:dcdcdc>";
else if ( %col2Client == %client.trackClient )
%col2Style = "<color:dcdc00>";
}
}
@ -1628,16 +1588,67 @@ function HuntersGame::updateScoreHud(%game, %client, %tag)
else
{
if ( %numColumns == 2 )
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:10><spush>%7\t<clip:150><a:gamelink\t%8>%1</a></clip><rmargin:205><just:right>%2<rmargin:270><just:right>%3<spop><rmargin:505><lmargin:310><just:left>%8<clip:150><a:gamelink\t%9>%4</a></clip><rmargin:505><just:right>%5<rmargin:570><just:right>%6',
%col1Client.name, %col1ClientScore, %col1ClientFlags,
%col2Client.name, %col2ClientScore, %col2ClientFlags,
%col1Style, %col2Style, %col1Client, %col2Client);
{
//this is lame, but we can only have up to %9 args
if ( %col2Client == %maxFlagsClient )
{
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:10><spush>%7\t<clip:150><a:gamelink\t%8>%1</a></clip><rmargin:205><just:right>%2<rmargin:270><just:right>%3<spop><rmargin:505><lmargin:310><just:left><color:00dc00><clip:150><a:gamelink\t%9>%4</a></clip><rmargin:505><just:right>%5<rmargin:570><just:right>%6',
%col1Client.name, %col1ClientScore, %col1ClientFlags,
%col2Client.name, %col2ClientScore, %col2ClientFlags,
%col1Style, %col1Client, %col2Client);
}
else if ( %col2Client == %client )
{
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:10><spush>%7\t<clip:150><a:gamelink\t%8>%1</a></clip><rmargin:205><just:right>%2<rmargin:270><just:right>%3<spop><rmargin:505><lmargin:310><just:left><color:dcdcdc><clip:150><a:gamelink\t%9>%4</a></clip><rmargin:505><just:right>%5<rmargin:570><just:right>%6',
%col1Client.name, %col1ClientScore, %col1ClientFlags,
%col2Client.name, %col2ClientScore, %col2ClientFlags,
%col1Style, %col1Client, %col2Client);
}
else
{
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:10><spush>%7\t<clip:150><a:gamelink\t%8>%1</a></clip><rmargin:205><just:right>%2<rmargin:270><just:right>%3<spop><rmargin:505><lmargin:310><just:left><clip:150><a:gamelink\t%9>%4</a></clip><rmargin:505><just:right>%5<rmargin:570><just:right>%6',
%col1Client.name, %col1ClientScore, %col1ClientFlags,
%col2Client.name, %col2ClientScore, %col2ClientFlags,
%col1Style, %col1Client, %col2Client);
}
}
else
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:20>%4\t<clip:200><a:gamelink\t%5>%1</a></clip><rmargin:280><just:right>%2<rmargin:380><just:right>%3',
%col1Client.name, %col1ClientScore, %col1ClientFlags, %col1Style, %col1Client );
}
}
// Tack on the list of observers:
%observerCount = 0;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl.team == 0)
%observerCount++;
}
if (%observerCount > 0)
{
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient(%client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush><font:Univers Condensed:22>\tOBSERVERS (%1)<rmargin:260><just:right>TIME<spop>', %observerCount);
%index++;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
//if this is an observer
if (%cl.team == 0)
{
%obsTime = getSimTime() - %cl.observerStartTime;
%obsTimeStr = %game.formatTime(%obsTime, false);
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:20, 310>\t<clip:150>%1</clip><rmargin:260><just:right>%2',
%cl.name, %obsTimeStr );
%index++;
}
}
}
//clear the rest of Hud so we don't get old lines hanging around...
messageClient( %client, 'ClearHud', "", %tag, %index );
}

View file

@ -269,7 +269,7 @@ function LaunchGui::onWake(%this)
if ( !Canvas.isCursorOn() )
CursorOn();
$enableDirectInput = "0";
disableDirectInput();
deactivateDirectInput();
Canvas.pushDialog(LaunchToolbarDlg);
if ( !$FirstLaunch )
LaunchTabView.viewLastTab();

View file

@ -53,10 +53,14 @@ function LobbyGui::onWake( %this )
moveMap.pop();
if ( isObject( passengerkeys ) )
passengerKeys.pop();
flyingCameraMove.pop();
if ( isObject( observerBlockMap ) )
observerBlockMap.pop();
if ( isObject( observerMap ) )
observerMap.pop();
//flyingCameraMove.pop();
$enableDirectInput = "0";
disableDirectInput();
deactivateDirectInput();
LobbyMessageVector.attach(HudMessageVector);
LobbyMessageScroll.scrollToBottom();
@ -382,7 +386,8 @@ function fillLobbyMissionMenu( %type, %typeName )
LobbyVoteMenu.key++;
LobbyVoteMenu.clear();
LobbyVoteMenu.mode = "mission";
LobbyVoteMenu.missionType = %typeName;
LobbyVoteMenu.missionType = %type;
LobbyVoteMenu.typeName = %typeName;
commandToServer( 'GetMissionList', LobbyVoteMenu.key, %type );
}
@ -547,18 +552,18 @@ function lobbyVote()
startNewVote( "VoteChangeMission",
"change the mission to",
%text, // Mission display name
LobbyVoteMenu.missionType, // Mission type display name
$clVoteCmd[%id], // Mission file name
LobbyVoteMenu.missionType ); // Mission type
LobbyVoteMenu.typeName, // Mission type display name
$clVoteCmd[%id], // Mission id
LobbyVoteMenu.missionType ); // Mission type id
}
else
{
startNewVote( "VoteTournamentMode",
"change the server to",
%text, // Mission display name
LobbyVoteMenu.missionType, // Mission type display name
$clVoteCmd[%id], // Mission file name
LobbyVoteMenu.missionType ); // Mission type
LobbyVoteMenu.typeName, // Mission type display name
$clVoteCmd[%id], // Mission id
LobbyVoteMenu.missionType ); // Mission type id
LobbyVoteMenu.tourneyChoose = 0;
}
LobbyVoteMenu.reset();

File diff suppressed because it is too large Load diff

View file

@ -386,8 +386,13 @@ function RabbitGame::MissionAreaDamage(%game, %player)
{
if(%player.getState() !$= "Dead") {
%player.setDamageFlash(0.1);
%damageRate = 0.05;
%pack = %player.getMountedImage($BackpackSlot);
if(%pack.getName() $= "RepairPackImage")
if(%player.getMountedImage($WeaponSlot).getName() $= "RepairGunImage")
%damageRate = 0.15;
%prevHurt = %player.getDamageLevel();
%player.setDamageLevel(%prevHurt + 0.05);
%player.setDamageLevel(%prevHurt + %damageRate);
// a little redundancy to see if the lastest damage killed the player
if(%player.getState() $= "Dead")
%game.onClientKilled(%player.client, 0, $DamageType::OutOfBounds);
@ -555,6 +560,36 @@ function RabbitGame::updateScoreHud(%game, %client, %tag)
}
}
// Tack on the list of observers:
%observerCount = 0;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl.team == 0)
%observerCount++;
}
if (%observerCount > 0)
{
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient(%client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush><font:Univers Condensed:22>\tOBSERVERS (%1)<rmargin:260><just:right>TIME<spop>', %observerCount);
%index++;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
//if this is an observer
if (%cl.team == 0)
{
%obsTime = getSimTime() - %cl.observerStartTime;
%obsTimeStr = %game.formatTime(%obsTime, false);
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:20, 310>\t<clip:150>%1</clip><rmargin:260><just:right>%2',
%cl.name, %obsTimeStr );
%index++;
}
}
}
//clear the rest of Hud so we don't get old lines hanging around...
messageClient( %client, 'ClearHud', "", %tag, %index );
}

View file

@ -775,42 +775,6 @@ function SiegeGame::sendDebriefing( %game, %client )
}
}
function SiegeGame::formatTime(%game, %tStr, %includeHundredths)
{
%timeInSeconds = %tStr / 1000;
%mins = mFloor(%timeInSeconds / 60);
if(%mins < 1)
%timeString = "00:";
else if(%mins < 10)
%timeString = "0" @ %mins @ ":";
else
%timeString = %mins @ ":";
%timeInSeconds -= (%mins * 60);
%secs = mFloor(%timeInSeconds);
if(%secs < 1)
%timeString = %timeString @ "00";
else if(%secs < 10)
%timeString = %timeString @ "0" @ %secs;
else
%timeString = %timeString @ %secs;
if (%includeHundredths)
{
%timeString = %timeString @ ".";
%timeInSeconds -= %secs;
%hSecs = mFloor(%timeInSeconds * 100); // will be between 0 and 999
if(%hSecs < 1)
%timeString = %timeString @ "00";
else if(%hSecs < 10)
%timeString = %timeString @ "0" @ %hSecs;
else
%timeString = %timeString @ %hSecs;
}
return %timeString;
}
function SiegeGame::clientMissionDropReady(%game, %client)
{
messageClient(%client, 'MsgClientReady', "", %game.class);
@ -1042,6 +1006,36 @@ function SiegeGame::updateScoreHud(%game, %client, %tag)
%index++;
}
// Tack on the list of observers:
%observerCount = 0;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl.team == 0)
%observerCount++;
}
if (%observerCount > 0)
{
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient(%client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush><font:Univers Condensed:22>\tOBSERVERS (%1)<rmargin:260><just:right>TIME<spop>', %observerCount);
%index++;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
//if this is an observer
if (%cl.team == 0)
{
%obsTime = getSimTime() - %cl.observerStartTime;
%obsTimeStr = %game.formatTime(%obsTime, false);
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:20, 310>\t<clip:150>%1</clip><rmargin:260><just:right>%2',
%cl.name, %obsTimeStr );
%index++;
}
}
}
//clear the rest of Hud so we don't get old lines hanging around...
messageClient( %client, 'ClearHud', "", %tag, %index );
}

View file

@ -337,8 +337,8 @@ function SinglePlayerGame::onClientKilled(%game, %clVictim, %clKiller, %damageTy
if(%num == 1)
%textNum = "one life";
else %textNum = %num SPC "lives";
messageBoxOk("Restart", "You have" SPC %textNum SPC "remaining.", "canvas.cursorOff(); spawnSinglePlayer();");
canvas.cursorOn();
messageBoxOk("Restart", "You have" SPC %textNum SPC "remaining.", "CursorOff(); spawnSinglePlayer();");
//canvas.cursorOn();
}
else schedule(3000, $player.player, singlePlayerDead);
}
@ -371,6 +371,11 @@ function singlePlayerGame::AIHasJoined()
// lets get rid of this mundane console spam
}
function SinglePlayerGame::updateKillScores()
{
// Do nothing other than get rid of the console warning...
}
function singlePlayerGame::biodermAssume(%game, %client)
{
//error(%client SPC "might talk.");
@ -413,7 +418,7 @@ function trainingBiodermSpeaks(%client)
function singlePlayerDead()
{
missionFailed($player.miscMsg[trainingDeathLoss]);
canvas.cursorOn();
CursorOn();
AIMissionEnd();
$objectiveQ[$enemyTeam].clear();
cancel($player.distanceCheckSchedule);
@ -468,6 +473,11 @@ function SinglePlayerGame::clientMissionDropReady(%game, %client)
AISystemEnabled(true);
$player.setControlObject( $player.player );
$player.camera = new Camera()
{
dataBlock = Observer;
};
startCurrentMission(%game);
}
@ -555,7 +565,7 @@ function singlePlayerGame::gameOver(%game)
deactivatepackage(Training6);
deactivatePackage(singlePlayerMissionAreaEnforce);
if($player.currentWaypoint)
if(isObject( $player.currentWaypoint ))
$player.currentWaypoint.delete();
if($player.OOB)
@ -821,7 +831,7 @@ function missionComplete(%text)
$player.endMission = schedule(15000, game, forceFinish);
messageBoxOk("Victory", %text, "forceFinish();");
canvas.cursorOn();
//canvas.cursorOn();
//AI stop
clearQueue();
@ -840,9 +850,6 @@ function forceFinish()
//immediately disconnect - bringing us back to the main menu...
Disconnect();
//we need to get the singlePlayer dialog after leaving
canvas.schedule(1000, "pushDialog", singlePlayerDlg);
}
function missionFailed(%text)
@ -862,6 +869,7 @@ function reloadMission()
{
cancel($player.endMission);
Game.gameOver();
CursorOn();
loadMission($currentMission, singlePlayer);
debriefContinue();
}
@ -890,7 +898,7 @@ function firstPersonQuickPan()
toggleFirstPerson($player);
schedule(4000, $player.player, toggleFirstPerson, $player);
}
}
@ -967,8 +975,8 @@ function singleplayerGame::pickTeamSpawn(%game, %client, %respawn)
function SinglePlayerGame::createCustomKeymap(%game)
{
new ActionMap(TrainingMap);
TrainingMap.bindCmd( keyboard, "escape", escapeFromGame );
// new ActionMap(TrainingMap);
// TrainingMap.bindCmd( keyboard, "escape", "escapeFromGame();", "" );
}
//=======================================================================================
@ -983,9 +991,9 @@ function SinglePlayerEscapeDlg::onWake( %this )
$timeScale = 0;
if( OptionsDlg.isAwake())
{
{
Canvas.popDialog( OptionsDlg );
}
}
}
function SinglePlayerEscapeDlg::onSleep( %this )
@ -1000,14 +1008,14 @@ function SinglePlayerEscapeDlg::leaveGame( %this )
Canvas.popDialog( SinglePlayerEscapeDlg );
if ( !%this.wasCursorOn )
CursorOff();
MessageBoxYesNo( "LEAVE GAME", $player.miscMsg[LeaveGame], "forceFinish();", "$timeScale = 1;" );
MessageBoxYesNo( "LEAVE GAME", $player.miscMsg[LeaveGame], "forceFinish();", "CursorOff(); $timeScale = 1;" );
}
function SinglePlayerEscapeDlg::gotoSettings( %this )
{
Canvas.popDialog( SinglePlayerEscapeDlg );
if ( !%this.wasCursorOn )
CursorOff();
//if ( !%this.wasCursorOn )
// CursorOff();
Canvas.pushDialog( OptionsDlg );
}
@ -1018,10 +1026,8 @@ function SinglePlayerEscapeDlg::returnToGame( %this )
Canvas.popDialog( SinglePlayerEscapeDlg );
CursorOff();
//moveMap.bindCmd( keyboard, "escape", "", "escapeFromGame();" );
movemap.push();
trainingmap.push();
//trainingmap.push();
}

View file

@ -126,6 +126,12 @@ function TeamHuntersGame::initGameVars(%game)
%game.flagMsgDelayMS = 3000;
%game.oobThrowFlagsDelayMS = 3000;
// targets for each of the flag types (except for base which is properly skinned already)
HuntersFlag1.target = -1; // red
HuntersFlag2.target = allocTarget("", 'Blue', "", "", 0, "", "");
HuntersFlag4.target = allocTarget("", 'Yellow', "", "", 0, "", "");
HuntersFlag8.target = allocTarget("", 'Green', "", "", 0, "", "");
}
function TeamHuntersGame::allowsProtectedStatics(%game)
@ -485,6 +491,7 @@ function TeamHuntersGame::CampingDamage(%game, %client, %firstWarning)
function TeamHuntersGame::updateScoreHud(%game, %client, %tag)
{
messageClient( %client, 'ClearHud', "", %tag, 0 );
// Send header:
messageClient( %client, 'SetScoreHudHeader', "", '<tab:15,315>\t%1<rmargin:260><just:right>%2<rmargin:560><just:left>\t%3<just:right>%4',
$teamName[1], $teamScore[1], $teamName[2], $teamScore[2] );
@ -574,13 +581,57 @@ function TeamHuntersGame::updateScoreHud(%game, %client, %tag)
//else for observers, create an anchor around the player name so they can be observed
else
{
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush>%7\t<clip:150><a:gamelink\t%8>%1</a></clip><rmargin:200><just:right>%2<rmargin:260><just:right>%3<spop><rmargin:500><just:left>\t%8<clip:150><a:gamelink\t%9>%4</a></clip><just:right>%5<rmargin:560><just:right>%6',
%team1Client.name, %team1ClientScore, %team1ClientFlags, %team2Client.name, %team2ClientScore, %team2ClientFlags, %col1Style, %col2Style, %team1Client, %team2Client );
//this is lame, but we can only have up to %9 args
if (%team2Client == %team2ClientMostFlags)
{
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush>%7\t<clip:150><a:gamelink\t%8>%1</a></clip><rmargin:200><just:right>%2<rmargin:260><just:right>%3<spop><rmargin:500><just:left>\t<color:00dc00><clip:150><a:gamelink\t%9>%4</a></clip><just:right>%5<rmargin:560><just:right>%6',
%team1Client.name, %team1ClientScore, %team1ClientFlags, %team2Client.name, %team2ClientScore, %team2ClientFlags, %col1Style, %team1Client, %team2Client );
}
else if (%team2Client == %client)
{
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush>%7\t<clip:150><a:gamelink\t%8>%1</a></clip><rmargin:200><just:right>%2<rmargin:260><just:right>%3<spop><rmargin:500><just:left>\t<color:dcdcdc><clip:150><a:gamelink\t%9>%4</a></clip><just:right>%5<rmargin:560><just:right>%6',
%team1Client.name, %team1ClientScore, %team1ClientFlags, %team2Client.name, %team2ClientScore, %team2ClientFlags, %col1Style, %team1Client, %team2Client );
}
else
{
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush>%7\t<clip:150><a:gamelink\t%8>%1</a></clip><rmargin:200><just:right>%2<rmargin:260><just:right>%3<spop><rmargin:500><just:left>\t<clip:150><a:gamelink\t%9>%4</a></clip><just:right>%5<rmargin:560><just:right>%6',
%team1Client.name, %team1ClientScore, %team1ClientFlags, %team2Client.name, %team2ClientScore, %team2ClientFlags, %col1Style, %team1Client, %team2Client );
}
}
%index++;
}
// Tack on the list of observers:
%observerCount = 0;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl.team == 0)
%observerCount++;
}
if (%observerCount > 0)
{
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient(%client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush><font:Univers Condensed:22>\tOBSERVERS (%1)<rmargin:260><just:right>TIME<spop>', %observerCount);
%index++;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
//if this is an observer
if (%cl.team == 0)
{
%obsTime = getSimTime() - %cl.observerStartTime;
%obsTimeStr = %game.formatTime(%obsTime, false);
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:20, 310>\t<clip:150>%1</clip><rmargin:260><just:right>%2',
%cl.name, %obsTimeStr );
%index++;
}
}
}
//clear the rest of Hud so we don't get old lines hanging around...
messageClient( %client, 'ClearHud', "", %tag, %index );
}

View file

@ -121,10 +121,6 @@ function startCurrentMission()
$teammate1.player.invincible = true;
resetWildcat();
$player.camera = new Camera()
{
dataBlock = Observer;
};
}
//------------------------------------------------------------------------------
@ -1002,7 +998,7 @@ function trainingIntroFlightEnd()
function ClientCmdSetHudMode(%mode, %type, %node)
{
parent::ClientCmdSetHudMode(%mode, %type, %node);
TrainingMap.push();
//TrainingMap.push();
getTrainingPacifistMap();
if(game.trainingIntro)
trainingPacifistMap.push();
@ -1315,6 +1311,13 @@ function serverCmdBuildClientTask(%client, %task, %team)
// player shouldnt be able to use the voice commands to do anything
}
function SinglePlayerEscapeDlg::returnToGame( %this )
{
parent::returnToGame( %this );
if(game.trainingIntro)
trainingPacifistMap.push();
}
//END TRAINING1 PACKAGE=======================================================================
};

View file

@ -125,8 +125,7 @@ function ClientCmdSetHudMode(%mode, %type, %node)
parent::ClientCmdSetHudMode(%mode, %type, %node);
movemap.push(); // hopefully this works
TrainingMap.push();
//TrainingMap.push();
}
function AIEngageTask::assume(%task, %client)

View file

@ -123,7 +123,7 @@ function FlipFlop::objectiveInit(%data, %flipflop)
function ClientCmdSetHudMode(%mode, %type, %node)
{
parent::ClientCmdSetHudMode(%mode, %type, %node);
TrainingMap.push();
//TrainingMap.push();
}
@ -299,8 +299,10 @@ function FlipFlop::playerTouch(%data, %flipFlop, %player )
function scoutFlyer::onRemove(%this, %obj)
{
//error("scoutFlyer::onRemove("@ %obj@") called");
if(%obj == $Shrike) {
error("scoutFlyer::onRemove("@ %obj@") called");
if ( ! isObject( ServerConnection ) )
return;
if(%obj == $Shrike ) {
// we dont want the player to die hitting the ground
cancel(game.pilotingTips);
$player.player.invincible = true;

View file

@ -65,7 +65,7 @@ function MP3Audio::play(%this)
function ClientCmdSetHudMode(%mode, %type, %node)
{
parent::ClientCmdSetHudMode(%mode, %type, %node);
TrainingMap.push();
//TrainingMap.push();
}
// get the ball rolling

View file

@ -68,7 +68,7 @@ function toggleScoreScreen(%val)
function ClientCmdSetHudMode(%mode, %type, %node)
{
parent::ClientCmdSetHudMode(%mode, %type, %node);
TrainingMap.push();
//TrainingMap.push();
}
// get the ball rolling
@ -187,43 +187,72 @@ function objectiveDistanceChecks()
schedule(5000, game, objectiveDistanceChecks);
}
// cant blow up the gens except with the satchel charge
//======================================================================================
// Objective Generators
//======================================================================================
function GeneratorLarge::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType)
{
//error("Generator::damageObject called. DamageType = "@%damageType);
if( %targetObject == game.targetObject1 || %targetObject == game.targetObject2 && !game.detonationSequenceStarted){
if(%damageType && %damageType != $DamageType::SatchelCharge && %damageType != $DamageType::Explosion) {
if(!game.tooSoonMsg) {
game.tooSoonMsg = true;
schedule(15000, game, eval, "game.tooSoonMsg = false;");
messageClient($player, 0, $player.miscMsg[genAttackNoSatchel]);
// and a little bonus for easy players
if($pref::trainingDifficulty == 1 &&
$player.player.getMountedImage($backPackSlot).getName() !$= "SatchelChargeImage" && !game.satchelWaypointSet) {
if(%targetObject == game.targetObject1 || %targetObject == game.targetObject2)
%message = training5ObjectiveGenDamaged(%targetObject, %damageType);
else
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType);
%waypoint = new WayPoint() {
position = nameToId(SatchelChargePack).position;
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "WayPointMarker";
lockCount = "0";
homingCount = "0";
name = "Satchel Charge";
team = 1;
locked = "true";
};
$player.satchelWaypoint = %waypoint;
game.satchelWaypointSet = true;
}
}
error("undestroyed gen failed damage type = "@ %damageType);
return;
}
else %targetObject.applyDamage(%targetObject.getDataBlock().maxDamage);
}
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType);
if(%message)
training5messageDamageFailed();
}
function training5ObjectiveGenDamaged(%targetObject, %damageType)
{
//error("training5ObjectiveGenDamaged("@%targetObject@", "@%damageType@")");
if(game.genDestroyed[%targetObject])
return false;
if(%damageType != $DamageType::SatchelCharge)
{
return true;
}
game.objectiveDestroyed = true;
%targetObject.applyDamage(%targetObject.getDataBlock().maxDamage);
return false;
}
function training5messageDamageFailed()
{
if(!game.tooSoonMsg && !game.objectiveDestroyed) {
game.tooSoonMsg = true;
schedule(15000, game, eval, "game.tooSoonMsg = false;");
messageClient($player, 0, $player.miscMsg[genAttackNoSatchel]);
training5easySatchelWaypoint();
}
}
function training5easySatchelWaypoint()
{
if($pref::trainingDifficulty == 1 &&
$player.player.getMountedImage($backPackSlot).getName() !$= "SatchelChargeImage" && !game.satchelWaypointSet) {
%waypoint = new WayPoint() {
position = nameToId(SatchelChargePack).position;
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "WayPointMarker";
lockCount = "0";
homingCount = "0";
name = "Satchel Charge";
team = 1;
locked = "true";
};
$player.satchelWaypoint = %waypoint;
game.satchelWaypointSet = true;
}
}
//======================================================================================
function AIEngageTask::assume(%task, %client)
{
Parent::assume(%task, %client);
@ -272,6 +301,14 @@ function singlePlayerGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType
}
function singleplayerGame::pickTeamSpawn(%game, %client, %respawn)
{
if(%client.useSpawnSphere)
DefaultGame::pickTeamSpawn(%game, %client.team);
else
parent::pickTeamSpawn(%game, %client, %respawn);
}
function SinglePlayerGame::equip(%game, %player, %set)
{
if(!isObject(%player))

View file

@ -77,6 +77,8 @@ function TrainingGui::onWake( %this )
function TrainingGui::onSleep( %this )
{
%this.stopBriefing();
Canvas.popDialog(LaunchToolbarDlg);
}
//------------------------------------------------------------------------------

View file

@ -264,25 +264,24 @@ function AIMissionEnd()
%client = ClientGroup.getObject(%i);
if (%client.isAIControlled())
{
//cancel the respawn thread
if (%client.respawnThread > 0)
{
cancel(%client.respawnThread);
%client.respawnThread = "";
}
//cancel the respawn thread and the objective thread...
cancel(%client.respawnThread);
cancel(%client.objectiveThread);
//cancel the objective reassessment thread
if (%client.objectiveThread > 0)
{
cancel(%client.objectiveThread);
%client.objectiveThread = "";
}
AIUnassignClient(%client);
//reset the clients tasks, variables, etc...
AIUnassignClient(%client);
%client.stop();
%client.clearTasks();
%client.clearStep();
%client.defaultTasksAdded = false;
%client.missionCycleCleanup();
%client.clearStep();
%client.lastDamageClient = -1;
%client.lastDamageTurret = -1;
%client.setEngageTarget(-1);
%client.setTargetObject(-1);
%client.pilotVehicle = false;
%client.defaultTasksAdded = false;
//do the nav graph cleanup
%client.missionCycleCleanup();
}
}
@ -398,6 +397,15 @@ function AIVehicleMounted(%vehicle)
$AIVehicleSet.add(%vehicle);
}
function AICorpseAdded(%corpse)
{
if (isObject(%corpse))
{
%corpse.isCorpse = true;
$AIItemSet.add(%corpse);
}
}
//OTHER UTILITY FUNCTIONS
function AIConnection::onAIDrop(%client)
@ -439,6 +447,7 @@ function AIConnection::startMission(%client)
//sends a message so everyone know the bot is in the game...
Game.AIHasJoined(%client);
%client.matchStartReady = true;
//spawn the bot...
onAIRespawn(%client);
@ -522,7 +531,7 @@ function AIReassessObjective(%client)
{
ProfilePatch1(patchForTimeTest, %client);
// Game.AIChooseGameObjective(%client);
schedule(5000, %client, "AIReassessObjective", %client);
%client.objectiveThread = schedule(5000, %client, "AIReassessObjective", %client);
}
function onAIRespawn(%client)
@ -552,7 +561,7 @@ function onAIRespawn(%client)
%client.respawnThread = "";
//timeslice the objective reassessment for the bots
if (%client.objectiveThread <= 0)
if (!isEventPending(%client.objectiveThread))
{
%curTime = getSimTime();
%remainder = %curTime % 5000;

View file

@ -14,6 +14,9 @@ function BountyGame::onAIRespawn(%game, %client)
%client.addTask(AIBountyPatrolTask);
%client.bountyTask = %client.addTask(AIBountyEngageTask);
}
//set the inv flag
%client.spawnUseInv = true;
}
function BountyGame::AIInit(%game)
@ -59,12 +62,14 @@ function AIBountyEngageTask::weight(%task, %client)
}
//see if anyone has fired on us recently...
%mustEngage = false;
%losTimeout = 5000 + ($AIClientLOSTimeout * %client.getSkillLevel());
if (AIClientIsAlive(%client.lastDamageClient, %losTimeout) && getSimTime() - %client.lastDamageTime < %losTimeout)
{
//see if the attacker is either our target or, we are their target
if (%client.lastDamageClient == %client.objectiveTarget || %client.lastDamageClient.objectiveTarget == %client)
{
%mustEngage = true;
%currentTarget = %client.getEngageTarget();
//see if this is a new attacker
@ -105,7 +110,40 @@ function AIBountyEngageTask::weight(%task, %client)
//now set the weight
if (%client.shouldEngage > 0)
%task.setWeight($AIWeightReturnFire);
{
//if we've been fired upon...
if (%mustEngage)
%task.setWeight($AIWeightReturnFire);
//see if we can allow the bot to use an inv station...
else if (%client.spawnUseInv)
{
//see if there's an available inv station
%result = AIFindClosestInventory(%client, false);
%closestInv = getWord(%result, 0);
%closestDist = getWord(%result, 1);
if (isObject(%closestInv))
{
if (isObject(%client.shouldEngage.player))
{
%dist = %client.getPathDistance(%client.shouldEngage.player.position);
if (%dist < 70 || %closestDist > 200)
%task.setWeight($AIWeightReturnFire);
else
%task.setWeight($AIBountyWeightShouldEngage);
}
else
%task.setWeight($AIBountyWeightShouldEngage);
}
else
{
%client.spawnUseInv = false;
%task.setWeight($AIWeightReturnFire);
}
}
else
%task.setWeight($AIWeightReturnFire);
}
else
%task.setWeight(0);
}

View file

@ -18,5 +18,8 @@ function DMGame::onAIRespawn(%game, %client)
%client.addtask(AIDetectMineTask);
%client.addTask(AIPatrolTask);
}
//set the inv flag
%client.spawnUseInv = true;
}

View file

@ -68,6 +68,16 @@ function aiCome(%from, %to)
%from.player.setTransform(%to.player.getTransform());
}
function findBotWithInv(%item)
{
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
if (isObject(%cl.player) && %cl.player.getInventory(%item))
echo(%cl @ ":" SPC getTaggedString(%cl.name) SPC "has item" SPC %item);
}
}
function listInv(%client)
{
%player = %client.player;
@ -152,6 +162,21 @@ function listInv(%client)
%count = %player.getInventory(ShockLance);
if (%count > 0)
echo("ShockLance: " @ %count);
%count = %player.getInventory(RepairPack);
if (%count > 0)
echo("RepairPack: " @ %count);
%count = %player.getInventory(EnergyPack);
if (%count > 0)
echo("EnergyPack: " @ %count);
%count = %player.getInventory(ShieldPack);
if (%count > 0)
echo("ShieldPack: " @ %count);
%count = %player.getInventory(CloakingPack);
if (%count > 0)
echo("CloakingPack: " @ %count);
%count = %player.getInventory(SensorJammerPack);
if (%count > 0)
echo("SensorJammerPack: " @ %count);
}
function createAIDebugDlg()

View file

@ -27,6 +27,9 @@ $AIHuntersWeightPickupFlag = 4425;
$AIRabbitWeightDefault = 4625;
$AIRabbitWeightNeedInv = 4325;
//Bounty weights...
$AIBountyWeightShouldEngage = 4325;
//-----------------------------------------------------------------------------
//AIEngageTask is responsible for anything to do with engaging an enemy
@ -292,7 +295,9 @@ function AIPickupItemTask::weight(%task, %client)
if (!%item.isHidden())
{
%dist = %client.getPathDistance(%item.getWorldBoxCenter());
if ((%item.getDataBlock().getName() $= "RepairKit" || %item.getDataBlock().getName() $= "RepairPatch") && %damage > 0.3)
if (((%item.getDataBlock().getName() $= "RepairKit" || %item.getDataBlock().getName() $= "RepairPatch") ||
(%item.isCorpse && %item.getInventory("RepairKit") > 0)) &&
%player.getInventory("RepairKit") <= 0 && %damage > 0.3)
{
if (%dist > 0 && %dist < %closestHealthDist)
{
@ -335,7 +340,7 @@ function AIPickupItemTask::weight(%task, %client)
if (%closestItem > 0 && %closetItemDist < %closestHealthDist - 25 && (%damage < 0.6 || %currentTarget <= 0) && %closestItemLOS)
{
%task.pickupItem = %closestItem;
if (AIEngageOutOfAmmo(%client))
if (AIEngageWeaponRating(%client) < 20)
%task.setWeight($AIWeightNeedItemBadly);
else if (%closestItemDist < 10 && %closestItemLOS)
%task.setWeight($AIWeightNeedItem);
@ -363,7 +368,7 @@ function AIPickupItemTask::weight(%task, %client)
else if (%closestItem > 0)
{
%task.pickupItem = %closestItem;
if (AIEngageOutOfAmmo(%client))
if (AIEngageWeaponRating(%client) < 20)
%task.setWeight($AIWeightNeedItemBadly);
else if (%closestItemDist < 10 && %closestItemLOS)
%task.setWeight($AIWeightNeedItem);
@ -420,6 +425,31 @@ function AIUseInventoryTask::weight(%task, %client)
%damage = %player.getDamagePercent();
%weaponry = AIEngageWeaponRating(%client);
//if there's an inv station, and we haven't used an inv station since we
//spawned, the bot should use an inv once regardless
if (%client.spawnUseInv)
{
//see if we're already heading there
if (%client.buyInvTime != %task.buyInvTime)
{
//see if there's an inventory we can use
%result = AIFindClosestInventory(%client, false);
%closestInv = getWord(%result, 0);
if (isObject(%closestInv))
{
%task.setWeight($AIWeightNeedItem);
return;
}
else
%client.spawnUseInv = false;
}
else
{
%task.setWeight($AIWeightNeedItem);
return;
}
}
//first, see if we need equipment or health
if (%damage < 0.3 && %weaponry >= 40)
{
@ -456,15 +486,12 @@ function AIUseInventoryTask::weight(%task, %client)
%task.setWeight(0);
return;
}
//If they don't have LOS to the inv station, they should only use it if they need something badly
%mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType;
%hasLOS = !containerRayCast(%client.player.getWorldBoxCenter(), %closestInv.getWorldBoxCenter(), %mask, 0);
//set the weight...
%task.closestInv = %closestInv;
if (%damage > 0.8 || AIEngageOutOfAmmo(%client))
%task.setWeight($AIWeightNeedItemBadly);
else if (%closestDist < 20 && %hasLOS && (AIEngageWeaponRating(%client) <= 30 || %damage > 0.4))
else if (%closestDist < 20 && (AIEngageWeaponRating(%client) <= 30 || %damage > 0.4))
%task.setWeight($AIWeightNeedItem);
else if (%hasLOS)
%task.setWeight($AIWeightFoundItem);
@ -481,7 +508,7 @@ function AIUseInventoryTask::monitor(%task, %client)
%damage = %player.getDamagePercent();
%weaponry = AIEngageWeaponRating(%client);
if (%damage < 0.3 && %weaponry >= 40)
if (%damage < 0.3 && %weaponry >= 40 && !%client.spawnUseInv)
{
%task.buyInvTime = getSimTime();
return;
@ -491,13 +518,21 @@ function AIUseInventoryTask::monitor(%task, %client)
%randNum = getRandom();
if (%randNum < 0.4)
%buySet = "LightEnergyDefault MediumEnergySet HeavyEnergySet";
else if (%randNum < 0.7)
else if (%randNum < 0.6)
%buySet = "LightShieldSet MediumShieldSet HeavyShieldSet";
else
else if (%randNum < 0.8)
%buySet = "LightEnergyELF MediumRepairSet HeavyAmmoSet";
else
%buySet = "LightEnergySniper MediumEnergySet HeavyEnergySet";
//reset the simTime if we're not still in progress
//process the inv buying state machine
%result = AIBuyInventory(%client, "", %buySet, %task.buyInvTime);
//if we succeeded, reset the spawn flag
if (%result $= "Finished")
%client.spawnUseInv = false;
//if we succeeded or failed, reset the state machine...
if (%result !$= "InProgress")
%task.buyInvTime = getSimTime();

View file

@ -25,6 +25,9 @@ function HuntersGame::onAIRespawn(%game, %client)
%client.addTask(AIPatrolTask);
%client.huntersTask = %client.addTask(AIHuntersTask);
}
//set the inv flag
%client.spawnUseInv = true;
}
//---------------------------------------------------------------------------

View file

@ -342,29 +342,47 @@ function AICouldUseItem(%client, %item)
return false;
}
//check ammo
%quantity = mFloor(%playerDataBlock.max[%type] * 0.7);
if (%player.getInventory(%type) < %quantity)
{
if (%type $= "ChainGunAmmo" && %player.getInventory("ChainGun") > 0)
return true;
if (%type $= "PlasmaAmmo" && %player.getInventory("Plasma") > 0)
return true;
if (%type $= "DiscAmmo" && %player.getInventory("Disc") > 0)
return true;
if (%type $= "GrenadeLauncher" && %player.getInventory("GrenadeLauncherAmmo") > 0)
return true;
if (%type $= "MortarAmmo" && %player.getInventory("Mortar") > 0)
return true;
//if the item is acutally, a corpse, check the corpse inventory...
if (%item.isCorpse)
{
%corpse = %item;
if (%corpse.getInventory("ChainGunAmmo") > 0 && %player.getInventory(%type) < %playerDataBlock.max[ChainGunAmmo])
return true;
if (%corpse.getInventory("PlasmaAmmo") > 0 && %player.getInventory(%type) < %playerDataBlock.max[PlasmaAmmo])
return true;
if (%corpse.getInventory("DiscAmmo") > 0 && %player.getInventory(%type) < %playerDataBlock.max[DiscAmmo])
return true;
if (%corpse.getInventory("GrenadeLauncher") > 0 && %player.getInventory(%type) < %playerDataBlock.max[GrenadeLauncher])
return true;
if (%corpse.getInventory("MortarAmmo") > 0 && %player.getInventory(%type) < %playerDataBlock.max[MortarAmmo] && %player.getInventory("Mortar") > 0)
return true;
}
else
{
//check ammo
%quantity = mFloor(%playerDataBlock.max[%type]);
if (%player.getInventory(%type) < %quantity)
{
if (%type $= "ChainGunAmmo")
return true;
if (%type $= "PlasmaAmmo")
return true;
if (%type $= "DiscAmmo")
return true;
if (%type $= "GrenadeLauncher")
return true;
if (%type $= "MortarAmmo" && %player.getInventory("Mortar") > 0)
return true;
//check mines and grenades as well
if (%type $= "Grenade" || %type $= "FlashGrenade" || %type $= "ConcussionGrenade")
return true;
}
//check mines and grenades as well
if (%type $= "Grenade" || %type $= "FlashGrenade" || %type $= "ConcussionGrenade")
return true;
}
//see if we can carry another weapon...
if (AICanPickupWeapon(%client, %type))
return true;
//see if we can carry another weapon...
if (AICanPickupWeapon(%client, %type))
return true;
}
//guess we didn't find anything useful... (should still check for mines and grenades)
return false;
@ -391,8 +409,9 @@ function AIEngageOutofAmmo(%client)
%hasELF = (%player.getInventory("ELFGun") > 0);
%hasMortar = (%player.getInventory("Mortar") > 0);
%hasMissile = (%player.getInventory("MissileLauncher") > 0);
%hasLance = (%player.getInventory("ShockLance") > 0);
if(%hasBlaster || %hasSniper || %hasElf)
if (%hasBlaster || %hasSniper || %hasElf || %hasLance)
return false;
else
{
@ -422,7 +441,7 @@ function AICanPickupWeapon(%client, %weapon)
//make sure the %weapon given is a weapon they can use for engagement
if (%weapon !$= "Blaster" && %weapon !$= "Plasma" && %weapon !$= "Chaingun" && %weapon !$= "Disc" &&
%weapon !$= "GrenadeLauncher" && %weapon !$= "SniperRifle" && %weapon !$= "ELFGun")
%weapon !$= "GrenadeLauncher" && %weapon !$= "SniperRifle" && %weapon !$= "ELFGun" && %weapon !$= "ShockLance")
{
return false;
}

View file

@ -15,6 +15,9 @@ function RabbitGame::onAIRespawn(%game, %client)
%client.addTask(AITauntCorpseTask);
%client.rabbitTask = %client.addTask(AIRabbitTask);
}
//set the inv flag
%client.spawnUseInv = true;
}
//---------------------------------------------------------------------------
@ -68,6 +71,33 @@ function AIRabbitTask::weight(%task, %client)
%task.setWeight($AIRabbitWeightDefault);
else
%task.setWeight($AIRabbitWeightNeedInv);
//see if the spawnUseInv flag should be reset
if (%client.spawnUseInv)
{
if (!isObject($AIRabbitFlag.carrier))
{
//see if there are any bots closer to a dropped flag
%found = false;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl != %client && %cl.isAIControlled() && isObject(%cl.player))
{
%dist = VectorDist(%cl.player.position, $AIRabbitFlag.position);
if (%dist < %distToFlag)
{
%found = true;
break;
}
}
}
//reset the spawnUseInv flag if we're the closest
if (!%found)
%client.spawnUsInv = false;
}
}
}
}

View file

@ -212,7 +212,7 @@ function PlayGui::onWake(%this)
}
$enableDirectInput = "1";
enableDirectInput();
activateDirectInput();
// chat hud dialog
Canvas.pushDialog( MainChatHud );
@ -246,7 +246,11 @@ function PlayGui::onSleep(%this)
moveMap.pop();
if ( isObject( passengerKeys ) )
passengerKeys.pop();
flyingCameraMove.pop();
if ( isObject( observerBlockMap ) )
observerBlockMap.pop();
if ( isObject( observerMap ) )
observerMap.pop();
//flyingCameraMove.pop();
CursorOn();
}
@ -350,16 +354,6 @@ function ClientCmdVoteSubmitted(%type)
}
// End client voting functions.
function clientCmdSetVoiceCodec(%codec)
{
if (%codec $= ".v12" || %codec $= ".v24" || %codec $= ".v29")
$Audio::voiceCodec = %codec;
else
$Audio::voiceCodec = "";
echo("Got setVoiceCodec: " @ %codec);
alxCaptureInit();
}
function clientCmdEndBomberSight()
{
PlayGui.remove($bombSightHud);
@ -1769,11 +1763,17 @@ function sceneLightingComplete()
}
clientCmdResetHud();
%numChannels = $pref::Audio::microphoneEnabled ? $pref::audio::voiceChannels : 0;
commandToServer('SetVoiceChannels', %numChannels);
commandToServer('SetVoiceInfo', $pref::Audio::voiceChannels, $pref::Audio::decodingMask, $pref::Audio::encodingLevel);
commandToServer('MissionStartPhase3Done', $MSeq);
}
function clientCmdSetVoiceInfo(%channels, %decodingMask, %encodingLevel)
{
$Audio::serverChannels = %channels;
$Audio::serverDecodingMask = %decodingMask;
$Audio::serverEncodingLevel = %encodingLevel;
}
function ClientReceivedDataBlock(%index, %total)
{
%pct = %index / %total;

View file

@ -22,7 +22,6 @@ $AudioProviders[3, isHardware] = false;
$AudioProviders[3, enableEvironment] = false;
// defaults
$Audio::voiceCodec = ".v12";
$Audio::defaultDriver = "miles";
$Audio::innerFalloffScale = "1.0";
$Audio::dynamicMemorySize = (1 << 20);

View file

@ -1,11 +1,15 @@
$JoinGamePort = 28000;
$pref::Audio::drivers = "Miles";
$pref::Audio::enableVoiceCapture = 1;
$pref::Audio::forceMaxDistanceUpdate = 0;
$pref::Audio::voiceChannels = 2;
$pref::Audio::activeDriver = "default";
$pref::Audio::drivers = "Miles";
$pref::Audio::frequency = 22100;
$pref::Audio::sampleBits = 16;
$pref::Audio::channels = 2;
$pref::Audio::enableVoiceCapture = 1;
$pref::Audio::voiceChannels = 2;
$pref::Audio::encodingLevel = 0;
$pref::Audio::decodingMask = 1;
$pref::Audio::forceMaxDistanceUpdate = 0;
$pref::Audio::environmentEnabled = 0;
$pref::Audio::microphoneEnabled = 1;
$pref::Audio::musicEnabled = 1;
$pref::Audio::musicVolume = 0.8;
$pref::Audio::masterVolume = 0.8;
@ -69,17 +73,14 @@ $pref::Forum::CacheSize = 100;
$pref::HudMessageLogSize = 40;
$pref::Input::ActiveConfig = "MyConfig";
$pref::Input::LinkMouseSensitivity = 1;
$pref::Input::MouseEnabled = 0;
$pref::Input::JoystickEnabled = 0;
$pref::Input::KeyboardTurnSpeed = 0.1;
$pref::Interior::TexturedFog = 0;
$pref::IRCClient::server = "198.74.38.141";
$pref::IRCClient::serverport = 6668;
$pref::IRCClient::autoreconnect = 1;
$pref::IRCClient::showjoinleave = 1;
$pref::IRCClient::awaymsg = "Don't be alarmed. I'm going to step away from my computer.";
$pref::IRCClient::banmsg = "You, and three generations of your offspring, are banned from this channel.";
$pref::IRCClient::kickmsg = "Alright, you're outta here!";
$pref::IRCClient::hostmsg = "left to host a game.";
$pref::Lobby::Column1 = 120;
$pref::Lobby::Column2 = 120;
$pref::Lobby::Column3 = 50;
@ -143,3 +144,4 @@ $pref::VisibleDistanceMod = 1.0;
$pref::OpenGL::force16BitTexture = "0";
$pref::OpenGL::forcePalettedTexture = "1";
$pref::OpenGL::maxHardwareLights = 3;
$pref::OpenGL::allowTexGen = "1";

View file

@ -180,23 +180,6 @@ moveMap.bind( keyboard, "pageUp", pageMessageHudUp );
moveMap.bind( keyboard, "pageDown", pageMessageHudDown );
//------------------------------------------------------------------------------
// VOICE CAPTURE FUNCTIONS:
function voiceCapStart()
{
vcRecordingHud.setVisible(true);
voiceCommHud.setVisible(true);
resizeVoiceCommWindow();
alxCaptureStart();
}
function voiceCapStop()
{
vcRecordingHud.setVisible(false);
if($numTalking < 1)
voiceCommHud.setVisible(false);
alxCaptureStop();
}
function voiceCapture( %val )
{
if ( %val )
@ -1031,7 +1014,18 @@ moveMap.bind( keyboard, insert, voteYes );
moveMap.bind( keyboard, delete, voteNo );
///////////////////////
//Vehicle Keys
// Observer Keys
///////////////////////
if ( isObject( observerMap ) )
observerMap.delete();
new ActionMap( observerMap );
observerMap.bind( keyboard, t, moveup );
observerMap.bind( keyboard, b, movedown );
observerMap.bind( keyboard, space, jump );
observerMap.bind( mouse, button1, mouseJet );
///////////////////////
// Vehicle Keys
///////////////////////
function clientCmdSetWeaponryVehicleKeys()
{
@ -1104,6 +1098,12 @@ function clientCmdSetDefaultVehicleKeys(%inVehicle)
passengerKeys.copyBind( moveMap, setZoomFOV );
passengerKeys.copyBind( moveMap, toggleZoom );
// Copy the joystick binds as well:
passengerKeys.copyBind( moveMap, joyPitch );
passengerKeys.copyBind( moveMap, joyYaw );
passengerKeys.copyBind( moveMap, joystickMoveX );
passengerKeys.copyBind( moveMap, joystickMoveY );
// Bind the chat keys as well:
passengerKeys.copyBind( moveMap, ToggleMessageHud );
passengerKeys.copyBind( moveMap, TeamMessageHud );
@ -1229,9 +1229,7 @@ function serverCmdSetVehicleWeapon(%client, %num)
%turret.setImageTrigger(2, false);
%turret.setImageTrigger(4, false);
}
}
}
function nextVehicleWeapon(%val)

View file

@ -349,7 +349,7 @@ addCreditsLine("Daniel \"Emp\" Arnold");
addCreditsLine("Daniel \"Snaggs\" Soderstrom");
addCreditsLine("Daniel \"Trebz\" Nolan");
addCreditsLine("Daniel \"Wizard_TPG\" Neilsen");
addCreditsLine("Daniel \"Zero\" Nichols");
addCreditsLine("Daniel \"Shadow Mage\" Nichols");
addCreditsLine("Daniel \"Spooger\" Patton");
addCreditsLine("Danny \"OmegaRed\" Cotton");
addCreditsLine("Darion \"Shadower\" Lowenstein");
@ -383,7 +383,7 @@ addCreditsLine("Jeremy \"Xevious\" Burke");
addCreditsLine("Jerry \"Tycho Brahe\" Holkins");
addCreditsLine("Joe \"Quadrature\" Downs");
addCreditsLine("Joe Bell Grant");
addCreditsLine("Joern \"[TD] Pangur\" Schnautz");
addCreditsLine("Joern \"Pangur\" Schnautz");
addCreditsLine("John \"Dr.Jones\" Burnett");
addCreditsLine("Jon \"Ratorasniki\" Naiman");
addCreditsLine("Jonathan \"Chaser\" Bale");
@ -420,7 +420,7 @@ addCreditsLine("Nathan \"[HvC]NaTeDoGG\" Sweet");
addCreditsLine("Nick \"Enhanced Panda\" Orlich");
addCreditsLine("Nick \"Leb\" Petska");
addCreditsLine("Nick S. \"Enlightened One\" Pasto");
addCreditsLine("Nickita \"FSB-SPY\" Bogolyubov");
addCreditsLine("Nikita \"FSB-SPY\" Bogolyubov");
addCreditsLine("Olivier \"[cf] OroX\" Roulx");
addCreditsLine("Omar Yehia");
addCreditsLine("Pamela A. \"Diva\" Holmberg");
@ -1166,7 +1166,7 @@ addCreditsLine("Michael van Huystee");
addCreditsLine("Michael Voigt");
addCreditsLine("Michael Waldvogle");
addCreditsLine("Michael Wichter");
addCreditsLine("micheal thornton");
addCreditsLine("Michael Thornton");
addCreditsLine("Mickey Borchardt");
addCreditsLine("Miguel Schneeberger");
addCreditsLine("Mika Hyvonen");
@ -1289,7 +1289,7 @@ addCreditsLine("Phill Curiale");
addCreditsLine("Phillip Ervin");
addCreditsLine("Phillip Kono");
addCreditsLine("Phillip Ploesser");
addCreditsLine("phillip stewart");
addCreditsLine("Phillip Stewart");
addCreditsLine("Pöchhacker Lee");
addCreditsLine("Prasad Galpoththawela");
addCreditsLine("Radu Lucian");

View file

@ -15,8 +15,8 @@ $DamageType::Missile = 9;
$DamageType::ShockLance = 10;
$DamageType::Mine = 11;
$DamageType::Explosion = 12;
$DamageType::Impact = 13;
$DamageType::Ground = 14;
$DamageType::Impact = 13; // Object to object collisions
$DamageType::Ground = 14; // Object to ground collisions
$DamageType::Turret = 15;
$DamageType::PlasmaTurret = 16;
@ -96,7 +96,73 @@ $DamageTypeText[99] = "suicide";
//----------------------------------------------------------------------------
// VEHICLE DAMAGE PROFILES
//----------------------------------------------------------------------------
datablock SimDataBlock(AirVehicleDamageProfile)
//**** SHRIKE SCOUT FIGHTER ****
datablock SimDataBlock(ShrikeDamageProfile)
{
shieldDamageScale[$DamageType::Blaster] = 1.0;
shieldDamageScale[$DamageType::Bullet] = 1.75;
shieldDamageScale[$DamageType::ELF] = 1.0;
shieldDamageScale[$DamageType::ShockLance] = 0.5;
shieldDamageScale[$DamageType::Laser] = 1.0;
shieldDamageScale[$DamageType::ShrikeBlaster] = 4.0;
shieldDamageScale[$DamageType::BellyTurret] = 2.0;
shieldDamageScale[$DamageType::AATurret] = 3.0;
shieldDamageScale[$DamageType::IndoorDepTurret] = 2.25;
shieldDamageScale[$DamageType::OutdoorDepTurret] = 2.25;
shieldDamageScale[$DamageType::SentryTurret] = 2.25;
shieldDamageScale[$DamageType::Disc] = 1.0;
shieldDamageScale[$DamageType::Grenade] = 1.0;
shieldDamageScale[$DamageType::Mine] = 3.0;
shieldDamageScale[$DamageType::Missile] = 3.0;
shieldDamageScale[$DamageType::Mortar] = 2.0;
shieldDamageScale[$DamageType::Plasma] = 1.0;
shieldDamageScale[$DamageType::BomberBombs] = 3.0;
shieldDamageScale[$DamageType::TankChaingun] = 3.0;
shieldDamageScale[$DamageType::TankMortar] = 2.0;
shieldDamageScale[$DamageType::MissileTurret] = 3.0;
shieldDamageScale[$DamageType::MortarTurret] = 2.0;
shieldDamageScale[$DamageType::PlasmaTurret] = 2.0;
shieldDamageScale[$DamageType::SatchelCharge] = 3.5;
shieldDamageScale[$DamageType::Default] = 1.0;
shieldDamageScale[$DamageType::Impact] = 1.1;
shieldDamageScale[$DamageType::Ground] = 1.0;
shieldDamageScale[$DamageType::Explosion] = 3.0;
shieldDamageScale[$DamageType::Lightning] = 10.0;
damageScale[$DamageType::Blaster] = 1.0;
damageScale[$DamageType::Bullet] = 1.0;
damageScale[$DamageType::ELF] = 0.0;
damageScale[$DamageType::ShockLance] = 0.50;
damageScale[$DamageType::Laser] = 1.0;
damageScale[$DamageType::ShrikeBlaster] = 3.5;
damageScale[$DamageType::BellyTurret] = 1.2;
damageScale[$DamageType::AATurret] = 1.5;
damageScale[$DamageType::IndoorDepTurret] = 1.25;
damageScale[$DamageType::OutdoorDepTurret] = 1.25;
damageScale[$DamageType::SentryTurret] = 1.25;
damageScale[$DamageType::Disc] = 1.0;
damageScale[$DamageType::Grenade] = 0.75;
damageScale[$DamageType::Mine] = 4.0;
damageScale[$DamageType::Missile] = 1.5;
damageScale[$DamageType::Mortar] = 2.0;
damageScale[$DamageType::Plasma] = 0.5;
damageScale[$DamageType::BomberBombs] = 2.0;
damageScale[$DamageType::TankChaingun] = 2.0;
damageScale[$DamageType::TankMortar] = 2.0;
damageScale[$DamageType::MissileTurret] = 1.5;
damageScale[$DamageType::MortarTurret] = 2.0;
damageScale[$DamageType::PlasmaTurret] = 2.0;
damageScale[$DamageType::SatchelCharge] = 3.5;
damageScale[$DamageType::Default] = 1.0;
damageScale[$DamageType::Impact] = 1.1;
damageScale[$DamageType::Ground] = 1.0;
damageScale[$DamageType::Explosion] = 2.0;
damageScale[$DamageType::Lightning] = 10.0;
};
//**** THUNDERSWORD BOMBER ****
datablock SimDataBlock(BomberDamageProfile)
{
shieldDamageScale[$DamageType::Blaster] = 1.0;
shieldDamageScale[$DamageType::Bullet] = 1.0;
@ -123,7 +189,7 @@ datablock SimDataBlock(AirVehicleDamageProfile)
shieldDamageScale[$DamageType::PlasmaTurret] = 2.0;
shieldDamageScale[$DamageType::SatchelCharge] = 3.5;
shieldDamageScale[$DamageType::Default] = 1.0;
shieldDamageScale[$DamageType::Impact] = 1.0;
shieldDamageScale[$DamageType::Impact] = 0.8;
shieldDamageScale[$DamageType::Ground] = 1.0;
shieldDamageScale[$DamageType::Explosion] = 3.0;
shieldDamageScale[$DamageType::Lightning] = 10.0;
@ -153,13 +219,78 @@ datablock SimDataBlock(AirVehicleDamageProfile)
damageScale[$DamageType::PlasmaTurret] = 2.0;
damageScale[$DamageType::SatchelCharge] = 3.5;
damageScale[$DamageType::Default] = 1.0;
damageScale[$DamageType::Impact] = 1.0;
damageScale[$DamageType::Impact] = 0.8;
damageScale[$DamageType::Ground] = 1.0;
damageScale[$DamageType::Explosion] = 2.0;
damageScale[$DamageType::Lightning] = 10.0;
};
datablock SimDataBlock(GravCycleDamageProfile)
//**** HAVOC TRANSPORT ****
datablock SimDataBlock(HavocDamageProfile)
{
shieldDamageScale[$DamageType::Blaster] = 1.0;
shieldDamageScale[$DamageType::Bullet] = 1.0;
shieldDamageScale[$DamageType::ELF] = 1.0;
shieldDamageScale[$DamageType::ShockLance] = 0.5;
shieldDamageScale[$DamageType::Laser] = 1.0;
shieldDamageScale[$DamageType::ShrikeBlaster] = 3.5;
shieldDamageScale[$DamageType::BellyTurret] = 2.0;
shieldDamageScale[$DamageType::AATurret] = 3.0;
shieldDamageScale[$DamageType::IndoorDepTurret] = 2.25;
shieldDamageScale[$DamageType::OutdoorDepTurret] = 2.25;
shieldDamageScale[$DamageType::SentryTurret] = 2.25;
shieldDamageScale[$DamageType::Disc] = 1.0;
shieldDamageScale[$DamageType::Grenade] = 1.0;
shieldDamageScale[$DamageType::Mine] = 3.0;
shieldDamageScale[$DamageType::Missile] = 3.0;
shieldDamageScale[$DamageType::Mortar] = 2.0;
shieldDamageScale[$DamageType::Plasma] = 1.0;
shieldDamageScale[$DamageType::BomberBombs] = 3.0;
shieldDamageScale[$DamageType::TankChaingun] = 3.0;
shieldDamageScale[$DamageType::TankMortar] = 2.0;
shieldDamageScale[$DamageType::MissileTurret] = 3.0;
shieldDamageScale[$DamageType::MortarTurret] = 2.0;
shieldDamageScale[$DamageType::PlasmaTurret] = 2.0;
shieldDamageScale[$DamageType::SatchelCharge] = 3.5;
shieldDamageScale[$DamageType::Default] = 1.0;
shieldDamageScale[$DamageType::Impact] = 0.5;
shieldDamageScale[$DamageType::Ground] = 1.0;
shieldDamageScale[$DamageType::Explosion] = 3.0;
shieldDamageScale[$DamageType::Lightning] = 10.0;
damageScale[$DamageType::Blaster] = 0.75;
damageScale[$DamageType::Bullet] = 0.75;
damageScale[$DamageType::ELF] = 0.0;
damageScale[$DamageType::ShockLance] = 0.50;
damageScale[$DamageType::Laser] = 1.0;
damageScale[$DamageType::ShrikeBlaster] = 2.5;
damageScale[$DamageType::BellyTurret] = 1.2;
damageScale[$DamageType::AATurret] = 1.5;
damageScale[$DamageType::IndoorDepTurret] = 1.25;
damageScale[$DamageType::OutdoorDepTurret] = 1.25;
damageScale[$DamageType::SentryTurret] = 1.25;
damageScale[$DamageType::Disc] = 1.0;
damageScale[$DamageType::Grenade] = 0.75;
damageScale[$DamageType::Mine] = 4.0;
damageScale[$DamageType::Missile] = 1.5;
damageScale[$DamageType::Mortar] = 2.0;
damageScale[$DamageType::Plasma] = 0.5;
damageScale[$DamageType::BomberBombs] = 2.0;
damageScale[$DamageType::TankChaingun] = 2.0;
damageScale[$DamageType::TankMortar] = 2.0;
damageScale[$DamageType::MissileTurret] = 1.5;
damageScale[$DamageType::MortarTurret] = 2.0;
damageScale[$DamageType::PlasmaTurret] = 2.0;
damageScale[$DamageType::SatchelCharge] = 3.5;
damageScale[$DamageType::Default] = 1.0;
damageScale[$DamageType::Impact] = 0.5;
damageScale[$DamageType::Ground] = 1.0;
damageScale[$DamageType::Explosion] = 2.0;
damageScale[$DamageType::Lightning] = 10.0;
};
//**** WILDCAT GRAV CYCLE ****
datablock SimDataBlock(WildcatDamageProfile)
{
shieldDamageScale[$DamageType::Blaster] = 2.0;
shieldDamageScale[$DamageType::Bullet] = 2.5;
@ -185,7 +316,7 @@ datablock SimDataBlock(GravCycleDamageProfile)
shieldDamageScale[$DamageType::PlasmaTurret] = 2.0;
shieldDamageScale[$DamageType::SatchelCharge] = 3.0;
shieldDamageScale[$DamageType::Default] = 1.0;
shieldDamageScale[$DamageType::Impact] = 1.0;
shieldDamageScale[$DamageType::Impact] = 1.25;
shieldDamageScale[$DamageType::Ground] = 1.0;
shieldDamageScale[$DamageType::Explosion] = 2.0;
shieldDamageScale[$DamageType::Lightning] = 5.0;
@ -214,13 +345,14 @@ datablock SimDataBlock(GravCycleDamageProfile)
damageScale[$DamageType::PlasmaTurret] = 1.0;
damageScale[$DamageType::SatchelCharge] = 2.2;
damageScale[$DamageType::Default] = 1.0;
damageScale[$DamageType::Impact] = 1.0;
damageScale[$DamageType::Impact] = 1.25;
damageScale[$DamageType::Ground] = 1.0;
damageScale[$DamageType::Explosion] = 1.0;
damageScale[$DamageType::Lightning] = 5.0;
};
datablock SimDataBlock(GroundVehicleDamageProfile)
//**** BEOWULF TANK ****
datablock SimDataBlock(TankDamageProfile)
{
shieldDamageScale[$DamageType::Blaster] = 0.6;
shieldDamageScale[$DamageType::Bullet] = 0.75;
@ -246,7 +378,7 @@ datablock SimDataBlock(GroundVehicleDamageProfile)
shieldDamageScale[$DamageType::PlasmaTurret] = 1.25;
shieldDamageScale[$DamageType::SatchelCharge] = 2.0;
shieldDamageScale[$DamageType::Default] = 1.0;
shieldDamageScale[$DamageType::Impact] = 1.0;
shieldDamageScale[$DamageType::Impact] = 0.75;
shieldDamageScale[$DamageType::Ground] = 1.0;
shieldDamageScale[$DamageType::Explosion] = 2.0;
shieldDamageScale[$DamageType::Lightning] = 10.0;
@ -275,7 +407,69 @@ datablock SimDataBlock(GroundVehicleDamageProfile)
damageScale[$DamageType::PlasmaTurret] = 1.0;
damageScale[$DamageType::SatchelCharge] = 2.0;
damageScale[$DamageType::Default] = 1.0;
damageScale[$DamageType::Impact] = 1.0;
damageScale[$DamageType::Impact] = 0.75;
damageScale[$DamageType::Ground] = 1.0;
damageScale[$DamageType::Explosion] = 1.0;
damageScale[$DamageType::Lightning] = 10.0;
};
//**** JERICHO MPB ****
datablock SimDataBlock(MPBDamageProfile)
{
shieldDamageScale[$DamageType::Blaster] = 0.6;
shieldDamageScale[$DamageType::Bullet] = 0.75;
shieldDamageScale[$DamageType::ELF] = 1.0;
shieldDamageScale[$DamageType::ShockLance] = 0.5;
shieldDamageScale[$DamageType::Laser] = 1.0;
shieldDamageScale[$DamageType::ShrikeBlaster] = 1.75;
shieldDamageScale[$DamageType::BellyTurret] = 1.25;
shieldDamageScale[$DamageType::AATurret] = 0.8;
shieldDamageScale[$DamageType::IndoorDepTurret] = 1.0;
shieldDamageScale[$DamageType::OutdoorDepTurret] = 1.0;
shieldDamageScale[$DamageType::Disc] = 0.8;
shieldDamageScale[$DamageType::Grenade] = 0.8;
shieldDamageScale[$DamageType::Mine] = 3.25;
shieldDamageScale[$DamageType::Missile] = 2.0;
shieldDamageScale[$DamageType::Mortar] = 0.8;
shieldDamageScale[$DamageType::Plasma] = 1.0;
shieldDamageScale[$DamageType::BomberBombs] = 1.5;
shieldDamageScale[$DamageType::TankChaingun] = 1.5;
shieldDamageScale[$DamageType::TankMortar] = 1.4;
shieldDamageScale[$DamageType::MissileTurret] = 1.25;
shieldDamageScale[$DamageType::MortarTurret] = 1.0;
shieldDamageScale[$DamageType::PlasmaTurret] = 1.25;
shieldDamageScale[$DamageType::SatchelCharge] = 2.0;
shieldDamageScale[$DamageType::Default] = 1.0;
shieldDamageScale[$DamageType::Impact] = 0.5;
shieldDamageScale[$DamageType::Ground] = 1.0;
shieldDamageScale[$DamageType::Explosion] = 2.0;
shieldDamageScale[$DamageType::Lightning] = 10.0;
damageScale[$DamageType::Blaster] = 0.75;
damageScale[$DamageType::Bullet] = 0.75;
damageScale[$DamageType::ELF] = 0.0;
damageScale[$DamageType::ShockLance] = 0.50;
damageScale[$DamageType::Laser] = 1.0;
damageScale[$DamageType::ShrikeBlaster] = 2.0;
damageScale[$DamageType::BellyTurret] = 1.0;
damageScale[$DamageType::AATurret] = 1.0;
damageScale[$DamageType::IndoorDepTurret] = 1.0;
damageScale[$DamageType::OutdoorDepTurret] = 1.0;
damageScale[$DamageType::Disc] = 1.0;
damageScale[$DamageType::Grenade] = 1.0;
damageScale[$DamageType::Mine] = 2.25;
damageScale[$DamageType::Missile] = 1.25;
damageScale[$DamageType::Mortar] = 1.0;
damageScale[$DamageType::Plasma] = 0.5;
damageScale[$DamageType::BomberBombs] = 1.0;
damageScale[$DamageType::TankChaingun] = 0.75;
damageScale[$DamageType::TankMortar] = 1.0;
damageScale[$DamageType::MissileTurret] = 1.25;
damageScale[$DamageType::MortarTurret] = 1.0;
damageScale[$DamageType::PlasmaTurret] = 1.0;
damageScale[$DamageType::SatchelCharge] = 2.0;
damageScale[$DamageType::Default] = 1.0;
damageScale[$DamageType::Impact] = 0.5;
damageScale[$DamageType::Ground] = 1.0;
damageScale[$DamageType::Explosion] = 1.0;
damageScale[$DamageType::Lightning] = 10.0;
@ -380,7 +574,7 @@ datablock SimDataBlock(StaticShapeDamageProfile)
shieldDamageScale[$DamageType::PlasmaTurret] = 2.0;
shieldDamageScale[$DamageType::SatchelCharge] = 6.0;
shieldDamageScale[$DamageType::Default] = 1.0;
shieldDamageScale[$DamageType::Impact] = 1.0;
shieldDamageScale[$DamageType::Impact] = 1.25;
shieldDamageScale[$DamageType::Ground] = 1.0;
shieldDamageScale[$DamageType::Explosion] = 2.0;
shieldDamageScale[$DamageType::Lightning] = 5.0;
@ -410,7 +604,7 @@ datablock SimDataBlock(StaticShapeDamageProfile)
damageScale[$DamageType::PlasmaTurret] = 2.0;
damageScale[$DamageType::SatchelCharge] = 4.0;
damageScale[$DamageType::Default] = 1.0;
damageScale[$DamageType::Impact] = 1.0;
damageScale[$DamageType::Impact] = 1.25;
damageScale[$DamageType::Ground] = 1.0;
damageScale[$DamageType::Explosion] = 1.0;
damageScale[$DamageType::Lightning] = 5.0;
@ -447,7 +641,7 @@ datablock SimDataBlock(LightPlayerDamageProfile)
damageScale[$DamageType::PlasmaTurret] = 1.0;
damageScale[$DamageType::SatchelCharge] = 3.0;
damageScale[$DamageType::Default] = 1.0;
damageScale[$DamageType::Impact] = 1.0;
damageScale[$DamageType::Impact] = 1.2;
damageScale[$DamageType::Ground] = 1.0;
damageScale[$DamageType::Explosion] = 1.2;
damageScale[$DamageType::Lightning] = 1.0;
@ -513,7 +707,7 @@ datablock SimDataBlock(HeavyPlayerDamageProfile)
damageScale[$DamageType::PlasmaTurret] = 1.0;
damageScale[$DamageType::SatchelCharge] = 3.0;
damageScale[$DamageType::Default] = 1.0;
damageScale[$DamageType::Impact] = 1.0;
damageScale[$DamageType::Impact] = 0.8;
damageScale[$DamageType::Ground] = 1.0;
damageScale[$DamageType::Explosion] = 0.6;
damageScale[$DamageType::Lightning] = 1.4;

View file

@ -927,6 +927,9 @@ function DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %
else
aiReleaseHumanControl(%clVictim, %clVictim.controlAI);
//used to track corpses so the AI can get ammo, etc...
AICorpseAdded(%plVictim);
//if the death was a suicide, prevent respawning for 5 seconds...
%clVictim.lastDeathSuicide = false;
if (%damageType == $DamageType::Suicide)
@ -2305,6 +2308,9 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k
%outrankTarget = !%targetClient.isSuperAdmin;
else if ( %client.isAdmin )
%outrankTarget = !%targetClient.isAdmin;
if( ! %targetClient.matchStartReady )
return;
//mute options
if ( !%isTargetSelf )
@ -2509,14 +2515,28 @@ function DefaultGame::sendTimeLimitList( %game, %client, %key )
//------------------------------------------------------------------------------
// all global votes here
function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typeDisplayName, %mission, %missionType)
function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typeDisplayName, %missionId, %missionTypeId)
{
%mission = $HostMissionFile[%missionId];
if ( %mission $= "" )
{
error( "Invalid mission index passed to DefaultGame::voteChangeMission!" );
return;
}
%missionType = $HostTypeName[%missionTypeId];
if ( %missionType $= "" )
{
error( "Invalid mission type id passed to DefaultGame::voteChangeMission!" );
return;
}
if(%admin)
{
messageAll('MsgAdminChangeMission', '\c2The Admin has changed the mission to %1 (%2).', %missionDisplayName, %typeDisplayName );
logEcho("mission changed to "@%missionDisplayName@"/"@%typeDisplayName@" (admin)");
%game.gameOver();
loadMission(%mission, %missionType, false);
loadMission( %mission, %missionType, false );
}
else
{
@ -2526,7 +2546,7 @@ function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typ
messageAll('MsgVotePassed', '\c2The mission was changed to %1 (%2) by vote.', %missionDisplayName, %typeDisplayName );
logEcho("mission changed to "@%missionDisplayName@"/"@%typeDisplayName@" (vote)");
%game.gameOver();
loadMission(%mission, %missionType, false);
loadMission( %mission, %missionType, false );
}
else
messageAll('MsgVoteFailed', '\c2Change mission vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100));
@ -2586,8 +2606,22 @@ function DefaultGame::voteTeamDamage(%game, %admin)
}
//------------------------------------------------------------------------------
function DefaultGame::voteTournamentMode( %game, %admin, %missionDisplayName, %typeDisplayName, %mission, %missionType )
function DefaultGame::voteTournamentMode( %game, %admin, %missionDisplayName, %typeDisplayName, %missionId, %missionTypeId )
{
%mission = $HostMissionFile[%missionId];
if ( %mission $= "" )
{
error( "Invalid mission index passed to DefaultGame::voteTournamentMode!" );
return;
}
%missionType = $HostTypeName[%missionTypeId];
if ( %missionType $= "" )
{
error( "Invalid mission type id passed to DefaultGame::voteTournamentMode!" );
return;
}
%cause = "";
if (%admin)
{
@ -2904,9 +2938,6 @@ function DefaultGame::updateScoreHud(%game, %client, %tag)
%index++;
}
//clear the rest of Hud so we don't get old lines hanging around...
messageClient( %client, 'ClearHud', "", %tag, %index );
}
else
{
@ -2980,9 +3011,40 @@ function DefaultGame::updateScoreHud(%game, %client, %tag)
}
}
//clear the rest of Hud so we don't get old lines hanging around...
messageClient( %client, 'ClearHud', "", %tag, %index );
}
// Tack on the list of observers:
%observerCount = 0;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl.team == 0)
%observerCount++;
}
if (%observerCount > 0)
{
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++;
messageClient(%client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush><font:Univers Condensed:22>\tOBSERVERS (%1)<rmargin:260><just:right>TIME<spop>', %observerCount);
%index++;
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
//if this is an observer
if (%cl.team == 0)
{
%obsTime = getSimTime() - %cl.observerStartTime;
%obsTimeStr = %game.formatTime(%obsTime, false);
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:20, 310>\t<clip:150>%1</clip><rmargin:260><just:right>%2',
%cl.name, %obsTimeStr );
%index++;
}
}
}
//clear the rest of Hud so we don't get old lines hanging around...
messageClient( %client, 'ClearHud', "", %tag, %index );
}
//------------------------------------------------------------------------------
@ -3016,6 +3078,42 @@ function notifyMatchEnd(%time)
UpdateClientTimes(%time);
}
function DefaultGame::formatTime(%game, %tStr, %includeHundredths)
{
%timeInSeconds = %tStr / 1000;
%mins = mFloor(%timeInSeconds / 60);
if(%mins < 1)
%timeString = "00:";
else if(%mins < 10)
%timeString = "0" @ %mins @ ":";
else
%timeString = %mins @ ":";
%timeInSeconds -= (%mins * 60);
%secs = mFloor(%timeInSeconds);
if(%secs < 1)
%timeString = %timeString @ "00";
else if(%secs < 10)
%timeString = %timeString @ "0" @ %secs;
else
%timeString = %timeString @ %secs;
if (%includeHundredths)
{
%timeString = %timeString @ ".";
%timeInSeconds -= %secs;
%hSecs = mFloor(%timeInSeconds * 100); // will be between 0 and 999
if(%hSecs < 1)
%timeString = %timeString @ "00";
else if(%hSecs < 10)
%timeString = %timeString @ "0" @ %hSecs;
else
%timeString = %timeString @ %hSecs;
}
return %timeString;
}
//------------------------------------------------------------------------------
//AI FUNCTIONS
function DefaultGame::AIChooseGameObjective(%game, %client)

View file

@ -118,6 +118,8 @@ datablock StaticShapeData(DeployedStationInventory) : StaticShapeDamageProfile
renderWhenDestroyed = false;
doesRepair = true;
deployedObject = true;
cmdCategory = "DSupport";
cmdIcon = CMDStationIcon;
cmdMiniIconName = "commander/MiniIcons/com_inventory_grey";
@ -126,6 +128,7 @@ datablock StaticShapeData(DeployedStationInventory) : StaticShapeDamageProfile
debrisShapeName = "debris_generic_small.dts";
debris = DeployableDebris;
heatSignature = 0;
};
datablock ShapeBaseImageData(InventoryDeployableImage)
@ -138,6 +141,7 @@ datablock ShapeBaseImageData(InventoryDeployableImage)
mountPoint = 1;
offset = "0 0 0";
deployed = DeployedStationInventory;
heatSignature = 0;
stateName[0] = "Idle";
stateTransitionOnTriggerDown[0] = "Activate";
@ -163,6 +167,7 @@ datablock ItemData(InventoryDeployable)
rotate = false;
image = "InventoryDeployableImage";
pickUpName = "an inventory pack";
heatSignature = 0;
computeCRC = true;
emap = true;
@ -194,6 +199,8 @@ datablock StaticShapeData(DeployedMotionSensor) : StaticShapeDamageProfile
explosion = DeployablesExplosion;
dynamicType = $TypeMasks::SensorObjectType;
deployedObject = true;
cmdCategory = "DSupport";
cmdIcon = CMDSensorIcon;
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
@ -206,6 +213,7 @@ datablock StaticShapeData(DeployedMotionSensor) : StaticShapeDamageProfile
debrisShapeName = "debris_generic_small.dts";
debris = DeployableDebris;
heatSignature = 0;
};
datablock ShapeBaseImageData(MotionSensorDeployableImage)
@ -226,6 +234,7 @@ datablock ShapeBaseImageData(MotionSensorDeployableImage)
maxDepSlope = 360;
deploySound = MotionSensorDeploySound;
emap = true;
heatSignature = 1;
};
datablock ItemData(MotionSensorDeployable)
@ -243,6 +252,7 @@ datablock ItemData(MotionSensorDeployable)
computeCRC = true;
emap = true;
heatSignature = 0;
//maxSensors = 3;
maxSensors = 2;
@ -271,6 +281,8 @@ datablock StaticShapeData(DeployedPulseSensor) : StaticShapeDamageProfile
explosion = DeployablesExplosion;
dynamicType = $TypeMasks::SensorObjectType;
deployedObject = true;
cmdCategory = "DSupport";
cmdIcon = CMDSensorIcon;
cmdMiniIconName = "commander/MiniIcons/com_deploypulsesensor";
@ -283,6 +295,7 @@ datablock StaticShapeData(DeployedPulseSensor) : StaticShapeDamageProfile
debrisShapeName = "debris_generic_small.dts";
debris = DeployableDebris;
heatSignature = 0;
};
datablock ShapeBaseImageData(PulseSensorDeployableImage)
@ -303,6 +316,7 @@ datablock ShapeBaseImageData(PulseSensorDeployableImage)
maxDepSlope = 40;
emap = true;
heatSignature = 0;
};
datablock ItemData(PulseSensorDeployable)
@ -366,7 +380,7 @@ datablock ItemData(TurretOutdoorDeployable)
pickupRadius = 1;
rotate = false;
image = "TurretOutdoorDeployableImage";
pickUpName = "an outdoor turret pack";
pickUpName = "a landspike turret pack";
computeCRC = true;
emap = true;
@ -410,7 +424,7 @@ datablock ItemData(TurretIndoorDeployable)
pickupRadius = 1;
rotate = false;
image = "TurretIndoorDeployableImage";
pickUpName = "an indoor turret pack";
pickUpName = "a spider clamp turret pack";
computeCRC = true;
emap = true;
@ -889,6 +903,10 @@ function ShapeBaseImageData::onDeploy(%item, %plyr, %slot)
%deplObj.setDeployRotation(%item.surfacePt, %item.surfaceNrm);
else
%deplObj.setTransform(%item.surfacePt SPC %rot);
// set the recharge rate right away
if(%deplObj.getDatablock().rechargeRate)
%deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate);
// set team, owner, and handle
%deplObj.team = %plyr.client.Team;

View file

@ -1,83 +1,83 @@
function createObserverMoveMap()
{
if ( isObject( flyingCameraMove ) )
flyingCameraMove.delete();
new ActionMap( flyingCameraMove );
flyingCameraMove.bind( keyboard, s, moveleft );
flyingCameraMove.bind( keyboard, f, moveright );
flyingCameraMove.bind( keyboard, e, moveforward );
flyingCameraMove.bind( keyboard, d, movebackward );
flyingCameraMove.bind( keyboard, t, moveup );
flyingCameraMove.bind( keyboard, b, movedown );
// allow hud activation
flyingCameraMove.copyBind( moveMap, toggleScoreScreen );
flyingCameraMove.copyBind( moveMap, toggleCommanderMap );
flyingCameraMove.copyBind( moveMap, TeamMessageHud );
flyingCameraMove.copyBind( moveMap, toggleMessageHud );
flyingCameraMove.copyBind( moveMap, toggleInventoryHud );
flyingCameraMove.copyBind( moveMap, voteYes );
flyingCameraMove.copyBind( moveMap, voteNo );
flyingCameraMove.copyBind( moveMap, activateChatMenuHud );
// Bind the command assignment/response keys as well:
flyingCameraMove.copyBind( moveMap, toggleTaskListDlg );
flyingCameraMove.copyBind( moveMap, fnAcceptTask );
flyingCameraMove.copyBind( moveMap, fnDeclineTask );
flyingCameraMove.copyBind( moveMap, fnTaskCompleted );
flyingCameraMove.copyBind( moveMap, fnResetTaskList );
// misc
flyingCameraMove.copyBind( moveMap, voiceCapture );
// inventory binds
flyingCameraMove.copyBind( moveMap, toggleInventoryHud );
flyingCameraMove.copyBind( moveMap, selectFavorite1 );
flyingCameraMove.copyBind( moveMap, selectFavorite2 );
flyingCameraMove.copyBind( moveMap, selectFavorite3 );
flyingCameraMove.copyBind( moveMap, selectFavorite4 );
flyingCameraMove.copyBind( moveMap, selectFavorite5 );
flyingCameraMove.copyBind( moveMap, selectFavorite6 );
flyingCameraMove.copyBind( moveMap, selectFavorite7 );
flyingCameraMove.copyBind( moveMap, selectFavorite8 );
flyingCameraMove.copyBind( moveMap, selectFavorite9 );
flyingCameraMove.copyBind( moveMap, selectFavorite10 );
flyingCameraMove.copyBind( moveMap, selectFavorite11 );
flyingCameraMove.copyBind( moveMap, selectFavorite12 );
flyingCameraMove.copyBind( moveMap, selectFavorite13 );
flyingCameraMove.copyBind( moveMap, selectFavorite14 );
flyingCameraMove.copyBind( moveMap, selectFavorite15 );
flyingCameraMove.copyBind( moveMap, selectFavorite16 );
flyingCameraMove.copyBind( moveMap, selectFavorite17 );
flyingCameraMove.copyBind( moveMap, selectFavorite18 );
flyingCameraMove.copyBind( moveMap, selectFavorite19 );
flyingCameraMove.copyBind( moveMap, selectFavorite20 );
flyingCameraMove.copyBind( moveMap, quickPackEnergyPack );
flyingCameraMove.copyBind( moveMap, quickPackRepairPack );
flyingCameraMove.copyBind( moveMap, quickPackShieldPack );
flyingCameraMove.copyBind( moveMap, quickPackCloakPack );
flyingCameraMove.copyBind( moveMap, quickPackJammerPack );
flyingCameraMove.copyBind( moveMap, quickPackAmmoPack );
flyingCameraMove.copyBind( moveMap, quickPackSatchelCharge );
flyingCameraMove.copyBind( moveMap, quickPackDeployableStation );
flyingCameraMove.copyBind( moveMap, quickPackIndoorTurret );
flyingCameraMove.copyBind( moveMap, quickPackOutdoorTurret );
flyingCameraMove.copyBind( moveMap, quickPackMotionSensor );
flyingCameraMove.copyBind( moveMap, quickPackPulse );
//preserve the fire, jump, and jet buttons
flyingCameraMove.copyBind( moveMap, mouseFire );
flyingCameraMove.copyBind( moveMap, mouseJet );
flyingCameraMove.copyBind( moveMap, jump );
flyingCameraMove.copyBind( moveMap, yaw );
flyingCameraMove.copyBind( moveMap, pitch );
flyingCameraMove.bindCmd( keyboard, escape, "", "escapeFromGame();" );
}
createObserverMoveMap();
// function createObserverMoveMap()
// {
// if ( isObject( flyingCameraMove ) )
// flyingCameraMove.delete();
//
// new ActionMap( flyingCameraMove );
// flyingCameraMove.bind( keyboard, s, moveleft );
// flyingCameraMove.bind( keyboard, f, moveright );
// flyingCameraMove.bind( keyboard, e, moveforward );
// flyingCameraMove.bind( keyboard, d, movebackward );
// flyingCameraMove.bind( keyboard, t, moveup );
// flyingCameraMove.bind( keyboard, b, movedown );
//
// // allow hud activation
// flyingCameraMove.copyBind( moveMap, toggleScoreScreen );
// flyingCameraMove.copyBind( moveMap, toggleCommanderMap );
// flyingCameraMove.copyBind( moveMap, TeamMessageHud );
// flyingCameraMove.copyBind( moveMap, toggleMessageHud );
// flyingCameraMove.copyBind( moveMap, toggleInventoryHud );
// flyingCameraMove.copyBind( moveMap, voteYes );
// flyingCameraMove.copyBind( moveMap, voteNo );
// flyingCameraMove.copyBind( moveMap, activateChatMenuHud );
//
// // Bind the command assignment/response keys as well:
// flyingCameraMove.copyBind( moveMap, toggleTaskListDlg );
// flyingCameraMove.copyBind( moveMap, fnAcceptTask );
// flyingCameraMove.copyBind( moveMap, fnDeclineTask );
// flyingCameraMove.copyBind( moveMap, fnTaskCompleted );
// flyingCameraMove.copyBind( moveMap, fnResetTaskList );
//
// // misc
// flyingCameraMove.copyBind( moveMap, voiceCapture );
//
// // inventory binds
// flyingCameraMove.copyBind( moveMap, toggleInventoryHud );
// flyingCameraMove.copyBind( moveMap, selectFavorite1 );
// flyingCameraMove.copyBind( moveMap, selectFavorite2 );
// flyingCameraMove.copyBind( moveMap, selectFavorite3 );
// flyingCameraMove.copyBind( moveMap, selectFavorite4 );
// flyingCameraMove.copyBind( moveMap, selectFavorite5 );
// flyingCameraMove.copyBind( moveMap, selectFavorite6 );
// flyingCameraMove.copyBind( moveMap, selectFavorite7 );
// flyingCameraMove.copyBind( moveMap, selectFavorite8 );
// flyingCameraMove.copyBind( moveMap, selectFavorite9 );
// flyingCameraMove.copyBind( moveMap, selectFavorite10 );
//
// flyingCameraMove.copyBind( moveMap, selectFavorite11 );
// flyingCameraMove.copyBind( moveMap, selectFavorite12 );
// flyingCameraMove.copyBind( moveMap, selectFavorite13 );
// flyingCameraMove.copyBind( moveMap, selectFavorite14 );
// flyingCameraMove.copyBind( moveMap, selectFavorite15 );
// flyingCameraMove.copyBind( moveMap, selectFavorite16 );
// flyingCameraMove.copyBind( moveMap, selectFavorite17 );
// flyingCameraMove.copyBind( moveMap, selectFavorite18 );
// flyingCameraMove.copyBind( moveMap, selectFavorite19 );
// flyingCameraMove.copyBind( moveMap, selectFavorite20 );
//
// flyingCameraMove.copyBind( moveMap, quickPackEnergyPack );
// flyingCameraMove.copyBind( moveMap, quickPackRepairPack );
// flyingCameraMove.copyBind( moveMap, quickPackShieldPack );
// flyingCameraMove.copyBind( moveMap, quickPackCloakPack );
// flyingCameraMove.copyBind( moveMap, quickPackJammerPack );
// flyingCameraMove.copyBind( moveMap, quickPackAmmoPack );
// flyingCameraMove.copyBind( moveMap, quickPackSatchelCharge );
// flyingCameraMove.copyBind( moveMap, quickPackDeployableStation );
// flyingCameraMove.copyBind( moveMap, quickPackIndoorTurret );
// flyingCameraMove.copyBind( moveMap, quickPackOutdoorTurret );
// flyingCameraMove.copyBind( moveMap, quickPackMotionSensor );
// flyingCameraMove.copyBind( moveMap, quickPackPulse );
//
// //preserve the fire, jump, and jet buttons
// flyingCameraMove.copyBind( moveMap, mouseFire );
// flyingCameraMove.copyBind( moveMap, mouseJet );
// flyingCameraMove.copyBind( moveMap, jump );
// flyingCameraMove.copyBind( moveMap, yaw );
// flyingCameraMove.copyBind( moveMap, pitch );
//
// flyingCameraMove.bindCmd( keyboard, escape, "", "escapeFromGame();" );
// }
// createObserverMoveMap();
//--------------------------------------------------------------------------
function GameConnection::sensorPing(%this, %ping)
@ -652,6 +652,7 @@ function MessageHud::open(%this)
MessageHud_Edit.extent = setWord(MessageHud_Edit.extent, 0, %ctrlExtent - %textExtent - (2 * %offset));
%this.setVisible(true);
deactivateKeyboard();
MessageHud_Edit.makeFirstResponder(true);
}
@ -677,6 +678,8 @@ function MessageHud::close(%this)
Canvas.popDialog(%this);
%this.setVisible(false);
if ( $enableDirectInput )
activateKeyboard();
MessageHud_Edit.setValue("");
}
@ -716,7 +719,7 @@ function MainChatHud::onWake( %this )
{
// set the chat hud to the users pref
%this.setChatHudLength( $Pref::ChatHudLength );
}
}
// chat hud sizes
$outerChatLenY[1] = 72;
@ -934,8 +937,12 @@ function updateActionMaps()
moveMap.pop();
if (isObject(passengerKeys))
passengerKeys.pop();
if (isObject(flyingCameraMove))
flyingCameraMove.pop();
if ( isObject( observerBlockMap ) )
observerBlockMap.pop();
if ( isObject( observerMap ) )
observerMap.pop();
//if (isObject(flyingCameraMove))
// flyingCameraMove.pop();
if (isObject(ControlActionMap))
ControlActionMap.pop();
@ -953,7 +960,18 @@ function updateActionMaps()
ControlActionMap.push();
case "Observer":
flyingCameraMove.push();
moveMap.push();
if ( isObject( observerBlockMap ) )
observerBlockMap.delete();
// Create an action map just to block unwanted parts of the move map:
new ActionMap( observerBlockMap );
observerBlockMap.blockBind( moveMap, jump );
observerBlockMap.blockBind( moveMap, mouseJet );
observerBlockMap.blockBind( moveMap, toggleZoom );
observerBlockMap.blockBind( moveMap, setZoomFOV );
observerBlockMap.push();
observerMap.push();
//flyingCameraMove.push();
case "PickTeam":
// no mapping
@ -1237,19 +1255,33 @@ function clearHud(%msgType, %msgString, %tag, %a0)
{
for(%i = 0; %i < $Hud[%tag].numCol; %i++)
{
$Hud[%tag].childGui.remove($Hud[%tag].data[%startingLine, %i]);
$Hud[%tag].data[%startingLine, %i] = "";
}
//don't forget to resize
if (%tag $= 'scoreScreen')
{
%prevExtent = $Hud[%tag].childGui.extent;
$Hud[%tag].childGui.extent = firstWord(%prevExtent) SPC (getWord(%prevExtent, 1) - 24);
//remove and delete the hud line
%obj = $Hud[%tag].data[%startingLine, %i];
$Hud[%tag].childGui.remove(%obj);
$Hud[%tag].data[%startingLine, %i] = "";
%obj.delete();
}
%startingLine++;
}
//don't forget to adjust the size accordingly...
if (%tag $= 'scoreScreen')
{
%height = 0;
%guiCtrl = $Hud[%tag].childGui;
//set the new extent to be the position + extent of the last element...
%height = 0;
if (%guiCtrl.getCount() > 0)
{
%lastCtrl = %guiCtrl.getObject(%guiCtrl.getCount() - 1);
%height = getWord(%lastCtrl.position, 1) + getWord(%lastCtrl.extent, 1);
}
//now reset the extent
%guiCtrl.resize(getWord(%guiCtrl.position, 0), getWord(%guiCtrl.position, 1), getWord(%guiCtrl.extent, 0), %height);
}
}
//------------------------------------------------------------------------------
@ -1264,11 +1296,22 @@ function removeLineHud(%msgType, %msgString, %hudName, %lineNumber, %a0, %a1, %a
$Hud[%tag].data[%lineNum, %i] = "";
}
//don't forget to resize
//don't forget to adjust the size accordingly...
if (%tag $= 'scoreScreen')
{
%prevExtent = $Hud[%tag].childGui.extent;
$Hud[%tag].childGui.extent = firstWord(%prevExtent) SPC (getWord(%prevExtent, 1) - 24);
%height = 0;
%guiCtrl = $Hud[%tag].childGui;
//set the new extent to be the position + extent of the last element...
%height = 0;
if (%guiCtrl.getCount() > 0)
{
%lastCtrl = %guiCtrl.getObject(%guiCtrl.getCount() - 1);
%height = getWord(%lastCtrl.position, 1) + getWord(%lastCtrl.extent, 1);
}
//now reset the extent
%guiCtrl.resize(getWord(%guiCtrl.position, 0), getWord(%guiCtrl.position, 1), getWord(%guiCtrl.extent, 0), %height);
}
}
@ -1287,6 +1330,24 @@ function setLineHud(%msgType, %msgString, %hudName, %lineNumber, %a0, %a1, %a2,
for(%i = 0; %i < $Hud[%tag].numCol; %i++)
$Hud[%tag].data[%lineNum, %i].hudSetValue(detag(%a[%i]),detag(%a4));
//don't forget to adjust the size accordingly...
if (%tag $= 'scoreScreen')
{
%height = 0;
%guiCtrl = $Hud[%tag].childGui;
//set the new extent to be the position + extent of the last element...
%height = 0;
if (%guiCtrl.getCount() > 0)
{
%lastCtrl = %guiCtrl.getObject(%guiCtrl.getCount() - 1);
%height = getWord(%lastCtrl.position, 1) + getWord(%lastCtrl.extent, 1);
}
//now reset the extent
%guiCtrl.resize(getWord(%guiCtrl.position, 0), getWord(%guiCtrl.position, 1), getWord(%guiCtrl.extent, 0), %height);
}
}
//------------------------------------------------------------------------------

View file

@ -333,6 +333,14 @@ function Flag::onAdd(%this, %obj)
// make sure flags play "flapping" ambient thread
Parent::onAdd(%this, %obj);
%obj.playThread($AmbientThread, "ambient");
%blocker = new VehicleBlocker()
{
position = %obj.position;
rotation = %obj.rotation;
dimensions = "2 2 4";
};
MissionCleanup.add(%blocker);
}
function Flag::onCollision(%data,%obj,%col)

View file

@ -17,13 +17,12 @@ function joystickMoveY(%val)
$mvBackwardAction = ( %val > 0.0 );
}
function joystickYaw(%val)
function joyYaw(%val)
{
// Let the mapping system do all the scaling/inversion...
$mvYaw += %val;
$mvYaw += getMouseAdjustAmount( %val );
}
function joystickPitch(%val)
function joyPitch(%val)
{
$mvPitch += %val;
}
$mvPitch += getMouseAdjustAmount( %val );
}

View file

@ -19,6 +19,8 @@ function LoadingGui::onWake(%this)
$HudHandle['shellScreen'] = "";
}
$HudHandle['loadingScreen'] = alxPlay(LoadingScreenSound, 0, 0, 0);
CloseMessagePopup();
}
//------------------------------------------------------------------------------

View file

@ -103,7 +103,7 @@ function setupObjHud(%gameType)
profile = "GuiTextObjGreenCenterProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "100 3";
position = "105 3";
extent = "50 16";
visible = "1";
};
@ -111,7 +111,7 @@ function setupObjHud(%gameType)
profile = "GuiTextObjHudCenterProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "100 19";
position = "105 19";
extent = "50 16";
visible = "1";
};
@ -783,17 +783,6 @@ function cnhAddTeam(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6)
objectiveHud.numHeld[%teamNum].setValue(%held);
}
//addMessageCallback('MsgFlipFlopInit', hudFlipFlopInit);
//function hudFlipFlopInit(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6)
//{
// %flipNum = detag(%a1);
// %flipName = Game.cleanWord(detag(%a2));
// %status = detag(%a3);
// if(%flipName $= "")
// %flipname = "FlipFlop " @ %flipNum;
//}
addMessageCallback('MsgFlipFlopsHeld', hudFlipFlopsHeld);
function hudFlipFlopsHeld(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6)

View file

@ -83,6 +83,12 @@ datablock ItemData(RepairPack)
image = "RepairPackImage";
pickUpName = "a repair pack";
lightOnlyStatic = true;
lightType = "PulsingLight";
lightColor = "1 0 0 1";
lightTime = 1200;
lightRadius = 4;
computeCRC = true;
emap = true;
};

View file

@ -413,16 +413,18 @@ function SatchelChargeThrown::onDestroyed(%this, %object, %lastState)
%dmgRadius = 10;
%dmgMod = 0.3;
%expImpulse = 1000;
%dmgType = $DamageType::Explosion;
}
else
{
messageClient(%object.sourceObject.client, 'msgSatchelChargeDetonate', "\c2Satchel Charge Detonated!");
messageClient(%object.sourceObject.client, 'msgSatchelChargeDetonate', "\c2Satchel charge detonated!");
%dmgRadius = 20;
%dmgMod = 1.0;
%expImpulse = 2500;
%dmgType = $DamageType::SatchelCharge;
}
RadiusExplosion(%object, %object.getPosition(), %dmgRadius, %dmgMod, %expImpulse, %object.sourceObject, $DamageType::SatchelCharge);
RadiusExplosion(%object, %object.getPosition(), %dmgRadius, %dmgMod, %expImpulse, %object.sourceObject, %dmgType);
%object.schedule(500, "delete");
}

View file

@ -1,78 +0,0 @@
//--------------------------------------------------------------------------
// Pathed objects:
//
// accept the following commands:
// goForward()
// goBackward()
// goToWaypoint(waypoint)
// doCollideReverse()
//
// respond to the following queries
// getNumWaypoints()
//
// generate the following events
// onTriggerTick
// onStop
// onCollide (For non-displacing objects only)
//
//--------------------------------------------------------------------------
datablock PathedObjectData(defaultPathFollow)
{
displaceObjects = "false";
reversalPauseMS = 1000;
};
datablock PathedObjectData(displaceOnCollision)
{
displaceObjects = "true";
reversalPauseMS = 1000;
};
function PathedObject::onTrigger(%this, %triggerId, %on)
{
// Default behavior for a door:
// if triggered: go to open state (last waypoint)
// if untriggered: go to closed state (first waypoint)
if (%on $= "true") {
%this.triggerCount++;
} else {
if (%this.triggerCount > 0)
%this.triggerCount--;
}
if (%this.triggerCount > 0)
%this.goForward();
else
%this.goBackward();
}
// Commented out functions are implemented in code for efficiency, placed here for
// parameter description...
//
//function PathedObject::onTriggerTick(%this, %triggerId)
//{
// // Do nothing
//}
//
//function PathedObject::onStop(%this, %position)
//{
// // Do nothing by default.
// // Possible values for %position:
// // Start
// // End
// // # (Waypoint number)
//}
//
//function PathedObject::onCollide(%this, %position)
//{
// %myBlock = %this.getDataBlock();
//
// if (%myBlock.displaceObjects) {
// error(%this @ ": displacing pathed objects should never call onCollide");
// return;
// }
//
// %this.doCollideReverse();
//}\

View file

@ -1,4 +1,4 @@
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
$InvincibleTime = 6;
@ -949,11 +949,11 @@ datablock SplashData(PlayerSplash)
datablock ParticleData(HumanArmorJetParticle)
{
dragCoefficient = 1.5;
dragCoefficient = 0.0;
gravityCoefficient = 0;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 150;
lifetimeMS = 50;
lifetimeVarianceMS = 0;
textureName = "particleTest";
colors[0] = "0.32 0.47 0.47 1.0";
@ -1160,7 +1160,10 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
rechargeRate = 0.256;
jetForce = 26.2 * 90;
underwaterJetForce = 26.2 * 90 * 2.0;
underwaterVertJetFactor = 1.5;
jetEnergyDrain = 0.8;
underwaterJetEnergyDrain = 0.5;
minJetEnergy = 1;
maxJetHorizontalPercentage = 0.8;
@ -1171,6 +1174,11 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
maxBackwardSpeed = 13;
maxSideSpeed = 13;
maxUnderwaterForwardSpeed = 8.4;
maxUnderwaterBackwardSpeed = 7.8;
maxUnderwaterSideSpeed = 7.8;
jumpForce = 8.3 * 90;
jumpEnergyDrain = 0;
minJumpEnergy = 0;
@ -1217,9 +1225,9 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
splashEmitter[0] = PlayerFoamDropletsEmitter;
splashEmitter[1] = PlayerFoamEmitter;
splashEmitter[2] = PlayerBubbleEmitter;
mediumSplashSoundVelocity = 25.0;
hardSplashSoundVelocity = 35.0;
exitSplashSoundVelocity = 12.0;
mediumSplashSoundVelocity = 10.0;
hardSplashSoundVelocity = 20.0;
exitSplashSoundVelocity = 5.0;
// Controls over slope of runnable/jumpable surfaces
runSurfaceAngle = 70;
@ -1238,8 +1246,8 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
upResistFactor = 0.3;
// heat inc'ers and dec'ers
heatDecayPerSec = 1.0 / 6.0; // takes 6 seconds to clear heat sig.
heatIncreasePerSec = 1.0 / 3.0; // takes 3 seconds of constant jet to get full heat sig.
heatDecayPerSec = 1.0 / 3.0; // takes 3 seconds to clear heat sig.
heatIncreasePerSec = 1.0 / 3.0; // takes 3.0 seconds of constant jet to get full heat sig.
footstepSplashHeight = 0.35;
//Footstep Sounds
@ -1406,7 +1414,10 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
rechargeRate = 0.256;
jetForce = 24.6 * 130;
underwaterJetForce = 24.6 * 130 * 2.0;
underwaterVertJetFactor = 1.5;
jetEnergyDrain = 1.0;
underwaterJetEnergyDrain = 0.5;
minJetEnergy = 1;
maxJetHorizontalPercentage = 0.8;
@ -1417,12 +1428,16 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
maxBackwardSpeed = 10;
maxSideSpeed = 10;
maxUnderwaterForwardSpeed = 6.6;
maxUnderwaterBackwardSpeed = 6;
maxUnderwaterSideSpeed = 6;
recoverDelay = 9;
recoverRunForceScale = 1.2;
// heat inc'ers and dec'ers
heatDecayPerSec = 1.0 / 6.0; // takes 6 seconds to clear heat sig.
heatIncreasePerSec = 1.0 / 3.0; // takes 3 seconds of constant jet to get full heat sig.
heatDecayPerSec = 1.0 / 3.0; // takes 3 seconds to clear heat sig.
heatIncreasePerSec = 1.0 / 3.0; // takes 3.0 seconds of constant jet to get full heat sig.
jumpForce = 8.4 * 130;
jumpEnergyDrain = 0;
@ -1484,9 +1499,9 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
splashEmitter[0] = PlayerFoamDropletsEmitter;
splashEmitter[1] = PlayerFoamEmitter;
splashEmitter[2] = PlayerBubbleEmitter;
mediumSplashSoundVelocity = 25.0;
hardSplashSoundVelocity = 35.0;
exitSplashSoundVelocity = 12.0;
mediumSplashSoundVelocity = 10.0;
hardSplashSoundVelocity = 20.0;
exitSplashSoundVelocity = 5.0;
footstepSplashHeight = 0.35;
//Footstep Sounds
@ -1652,7 +1667,10 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
rechargeRate = 0.256;
jetForce = 21.4 * 180;
underwaterJetForce = 21.4 * 180 * 2.0;
underwaterVertJetFactor = 1.5;
jetEnergyDrain = 1.1;
underwaterJetEnergyDrain = 0.55;
minJetEnergy = 1;
maxJetHorizontalPercentage = 0.8;
@ -1663,6 +1681,10 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
maxBackwardSpeed = 5;
maxSideSpeed = 5;
maxUnderwaterForwardSpeed = 3.9;
maxUnderwaterBackwardSpeed = 3;
maxUnderwaterSideSpeed = 3;
recoverDelay = 9;
recoverRunForceScale = 1.2;
@ -1672,8 +1694,8 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
jumpDelay = 0;
// heat inc'ers and dec'ers
heatDecayPerSec = 1.0 / 6.0; // takes 6 seconds to clear heat sig.
heatIncreasePerSec = 1.0 / 3.0; // takes 3 seconds of constant jet to get full heat sig.
heatDecayPerSec = 1.0 / 3.0; // takes 3 seconds to clear heat sig.
heatIncreasePerSec = 1.0 / 3.0; // takes 3.0 seconds of constant jet to get full heat sig.
// Controls over slope of runnable/jumpable surfaces
runSurfaceAngle = 70;
@ -1728,9 +1750,9 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
splashEmitter[0] = PlayerFoamDropletsEmitter;
splashEmitter[1] = PlayerFoamEmitter;
splashEmitter[2] = PlayerBubbleEmitter;
mediumSplashSoundVelocity = 25.0;
hardSplashSoundVelocity = 35.0;
exitSplashSoundVelocity = 12.0;
mediumSplashSoundVelocity = 10.0;
hardSplashSoundVelocity = 20.0;
exitSplashSoundVelocity = 5.0;
footstepSplashHeight = 0.35;
//Footstep Sounds
@ -2107,7 +2129,7 @@ function Armor::onCollision(%this,%obj,%col)
return;
}
}
if(%col.getDataBlock().noEnemyControl && %obj.team != %col.team)
if(%col.noEnemyControl && %obj.team != %col.team)
return;
commandToClient(%obj.client,'SetDefaultVehicleKeys', true);
@ -2455,7 +2477,17 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
else if(isObject(%sourceObject) && %sourceObject.getClassName() $= "Turret")
%sourceTeam = getTargetSensorGroup(%sourceObject.getTarget());
else
%sourceTeam = %sourceObject ? getTargetSensorGroup(%sourceObject.getTarget()) : -1;
{
if (%sourceObject && %sourceObject.getTarget() >= 0 )
{
%sourceTeam = getTargetSensorGroup(%sourceObject.getTarget());
}
else
{
%sourceTeam = -1;
}
}
// if teamdamage is off, and both parties are on the same team
// (but are not the same person), apply no damage
if(!$teamDamage && (%targetClient != %sourceClient) && (%targetTeam == %sourceTeam))

View file

@ -6,6 +6,8 @@ $DeployThread = 3;
$HumSound = 0;
$ActivateSound = 1;
$DeploySound = 2;
$PlaySound = 3;
//******************************************************************************
//* Power -Audio- Data Blocks *
//******************************************************************************
@ -157,6 +159,8 @@ function GameBase::setSelfPowered(%this)
if(!%this.isPowered())
{
%this.selfPower = true;
if(%this.getDatablock().deployedObject)
%this.initDeploy = true;
%this.getDataBlock().gainPower(%this);
}
else

View file

@ -303,7 +303,6 @@ function ShockLanceImage::onFire(%this, %obj, %slot)
$TypeMasks::ForceFieldObjectType |
$TypeMasks::StaticObjectType |
$TypeMasks::MoveableObjectType |
$TypeMasks::PathedObjectType |
$TypeMasks::DamagableItemObjectType;
// did I miss anything? players, vehicles, stations, gens, sensors, turrets
@ -339,18 +338,17 @@ function ShockLanceImage::onFire(%this, %obj, %slot)
if(%hitObj.getDataBlock().getClassName() $= "PlayerData")
{
// Now we see if we hit from behind...
%eyeVector = %hitobj.getEyeVector();
%forwardVec = %hitobj.getForwardVector();
%objDir2D = getWord(%forwardVec, 0) @ " " @ getWord(%forwardVec,1) @ " " @ "0.0";
%objPos = %hitObj.getPosition();
%dif = VectorSub(%objPos, %muzzlePos);
%dif = getWord(%dif, 0) @ " " @ getWord(%dif, 1) @ " 0";
%dif = VectorNormalize(%dif);
%dot = VectorDot(%dif, %objDir2D);
%eyeXForm = %hitobj.getEyeTransform();
%eyePos = getWord(%eyeXForm, 0) @ " " @ getWord(%eyeXForm, 1) @ " " @ getWord(%eyeXForm, 2);
%dif = VectorSub(%eyePos, %muzzlePos);
%dif = getWord(%dif, 0) @ " " @ getWord(%dif, 1) @ " 0";
%dif = VectorNormalize(%dif);
%eyeVector = getWord(%eyeVector, 0) @ " " @ getWord(%eyeVector, 1) @ " 0";
%dot = VectorDot(%dif, %eyeVector);
// 120 Deg angle test...
if (%dot > mCos(1.05)) {
// 1.05 == 60 degrees in radians
if (%dot >= mCos(1.05)) {
// Rear hit
%damageMultiplier = 3.0;
}
@ -405,15 +403,31 @@ function ELFProjectileData::unzapTarget(%data, %projectile, %target, %targeter)
}
}
function ELFProjectileData::targetDestroyedCancel(%data, %projectile, %target, %targeter)
{
cancel(%projectile.ELFrecur);
%target.stopAudio($ELFZapSound);
%targeter.stopAudio($ELFFireSound);
%target.zapSound = false;
%targeter.zappingSound = false;
%projectile.delete();
}
function ELFProjectile::checkELFStatus(%this, %data, %target, %targeter)
{
if(isObject(%target))
{
if(%target.getDamageState() $= "Destroyed")
{
%data.targetDestroyedCancel(%this, %target, %targeter);
return;
}
%enLevel = %target.getEnergyLevel();
if(%enLevel < 1.0)
{
%dataBlock = %target.getDataBlock();
%dataBlock.damageObject(%target, %this.sourceObject, %target.getPosition(), %data.drainHealth, %data.directDamageType);
%dataBlock.damageObject(%target, %this.sourceObject, %target.getPosition(), %data.drainHealth, %data.directDamageType);
}
else

View file

@ -49,7 +49,6 @@ function CreateServer(%mission, %missionType)
exec("scripts/station.cs");
exec("scripts/simGroup.cs");
exec("scripts/trigger.cs");
exec("scripts/pathedObject.cs");
exec("scripts/forceField.cs");
exec("scripts/lightning.cs");
exec("scripts/weather.cs");
@ -78,7 +77,7 @@ function CreateServer(%mission, %missionType)
$HostGamePlayerCount = 0;
if ( $HostGameType !$= "SinglePlayer" )
allowConnections(true);
new SimGroup (ServerGroup);
$ServerGroup = new SimGroup (ServerGroup);
if(%mission $= "")
{
%mission = $HostMissionFile[$HostMission[0,0]];
@ -117,13 +116,48 @@ function CreateServer(%mission, %missionType)
loadMission(%mission, %missionType, true);
}
function findNextCycleMission()
{
%numPlayers = ClientGroup.getCount();
%tempMission = $CurrentMission;
%failsafe = 0;
while (1)
{
%nextMissionIndex = getNextMission(%tempMission, $CurrentMissionType);
%nextPotentialMission = $HostMissionFile[%nextMissionIndex];
//just cycle to the next if we've gone all the way around...
if (%nextPotentialMission $= $CurrentMission || %failsafe >= 1000)
{
%nextMissionIndex = getNextMission($CurrentMission, $CurrentMissionType);
return $HostMissionName[%nextMissionIndex];
}
//get the player count limits for this mission
%limits = $Host::MapPlayerLimits[%nextPotentialMission, $CurrentMissionType];
if (%limits $= "")
return %nextPotentialMission;
else
{
%minPlayers = getWord(%limits, 0);
%maxPlayers = getWord(%limits, 1);
if ((%minPlayers < 0 || %numPlayers >= %minPlayers) && (%maxPlayers < 0 || %numPlayers <= %maxPlayers))
return %nextPotentialMission;
}
//since we didn't return the mission, we must not have an acceptable number of players - check the next
%tempMission = %nextPotentialMission;
%failsafe++;
}
}
function CycleMissions()
{
echo( "cycling mission. " @ ClientGroup.getCount() @ " clients in game." );
%nextMission = getNextMission($CurrentMission, $CurrentMissionType);
messageAll( 'MsgClient', 'Loading %1 (%2)...', %nextMission, $CurrentMissionType );
loadMission(%nextMission, $CurrentMissionType);
%nextMission = findNextCycleMission();
messageAll( 'MsgClient', 'Loading %1 (%2)...', %nextMission, $MissionTypeDisplayName );
loadMission( %nextMission, $CurrentMissionType );
}
function DestroyServer()
@ -131,8 +165,8 @@ function DestroyServer()
$missionRunning = false;
allowConnections(false);
stopHeartbeat();
if(isObject(ServerGroup))
ServerGroup.delete();
if(isObject($ServerGroup))
$ServerGroup.delete();
// delete all the connections:
while(ClientGroup.getCount())
@ -194,6 +228,8 @@ function DisconnectedCleanup()
MusicPlayer.stop();
clearTextureHolds();
purgeResources();
IRCClient::onLeaveGame();
}
function kick(%client, %admin)
@ -310,7 +346,7 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
// Override the connect name if this server does not allow smurfs:
%realName = getField( %authInfo, 0 );
if ( $Host::NoSmurfs )
if ( $PlayingOnline && $Host::NoSmurfs )
%name = %realName;
if ( strcmp( %name, %realName ) == 0 )
@ -439,7 +475,6 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
// commandToClient(%client, 'getManagerID', %client);
commandToClient(%client, 'setVoiceCodec', $Audio::voiceCodec);
commandToClient(%client, 'setBeaconNames', "Target Beacon", "Marker Beacon", "Bomb Target");
if ( $CurrentMissionType !$= "SinglePlayer" )
@ -571,6 +606,8 @@ function loadMissionStage1(%missionName, %missionType, %firstMission)
MissionCleanup.delete();
Game.deactivatePackages();
Game.delete();
$ServerGroup.delete();
$ServerGroup = new SimGroup(ServerGroup);
}
$CurrentMission = %missionName;
@ -1109,9 +1146,33 @@ function serverCmdClientTeamChange( %client )
}
}
function serverCanAddBot()
{
//find out how many bots are already playing
%botCount = 0;
%numClients = ClientGroup.getCount();
for (%i = 0; %i < %numClients; %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl.isAIcontrolled())
%botCount++;
}
//add only if we have less bots than the bot count, and if there would still be room for a
if ($HostGameBotCount > 0 && %botCount < $Host::botCount && %numClients < $Host::maxPlayers - 1)
return true;
else
return false;
}
function serverCmdAddBot( %client )
{
aiConnectMultiple( 1, $Host::MinBotDifficulty, $Host::MaxBotDifficulty, -1 );
//only admins can add bots...
if (%client.isAdmin)
{
if (serverCanAddBot())
aiConnectMultiple( 1, $Host::MinBotDifficulty, $Host::MaxBotDifficulty, -1 );
}
}
function serverCmdClientJoinTeam( %client, %team )
@ -1257,7 +1318,7 @@ function serverCmdGetTeamList( %client, %key )
function serverCmdGetMissionTypes( %client, %key )
{
for ( %type = 0; %type < $HostTypeCount; %type++ )
messageClient( %client, 'MsgVoteItem', "", %key, %type, "", $HostTypeName[%type], true );
messageClient( %client, 'MsgVoteItem', "", %key, %type, "", $HostTypeDisplayName[%type], true );
}
function serverCmdGetMissionList( %client, %key, %type )
@ -1267,16 +1328,17 @@ function serverCmdGetMissionList( %client, %key, %type )
for ( %i = $HostMissionCount[%type] - 1; %i >= 0; %i-- )
{
%idx = $HostMission[%type, %i];
// If we have bots, don't change to a mission that doesn't support bots:
if ( $HostGameBotCount > 0 )
{
if( !$BotEnabled[$HostMission[%type,%i]] )
if( !$BotEnabled[%idx] )
continue;
}
%idx = $HostMission[%type, %i];
messageClient( %client, 'MsgVoteItem', "", %key,
$HostMissionFile[%idx], // actual filename, will be stored in $clVoteCmd
%idx, // mission index, will be stored in $clVoteCmd
"",
$HostMissionName[%idx],
true );

View file

@ -24,8 +24,7 @@ $holoName[6] = "Harbinger";
$Host::AdminList = ""; // all players that will be automatically an admin upon joining server
$Host::SuperAdminList = ""; // all players that will be automatically a super admin upon joining server
$Host::BindAddress = ""; // set to an ip address if the server wants to specify which NIC/IP to use
$Host::RulesSet = "Base";
$Host::BindAddress = ""; // set to an ip address if the server wants to specify which NIC/IP to use
$Host::Port = 28000;
$Host::GameName = "Tribes 2 Server";
$Host::Password = "";
@ -54,4 +53,64 @@ $Host::MaxMessageLen = 120;
$MasterServerAddress = "IP:198.74.40.152:28000";
$Audio::voiceCodec = ".v12"; // .v12 (1.2 kbits/sec), .v24 (2.4 kbits/sec), .v29 (2.9kbits/sec)
// 0: .v12 (1.2 kbits/sec), 1: .v24 (2.4 kbits/sec), 2: .v29 (2.9kbits/sec)
$Audio::maxEncodingLevel = 2;
$Audio::maxVoiceChannels = 2;
$Host::MapPlayerLimits["Abominable", "CnH"] = "-1 32";
$Host::MapPlayerLimits["AgentsOfFortune", "TeamHunters"] = "-1 32";
$Host::MapPlayerLimits["Archipelago", "CTF"] = "16 -1";
$Host::MapPlayerLimits["AshesToAshes", "CnH"] = "16 -1";
$Host::MapPlayerLimits["BeggarsRun", "CTF"] = "-1 16";
$Host::MapPlayerLimits["CasernCavite", "Hunters"] = "-1 32";
$Host::MapPlayerLimits["CasernCavite", "DM"] = "-1 32";
$Host::MapPlayerLimits["CasernCavite", "Bounty"] = "-1 24";
$Host::MapPlayerLimits["Damnation", "CTF"] = "-1 32";
$Host::MapPlayerLimits["DeathBirdsFly", "CTF"] = "32 -1";
$Host::MapPlayerLimits["Desiccator", "CTF"] = "16 -1";
$Host::MapPlayerLimits["DustToDust", "CTF"] = "-1 24";
$Host::MapPlayerLimits["DustToDust", "Hunters"] = "-1 32";
$Host::MapPlayerLimits["DustToDust", "TeamHunters"] = "-1 32";
$Host::MapPlayerLimits["Equinox", "CnH"] = "-1 32";
$Host::MapPlayerLimits["Equinox", "DM"] = "-1 32";
$Host::MapPlayerLimits["Escalade", "Hunters"] = "16 -1";
$Host::MapPlayerLimits["Escalade", "TeamHunters"] = "16 -1";
$Host::MapPlayerLimits["Escalade", "DM"] = "16 -1";
$Host::MapPlayerLimits["Escalade", "Bounty"] = "16 32";
$Host::MapPlayerLimits["Escalade", "Rabbit"] = "16 -1";
$Host::MapPlayerLimits["Firestorm", "CTF"] = "-1 24";
$Host::MapPlayerLimits["Firestorm", "CnH"] = "-1 24";
$Host::MapPlayerLimits["Flashpoint", "CnH"] = "16 -1";
$Host::MapPlayerLimits["Gehenna", "Hunters"] = "16 -1";
$Host::MapPlayerLimits["Gehenna", "TeamHunters"] = "16 -1";
$Host::MapPlayerLimits["Insalubria", "CnH"] = "-1 32";
$Host::MapPlayerLimits["JacobsLadder", "CnH"] = "-1 32";
$Host::MapPlayerLimits["Katabatic", "CTF"] = "-1 24";
$Host::MapPlayerLimits["Masada", "Siege"] = "-1 16";
$Host::MapPlayerLimits["Minotaur", "CTF"] = "-1 24";
$Host::MapPlayerLimits["Myrkwood", "Hunters"] = "-1 16";
$Host::MapPlayerLimits["Myrkwood", "DM"] = "-1 16";
$Host::MapPlayerLimits["Myrkwood", "Rabbit"] = "-1 24";
$Host::MapPlayerLimits["Oasis", "DM"] = "-1 16";
$Host::MapPlayerLimits["Overreach", "CnH"] = "16 -1";
$Host::MapPlayerLimits["Quagmire", "CTF"] = "16 -1";
$Host::MapPlayerLimits["Rasp", "TeamHunters"] = "-1 32";
$Host::MapPlayerLimits["Rasp", "Bounty"] = "-1 24";
$Host::MapPlayerLimits["Recalescence", "CTF"] = "16 -1";
$Host::MapPlayerLimits["Reversion", "CTF"] = "-1 32";
$Host::MapPlayerLimits["Rimehold", "Hunters"] = "16 -1";
$Host::MapPlayerLimits["Rimehold", "Hunters"] = "16 -1";
$Host::MapPlayerLimits["Riverdance", "CTF"] = "8 32";
$Host::MapPlayerLimits["Sanctuary", "CTF"] = "-1 32";
$Host::MapPlayerLimits["Sirocco", "CnH"] = "16 -1";
$Host::MapPlayerLimits["Slapdash", "CTF"] = "16 -1";
$Host::MapPlayerLimits["SunDried", "DM"] = "16 -1";
$Host::MapPlayerLimits["SunDried", "Bounty"] = "16 -1";
$Host::MapPlayerLimits["Talus", "Bounty"] = "-1 24";
$Host::MapPlayerLimits["ThinIce", "CTF"] = "-1 32";
$Host::MapPlayerLimits["Tombstone", "CTF"] = "8 32";
$Host::MapPlayerLimits["UltimaThule", "CTF"] = "-1 -1";
$Host::MapPlayerLimits["Underhill", "DM"] = "16 -1";
$Host::MapPlayerLimits["Underhill", "Bounty"] = "-1 24";
$Host::MapPlayerLimits["Whiteout", "DM"] = "16 -1";
$Host::MapPlayerLimits["Whiteout", "Bounty"] = "16 -1";

View file

@ -11,7 +11,18 @@ function StaticShapeData::onGainPowerEnabled(%data, %obj)
%obj.schedule(750, "playThread", $PowerThread, "Power");
else
%obj.playThread($PowerThread,"Power");
%obj.setRechargeRate(%data.rechargeRate);
// deployable objects get their recharge rate set right away -- don't set it again unless
// the object has just been re-enabled
if(%obj.initDeploy)
%obj.initDeploy = false;
else
{
if(%obj.getRechargeRate() <= 0)
{
%oldERate = %obj.getRechargeRate();
%obj.setRechargeRate(%oldERate + %data.rechargeRate);
}
}
if(%data.humSound !$= "")
%obj.playAudio($HumSound, %data.humSound);
%obj.setPoweredState(true);

View file

@ -332,7 +332,7 @@ function StationInventory::getSound(%data, %forward)
function StationInventory::setPlayersPosition(%data, %obj, %trigger, %colObj)
{
%vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0";
if((VectorLen(%vel) < 17) && (%obj.triggeredBy != %colObj))
if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj))
{
%pos = %trigger.position;
%colObj.setvelocity("0 0 0");
@ -428,7 +428,7 @@ function StationVehicle::getSound(%data, %forward)
function StationVehicle::setPlayersPosition(%data, %obj, %trigger, %colObj)
{
%vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0";
if((VectorLen(%vel) < 17) && (%obj.triggeredBy != %colObj))
if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj))
{
%posXY = getWords(%trigger.getTransform(),0 ,1);
%posZ = getWord(%trigger.getTransform(), 2);
@ -473,30 +473,21 @@ function StationVehiclePad::onAdd(%this, %obj)
%sv.trigger.disableObj = %sv;
//Remove unwanted vehicles
if(%obj.scoutVehicle $= "Removed")
{ }
else
%sv.vehicle[scoutvehicle] = true;
if(%obj.assaultVehicle $= "Removed")
{ }
else
%sv.vehicle[assaultVehicle] = true;
if(%obj.mobileBaseVehicle $= "Removed")
{ }
else
%sv.vehicle[mobileBasevehicle] = true;
if(%obj.scoutFlyer $= "Removed")
{ }
else
%sv.vehicle[scoutFlyer] = true;
if(%obj.bomberFlyer $= "Removed")
{ }
else
%sv.vehicle[bomberFlyer] = true;
if(%obj.hapcFlyer $= "Removed")
{ }
else
%sv.vehicle[hapcFlyer] = true;
if(%obj.scoutVehicle !$= "Removed")
%sv.vehicle[scoutvehicle] = true;
if(%obj.assaultVehicle !$= "Removed")
%sv.vehicle[assaultVehicle] = true;
if(%obj.mobileBaseVehicle !$= "Removed")
{
%sv.vehicle[mobileBasevehicle] = true;
// createTeleporter(%sv.getDataBlock(), %sv);
}
if(%obj.scoutFlyer !$= "Removed")
%sv.vehicle[scoutFlyer] = true;
if(%obj.bomberFlyer !$= "Removed")
%sv.vehicle[bomberFlyer] = true;
if(%obj.hapcFlyer !$= "Removed")
%sv.vehicle[hapcFlyer] = true;
}
function StationVehiclePad::onEndSequence(%data, %obj, %thread)
@ -606,7 +597,7 @@ function MobileInvStation::getSound(%data, %forward)
function MobileInvStation::setPlayersPosition(%data, %obj, %trigger, %colObj)
{
%vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0";
if((VectorLen(%vel) < 17) && (%obj.triggeredBy != %colObj))
if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj))
{
%pos = %trigger.position;
%colObj.setvelocity("0 0 0");
@ -708,8 +699,10 @@ function stationTrigger::onLeaveTrigger(%data, %obj, %colObj)
%obj.station.getDataBlock().endRepairing(%obj.station);
%obj.station.triggeredBy = "";
%obj.station.getDataBlock().stationTriggered(%obj.station, 0);
%colObj.station = "";
if(%colObj.getMountedImage($WeaponSlot) == 0)
if(!%colObj.teleporting)
%colObj.station = "";
if(%colObj.getMountedImage($WeaponSlot) == 0 && !%colObj.teleporting)
{
if(%colObj.inv[%colObj.lastWeapon])
%colObj.use(%colObj.lastWeapon);
@ -732,30 +725,35 @@ function stationTrigger::onLeaveTrigger(%data, %obj, %colObj)
////////////////////////////////////////////////////////////////////////////////
function Station::stationTriggered(%data, %obj, %isTriggered)
{
if(%isTriggered)
{
%obj.setThreadDir($ActivateThread, TRUE);
%obj.playThread($ActivateThread,"activate");
%obj.playAudio($ActivateSound, %data.getSound(true));
%obj.inUse = "Up";
}
else
{
if(%obj.getDataBlock().getName() !$= StationVehicle)
if(%data.teleporter $= "")
{
if(%isTriggered)
{
%obj.stopThread($ActivateThread);
if(%obj.getObjectMount())
%obj.getObjectMount().stopThread($ActivateThread);
%obj.inUse = "Down";
%obj.setThreadDir($ActivateThread, TRUE);
%obj.playThread($ActivateThread,"activate");
%obj.playAudio($ActivateSound, %data.getSound(true));
%obj.inUse = "Up";
}
else
{
%obj.setThreadDir($ActivateThread, FALSE);
%obj.playThread($ActivateThread,"activate");
%obj.playAudio($ActivateSound, %data.getSound(false));
%obj.inUse = "Down";
}
if(%obj.getDataBlock().getName() !$= StationVehicle)
{
%obj.stopThread($ActivateThread);
if(%obj.getObjectMount())
%obj.getObjectMount().stopThread($ActivateThread);
%obj.inUse = "Down";
}
else
{
%obj.setThreadDir($ActivateThread, FALSE);
%obj.playThread($ActivateThread,"activate");
%obj.playAudio($ActivateSound, %data.getSound(false));
%obj.inUse = "Down";
}
}
}
else
%data.tryTeleport(%obj);
}
////-Station-///////////////////////////////////////////////////////////////////
@ -899,7 +897,7 @@ function DeployedStationInventory::stationFinished(%data, %obj)
function DeployedStationInventory::setPlayersPosition(%data, %obj, %trigger, %colObj)
{
%vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0";
if((VectorLen(%vel) < 17) && (%obj.triggeredBy != %colObj))
if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj))
{
// build offset for player position
%yrot = getWords(VectorOrthoBasis( getWords( %obj.getTransform(), 3, 6 ) ) ,3 ,5);
@ -943,3 +941,333 @@ function DeployedStationInventory::getSound(%data, %forward)
else
return false;
}
////////////////////////////////////////////////////////////////////////////////
/// -Mobile Base Teleporter DATA- //////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
datablock AudioProfile(StationTeleportAcitvateSound)
{
filename = "fx/powered/vehicle_screen_on2.wav";
description = AudioClosest3d;
preload = true;
effect = StationVehicleAcitvateEffect;
};
datablock AudioProfile(StationTeleportHumSound)
{
filename = "fx/powered/station_hum.wav";
description = CloseLooping3d;
preload = true;
};
datablock AudioProfile(StationTeleportDeactivateSound)
{
filename = "fx/powered/vehicle_screen_off.wav";
description = AudioClose3d;
preload = true;
effect = StationVehicleDeactivateEffect;
};
datablock AudioProfile(TeleportSound)
{
filename = "fx/powered/vehicle_screen_on2.wav";
description = AudioClosest3d;
preload = true;
effect = StationVehicleAcitvateEffect;
};
datablock AudioProfile(UnTeleportSound)
{
filename = "fx/powered/vehicle_screen_off.wav";
description = AudioClose3d;
preload = true;
effect = StationVehicleDeactivateEffect;
};
datablock StaticShapeData(MPBTeleporter) : StaticShapeDamageProfile
{
className = Station;
catagory = "Stations";
shapeFile = "station_teleport.dts";
maxDamage = 1.20;
destroyedLevel = 1.20;
disabledLevel = 0.84;
explosion = ShapeExplosion;
expDmgRadius = 10.0;
expDamage = 0.4;
expImpulse = 1500.0;
dynamicType = $TypeMasks::StationObjectType;
isShielded = true;
energyPerDamagePoint = 33;
maxEnergy = 250;
rechargeRate = 0.31;
humSound = StationTeleportHumSound;
// don't let these be damaged in Siege missions
noDamageInSiege = true;
cmdCategory = "Support";
cmdIcon = CMDVehicleStationIcon;
cmdMiniIconName = "commander/MiniIcons/com_vehicle_pad_inventory";
targetTypeTag = 'Teleport Station';
teleporter = 1;
};
////////////////////////////////////////////////////////////////////////////////
/// -Mobile Base Teleport- /////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// -Mobile Base- //////////////////////////////////////////////////////////////
//Function -- onAdd (%this, %obj)
// %this = Object data block
// %obj = Object being added
//Decription -- Called when the object is added to the mission
////////////////////////////////////////////////////////////////////////////////
function MPBTeleporter::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
}
function MPBTeleporter::createTrigger(%this, %obj)
{
// createTarget(%obj, 'Inventory Station', "", "", 'Station', 0, 0);
%obj.setRechargeRate(%obj.getDatablock().rechargeRate);
%trigger = new Trigger()
{
dataBlock = stationTrigger;
polyhedron = "-0.75 0.75 0.1 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.3";
};
MissionCleanup.add(%trigger);
%trigger.setTransform(%obj.getTransform());
%trigger.station = %obj;
%trigger.mainObj = %obj.vStation;
%trigger.disableObj = %obj;
%obj.trigger = %trigger;
}
/// -Mobile Base- //////////////////////////////////////////////////////////////
//Function -- stationReady(%data, %obj)
// %data = Station Data Block
// %obj = Station Object
//Decription -- Called when station has been triggered and animation is
// completed
////////////////////////////////////////////////////////////////////////////////
function MPBTeleporter::stationReady(%data, %obj)
{
//Display the Inventory Station GUI here
%obj.notReady = 1;
%obj.inUse = "Down";
%obj.schedule(200,"playThread",$ActivateThread,"activate1");
%obj.getObjectMount().playThread($ActivateThread,"Activate");
%player = %obj.triggeredBy;
%energy = %player.getEnergyLevel();
%player.setCloaked(true);
%player.schedule(900, "setCloaked", false);
if (!%player.client.isAIControlled())
buyFavorites(%player.client);
%player.setEnergyLevel(%energy);
}
/// -Mobile Base- //////////////////////////////////////////////////////////////
//Function -- stationFinished(%data, %obj)
// %data = Station Data Block
// %obj = Station Object
//Decription -- Called when player has left the station
////////////////////////////////////////////////////////////////////////////////
function MPBTeleporter::stationFinished(%data, %obj)
{
//Hide the Inventory Station GUI
}
/// -Mobile Base- //////////////////////////////////////////////////////////////
//Function -- getSound(%data, %forward)
// %data = Station Data Block
// %forward = direction the animation is playing
//Decription -- This sound will be played at the same time as the activate
// animation.
////////////////////////////////////////////////////////////////////////////////
function MPBTeleporter::getSound(%data, %forward)
{
if(%forward)
return "MobileBaseInventoryActivateSound";
else
return false;
}
/// -Mobile Base- //////////////////////////////////////////////////////////////
//Function -- setPlayerPosition(%data, %obj, %trigger, %colObj)
// %data = Station Data Block
// %obj = Station Object
// %trigger = Stations trigger
// %colObj = Object that is at the station
//Decription -- Called when player enters the trigger. Used to set the player
// in the center of the station.
////////////////////////////////////////////////////////////////////////////////
function MPBTeleporter::setPlayersPosition(%data, %obj, %trigger, %colObj)
{
%vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0";
if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj))
{
%pos = %trigger.position;
%colObj.setvelocity("0 0 0");
%rot = getWords(%colObj.getTransform(),3, 6);
%colObj.setTransform(getWord(%pos,0) @ " " @ getWord(%pos,1) @ " " @ getWord(%pos,2)+0.8 @ " " @ %rot);//center player on object
%colObj.setvelocity("0 0 0");
return true;
}
return false;
}
function MPBTeleporter::tryTeleport(%data, %obj)
{
if(isObject(%obj.MPB) && %obj.MPB.fullyDeployed && %obj.triggeredBy !$= "")
{
%trans = %obj.MPB.getTransform();
%vX = getWord(%trans, 0);
%vY = getWord(%trans, 1);
%vZ = getWord(%trans, 2);
%rot= getWords(%trans, 3,6);
%obj.triggeredBy.teleporting = 1;
%obj.triggeredBy.startFade( 1000, 0, true );
%obj.triggeredBy.playAudio($PlaySound, TeleportSound);
%obj.triggeredBy.setMoveState(true);
%data.schedule(4500,"teleportingDone", %obj.triggeredBy);
%data.schedule(2000, "teleportout", %obj, %obj.triggeredBy, %vX @ " " @ %vY @ " " @ %vZ + 3 @ " " @ %rot);
}
else if(%obj.triggeredBy !$= "")
MessageClient(%obj.triggeredBy.client, "", 'MPB is not deployed.');
}
function MPBTeleporter::onEndSequence(%data, %obj, %thread)
{
}
function MPBTeleporter::teleportOut(%data, %obj, %player, %trans)
{
if(isObject(%obj.MPB))
{
%index = -1;
for(%x=0; %x < %obj.MPB.spawnPosCount; %x++)
{
%index = mFloor(getRandom() * %obj.MPB.spawnPosCount);
InitContainerRadiusSearch(%MPB.spawnPos[%index], 2, $TypeMasks::MoveableObjectType);
if(ContainerSearchNext() == 0)
break;
else
%index = -1;
}
if(%index >= 0)
%player.setTransform(%obj.MPB.spawnPos[%index] @ " " @ getWords(%obj.MPB.getTransform(), 3, 6));
else
{
messageClient(%player.client, "", 'No Valid teleporting positions.');
%player.teleporting = 0;
}
}
else
{
messageClient(%player.client, "", 'No Valid teleporting positions because MPB was destroyed');
%player.teleporting = 0;
}
%data.schedule(1000, "teleportIn", %player);
}
function MPBTeleporter::teleportIn(%data, %player, %trans)
{
%player.startFade(1000, 0, false );
%player.playAudio($PlaySound, UnTeleportSound);
}
function MPBTeleporter::teleportingDone(%data, %player)
{
%player.setMoveState(false);
%player.teleporting = 0;
%player.station = "";
if(%player.getMountedImage($WeaponSlot) == 0)
{
if(%player.inv[%player.lastWeapon])
%player.use(%player.lastWeapon);
if(%player.getMountedImage($WeaponSlot) == 0)
%player.selectWeaponSlot( 0 );
}
}
for(%y = -1; %y < 1; %y += 0.25)
{
%xCount=0;
for(%x = -1; %x < 1; %x += 0.25)
{
$MPBSpawnPos[(%yCount * 8) + %xCount] = %x @ " " @ %y;
%xCount++;
}
%yCount++;
}
function checkSpawnPos(%MPB, %radius)
{
%count = -1;
for(%x = 0; %x < 64; %x++)
{
%pPos = getWords(%MPB.getTransform(), 0, 2);
%pPosX = getWord(%pPos, 0);
%pPosY = getWord(%pPos, 1);
%pPosZ = getWord(%pPos, 2);
%posX = %pPosX + ( getWord($MPBSpawnPos[%x],0) * %radius);
%posY = %pPosY + (getWord($MPBSpawnPos[%x],1) * %radius);
%terrHeight = getTerrainHeight(%posX @ " " @ %posY);
if(abs(%terrHeight - %pPosZ) < %radius )
{
%mask = $TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType |
$TypeMasks::StaticShapeObjectType | $TypeMasks::StaticTSObjectType |
$TypeMasks::ForceFieldObjectType | $TypeMasks::ItemObjectType |
$TypeMasks::PlayerObjectType | $TypeMasks::TurretObjectType |
$TypeMasks::InteriorObjectType;
InitContainerRadiusSearch(%posX @ " " @ %posY @ " " @ %terrHeight, 2, %mask);
if(ContainerSearchNext() == 0)
%MPB.spawnPos[%count++] = %posX @ " " @ %posY @ " " @ %terrHeight;
}
}
%MPB.spawnPosCount = %count;
}
function createTeleporter(%data, %obj)
{
%Teleporter = new StaticShape() {
scale = "1 1 1";
dataBlock = "MPBTeleporter";
lockCount = "0";
homingCount = "0";
team = %obj.team;
};
%obj.teleporter = %Teleporter;
%Teleporter.vStation = %obj.pad;
MissionCleanup.add(%Teleporter);
%trans = %obj.getTransform();
%vSPos = getWords(%trans,0,2);
%vRot = getWords(%trans,3,5);
%vAngle = getWord(%trans,6);
%matrix = VectorOrthoBasis(%vRot @ " " @ %vAngle + 0.36);
%yRot = getWords(%matrix, 3, 5);
%pos = vectorAdd(%vSPos, vectorScale(%yRot, -31.5));
%Teleporter.setTransform(%pos @ " " @ %vRot @ " " @ %vAngle);
%Teleporter.getDataBlock().createTrigger(%Teleporter);
}

View file

@ -164,7 +164,7 @@ datablock TurretImageData(AABarrelLarge)
seekRadius = 200;
maxSeekAngle = 6;
seekTime = 1.0;
minSeekHeat = 0.5;
minSeekHeat = 0.7;
useTargetAudio = false;
// Turret parameters

View file

@ -65,6 +65,8 @@ datablock TurretData(TurretDeployedFloorIndoor) : TurretDamageProfile
heatSignature = 0.0;
explosion = SmallTurretExplosion;
deployedObject = true;
thetaMin = 5;
thetaMax = 145;
thetaNull = 90;

View file

@ -60,15 +60,15 @@ datablock SeekerProjectileData(TurretMissile)
puffEmitter = MissilePuffEmitter;
lifetimeMS = 20000;
muzzleVelocity = 65.0;
turningSpeed = 40.0;
muzzleVelocity = 80.0;
turningSpeed = 90.0;
proximityRadius = 4;
terrainAvoidanceSpeed = 140;
terrainScanAhead = 30;
terrainHeightFail = 18;
terrainAvoidanceRadius = 60;
terrainAvoidanceSpeed = 180;
terrainScanAhead = 25;
terrainHeightFail = 12;
terrainAvoidanceRadius = 100;
useFlechette = true;
flechetteDelayMs = 550;
@ -93,14 +93,14 @@ datablock TurretImageData(MissileBarrelLarge)
isSeeker = true;
seekRadius = 300;
maxSeekAngle = 30;
seekTime = 1.5;
seekTime = 1.0;
minSeekHeat = 0.7;
emap = true;
minTargetingDistance = 40;
// Turret parameters
activationMS = 3000;
deactivateDelayMS = 2500;
activationMS = 500;
deactivateDelayMS = 1000;
thinkTimeMS = 200;
degPerSecTheta = 580;
degPerSecPhi = 1080;

View file

@ -112,7 +112,7 @@ datablock TurretData(TurretDeployedOutdoor) : TurretDamageProfile
className = DeployedTurret;
shapeFile = "turret_outdoor_deploy.dts";
rechargeRate = 0.05;
rechargeRate = 0.15;
mass = 5.0;
maxDamage = 0.80;
@ -120,6 +120,8 @@ datablock TurretData(TurretDeployedOutdoor) : TurretDamageProfile
disabledLevel = 0.35;
repairRate = 0;
explosion = HandGrenadeExplosion;
deployedObject = true;
thetaMin = 0;
thetaMax = 145;
@ -130,7 +132,6 @@ datablock TurretData(TurretDeployedOutdoor) : TurretDamageProfile
maxEnergy = 60;
renderWhenDestroyed = false;
barrel = DeployableOutdoorBarrel;
rechargeRate = 0.25;
heatSignature = 0;
canControl = true;

View file

@ -121,6 +121,12 @@ function createVehicle(%client, %station, %blockName, %team , %pos, %rot, %angle
%obj = %blockName.create(%team);
if(%obj)
{
if ( %blockName $= "MobileBaseVehicle" )
{
%station.station.teleporter.MPB = %obj;
%obj.teleporter = %station.station.teleporter;
}
%station.ready = false;
%obj.team = %team;
%obj.useCreateHeight(true);

View file

@ -200,6 +200,7 @@ function VehicleData::onLeaveLiquid(%data, %obj, %type)
function VehicleData::onDestroyed(%data, %obj, %prevState)
{
radiusVehicleExplosion(%data, %obj);
if(%obj.turretObject)
if(%obj.turretObject.getControllingClient())
%obj.turretObject.getDataBlock().playerDismount(%obj.turretObject);
@ -219,6 +220,79 @@ function VehicleData::onDestroyed(%data, %obj, %prevState)
%obj.schedule(300, "delete");
}
function radiusVehicleExplosion(%data, %vehicle)
{
// this is a modified version of RadiusExplosion() from projectiles.cs
%position = %vehicle.getPosition();
InitContainerRadiusSearch(%position, %data.explosionRadius, $TypeMasks::PlayerObjectType |
$TypeMasks::VehicleObjectType |
$TypeMasks::MoveableObjectType |
$TypeMasks::StaticShapeObjectType |
$TypeMasks::ForceFieldObjectType |
$TypeMasks::TurretObjectType |
$TypeMasks::ItemObjectType);
%numTargets = 0;
while ((%targetObject = containerSearchNext()) != 0)
{
if(%targetObject == %vehicle)
continue;
%dist = containerSearchCurrRadDamageDist();
if (%dist > %data.explosionRadius)
continue;
if (%targetObject.isMounted())
{
%mount = %targetObject.getObjectMount();
if(%mount == %vehicle)
continue;
%found = -1;
for (%i = 0; %i < %mount.getDataBlock().numMountPoints; %i++)
{
if (%mount.getMountNodeObject(%i) == %targetObject)
{
%found = %i;
break;
}
}
if (%found != -1)
{
if (%mount.getDataBlock().isProtectedMountPoint[%found] && (%mount != %vehicle))
continue;
}
}
%targets[%numTargets] = %targetObject;
%targetDists[%numTargets] = %dist;
%numTargets++;
}
for (%i = 0; %i < %numTargets; %i++)
{
%targetObject = %targets[%i];
%dist = %targetDists[%i];
%coverage = calcExplosionCoverage(%position, %targetObject,
($TypeMasks::InteriorObjectType |
$TypeMasks::TerrainObjectType |
$TypeMasks::ForceFieldObjectType));
if (%coverage == 0)
continue;
%amount = (1.0 - (%dist / %data.explosionRadius)) * %coverage * %data.explosionDamage;
%targetData = %targetObject.getDataBlock();
%momVec = "0 0 1";
if(%amount > 0)
%targetData.damageObject(%targetObject, %sourceObject, %position, %amount, $DamageType::Explosion, %momVec);
}
}
function VehicleData::deleteAllMounted()
{
@ -396,6 +470,10 @@ function MobileBaseVehicle::deleteAllMounted(%data, %obj)
}
if(isObject(%obj.shield))
%obj.shield.delete();
%obj.teleporter.setThreadDir($ActivateThread, FALSE);
%obj.teleporter.playThread($ActivateThread,"activate");
%obj.teleporter.playAudio($ActivateSound, StationTeleportDeacitvateSound);
}
//**************************************************************
@ -576,6 +654,13 @@ function MobileBaseVehicle::playerMounted(%data, %obj, %player, %node)
%obj.shield.open();
%obj.shield.schedule(1000,"delete");
%obj.deploySchedule = "";
%obj.teleporter.setThreadDir($ActivateThread, FALSE);
%obj.teleporter.playThread($ActivateThread,"activate");
%obj.teleporter.playAudio($ActivateSound, StationTeleportDeacitvateSound);
%obj.fullyDeployed = 0;
%obj.noEnemyControl = 0;
}
%obj.deployed = 0;
}
@ -634,7 +719,7 @@ function MobileBaseVehicle::vehicleDeploy(%data, %obj, %player)
%obj.station.setSelfPowered();
%obj.station.playThread($PowerThread,"Power");
%obj.station.playAudio($HumSound,StationHumSound);
%obj.station.vehicle = %obj;
%obj.turret = new turret() {
scale = "1 1 1";
dataBlock = "MobileTurretBase";
@ -642,10 +727,13 @@ function MobileBaseVehicle::vehicleDeploy(%data, %obj, %player)
homingCount = "0";
team = %obj.team;
};
%obj.turret.setDamageLevel(%obj.getDamageLevel());
%obj.mountObject(%obj.turret, 1);
%obj.turret.setSelfPowered();
%obj.turret.playThread($PowerThread,"Power");
%obj.turret.mountImage(MissileBarrelLarge, 0 ,false);
checkSpawnPos(%obj, 20);
}
}
else
@ -725,6 +813,8 @@ function MobileBaseVehicle::onEndSequence(%data, %obj, %thread)
%obj.station.goingOut = true;
%obj.shield.setTransform(%obj.getSlotTransform(3));
%obj.shield.close();
%obj.isDeployed = true;
%obj.noEnemyControl = 1;
}
Parent::onEndSequence(%data, %obj, %thread);
@ -735,7 +825,13 @@ function MobileInvStation::onEndSequence(%data, %obj, %thread)
if(!%obj.goingOut)
%obj.startFade(0,0,true);
else
{
%obj.notDeployed = 0;
%obj.vehicle.fullyDeployed = 1;
%obj.vehicle.teleporter.setThreadDir($ActivateThread, TRUE);
%obj.vehicle.teleporter.playThread($ActivateThread,"activate");
%obj.vehicle.teleporter.playAudio($ActivateSound, StationTeleportAcitvateSound);
}
Parent::onEndSequence(%data, %obj, %thread);
}
@ -800,10 +896,21 @@ function MobileBaseVehicle::checkDeploy(%data, %obj)
function MobileBaseVehicle::checkTurretDistance(%data, %obj)
{
%pos = getWords(%obj.getTransform(), 0, 2);
InitContainerRadiusSearch(%pos, 150, $TypeMasks::TurretObjectType);
InitContainerRadiusSearch(%pos, 100, $TypeMasks::TurretObjectType | $TypeMasks::InteriorObjectType);
while ((%objFound = ContainerSearchNext()) != 0)
if(%objFound.getDataBlock().ClassName $= "TurretBase")
return "Turret Base in area. Unable to deploy.";
{
if(%objFound.getType() & $TypeMasks::TurretObjectType)
{
if(%objFound.getDataBlock().ClassName $= "TurretBase")
return "Turret Base is in the area. Unable to deploy.";
}
else
{
%subStr = getSubStr(%objFound.interiorFile, 1, 4);
if(%subStr !$= "rock" && %subStr !$= "spir" && %subStr !$= "misc")
return "Building is in the area. Unable to deploy.";
}
}
return "";
}
@ -979,7 +1086,7 @@ function VehicleData::damageObject(%data, %targetObject, %sourceObject, %positio
function VehicleData::onImpact(%data, %vehicleObject, %collidedObject, %vec, %vecLen)
{
if(%vecLen > %data.minImpactSpeed)
%data.damageObject(%vehicleObject, 0, VectorAdd(%vec, %vehicleObject.getPosition),
%data.damageObject(%vehicleObject, 0, VectorAdd(%vec, %vehicleObject.getPosition()),
%vecLen * %data.speedDamageScale, $DamageType::Ground);
// associated "crash" sounds

View file

@ -101,7 +101,7 @@ datablock AudioProfile(BomberBombIdleSound)
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock FlyingVehicleData(BomberFlyer) : AirVehicleDamageProfile
datablock FlyingVehicleData(BomberFlyer) : BomberDamageProfile
{
spawnOffset = "0 0 2";
@ -129,6 +129,8 @@ datablock FlyingVehicleData(BomberFlyer) : AirVehicleDamageProfile
cameraOffset = 5;
cameraLag = 1.0;
explosion = LargeAirVehicleExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;
maxDamage = 2.80; // Total health
destroyedLevel = 2.80; // Damage textures show up at this health level
@ -140,12 +142,6 @@ datablock FlyingVehicleData(BomberFlyer) : AirVehicleDamageProfile
rotationalDrag = 1800; // Angular Drag (dampens the drift after you stop moving the mouse...also tumble drag)
rechargeRate = 0.8;
// Turbo Jet
jetForce = 5000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 40.0; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 2.0; // Energy use of the afterburners (low number is less drain...can be fractional)
vertThrustMultiple = 2.0;
// Auto stabilize speed
maxAutoSpeed = 15; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 1500; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
@ -163,6 +159,12 @@ datablock FlyingVehicleData(BomberFlyer) : AirVehicleDamageProfile
hoverHeight = 5; // Height off the ground at rest
createHoverHeight = 3; // Height off the ground when created
// Turbo Jet
jetForce = 3000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 40.0; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 3.0; // Energy use of the afterburners (low number is less drain...can be fractional)
vertThrustMultiple = 2.0;
dustEmitter = LargeVehicleLiftoffDustEmitter;
triggerDustHeight = 4.0;
dustHeight = 2.0;
@ -181,13 +183,16 @@ datablock FlyingVehicleData(BomberFlyer) : AirVehicleDamageProfile
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 0; // Don't mess with this.
minImpactSpeed = 8; // If hit ground at speed above this then it's an impact. Meters/second
softImpactSpeed = 10; // Sound hooks. This is the soft hit.
softImpactSpeed = 20; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // Sound hooks. This is the hard hit.
speedDamageScale = 0.035;
collDamageThresholdVel = 20.0;
collDamageMultiplier = 0.025;
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 20; // If hit ground at speed above this then it's an impact. Meters/second
speedDamageScale = 0.150;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 25;
collDamageMultiplier = 0.030;
//
minTrailSpeed = 15; // The speed your contrail shows up at.
@ -204,9 +209,9 @@ datablock FlyingVehicleData(BomberFlyer) : AirVehicleDamageProfile
//
softSplashSoundVelocity = 15.0;
mediumSplashSoundVelocity = 30.0;
hardSplashSoundVelocity = 60.0;
exitSplashSoundVelocity = 20.0;
mediumSplashSoundVelocity = 20.0;
hardSplashSoundVelocity = 30.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterHardSound;
impactWaterEasy = VehicleImpactWaterSoftSound;

View file

@ -21,7 +21,7 @@ datablock AudioProfile(HAPCFlyerThrustSound)
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock FlyingVehicleData(HAPCFlyer) : AirVehicleDamageProfile
datablock FlyingVehicleData(HAPCFlyer) : HavocDamageProfile
{
spawnOffset = "0 0 6";
@ -51,6 +51,8 @@ datablock FlyingVehicleData(HAPCFlyer) : AirVehicleDamageProfile
cameraOffset = 2;
cameraLag = 8.5;
explosion = LargeAirVehicleExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;
maxDamage = 3.50;
destroyedLevel = 3.50;
@ -82,7 +84,7 @@ datablock FlyingVehicleData(HAPCFlyer) : AirVehicleDamageProfile
// Turbo Jet
jetForce = 5000;
minJetEnergy = 55;
jetEnergyDrain = 2.8;
jetEnergyDrain = 3.6;
vertThrustMultiple = 2.0;
@ -104,13 +106,16 @@ datablock FlyingVehicleData(HAPCFlyer) : AirVehicleDamageProfile
bodyFriction = 0;
bodyRestitution = 0.3;
minRollSpeed = 0;
minImpactSpeed = 8; // If hit ground at speed above this then it's an impact. Meters/second
softImpactSpeed = 10; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // Sound hooks. This is the hard hit.
speedDamageScale = 0.03;
softImpactSpeed = 12; // Sound hooks. This is the soft hit.
hardImpactSpeed = 15; // Sound hooks. This is the hard hit.
collDamageThresholdVel = 20.0;
collDamageMultiplier = 0.03;
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 12; // If hit ground at speed above this then it's an impact. Meters/second
speedDamageScale = 0.060;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 12;
collDamageMultiplier = 0.080;
//
minTrailSpeed = 15;
@ -126,10 +131,10 @@ datablock FlyingVehicleData(HAPCFlyer) : AirVehicleDamageProfile
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 15.0;
mediumSplashSoundVelocity = 30.0;
hardSplashSoundVelocity = 60.0;
exitSplashSoundVelocity = 20.0;
softSplashSoundVelocity = 5.0;
mediumSplashSoundVelocity = 8.0;
hardSplashSoundVelocity = 12.0;
exitSplashSoundVelocity = 8.0;
exitingWater = VehicleExitWaterHardSound;
impactWaterEasy = VehicleImpactWaterSoftSound;

View file

@ -72,7 +72,7 @@ datablock SensorData(MPBDeployedSensor) : VehiclePulseSensor
jamRadius = 50;
};
datablock WheeledVehicleData(MobileBaseVehicle) : GroundVehicleDamageProfile
datablock WheeledVehicleData(MobileBaseVehicle) : MPBDamageProfile
{
spawnOffset = "0 0 1.0";
@ -98,9 +98,9 @@ datablock WheeledVehicleData(MobileBaseVehicle) : GroundVehicleDamageProfile
cameraOffset = 6;
cameraLag = 1.5;
explosion = LargeGroundVehicleExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;
noEnemyControl = 1;
maxSteeringAngle = 0.3; // 20 deg.
// Used to test if the station can deploy
@ -111,9 +111,6 @@ datablock WheeledVehicleData(MobileBaseVehicle) : GroundVehicleDamageProfile
stationPoints[5] = "2.3 -7.38703 -0.65";
stationPoints[6] = "2.3 -11.8 -0.65";
collDamageThresholdVel = 10.0;
collDamageMultiplier = 0.025;
// Rigid Body
mass = 2000;
bodyFriction = 0.8;
@ -123,10 +120,16 @@ datablock WheeledVehicleData(MobileBaseVehicle) : GroundVehicleDamageProfile
gyroDamping = 0.3;
stabilizerForce = 10;
minDrag = 10;
minImpactSpeed = 5;
softImpactSpeed = 13; // Play SoftImpact Sound
hardImpactSpeed = 20; // Play HardImpact Sound
speedDamageScale = 0.06;
softImpactSpeed = 20; // Play SoftImpact Sound
hardImpactSpeed = 25; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 25;
speedDamageScale = 0.220;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 28;
collDamageMultiplier = 0.040;
// Engine
engineTorque = 4.5 * 745;
@ -171,10 +174,10 @@ datablock WheeledVehicleData(MobileBaseVehicle) : GroundVehicleDamageProfile
wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 15.0;
mediumSplashSoundVelocity = 30.0;
hardSplashSoundVelocity = 60.0;
exitSplashSoundVelocity = 20.0;
softSplashSoundVelocity = 5.0;
mediumSplashSoundVelocity = 8.0;
hardSplashSoundVelocity = 12.0;
exitSplashSoundVelocity = 8.0;
exitingWater = VehicleExitWaterSoftSound;
impactWaterEasy = VehicleImpactWaterSoftSound;

View file

@ -44,7 +44,7 @@ datablock AudioProfile(ShrikeBlasterDryFireSound)
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock FlyingVehicleData(ScoutFlyer) : AirVehicleDamageProfile
datablock FlyingVehicleData(ScoutFlyer) : ShrikeDamageProfile
{
spawnOffset = "0 0 2";
@ -66,6 +66,8 @@ datablock FlyingVehicleData(ScoutFlyer) : AirVehicleDamageProfile
cameraOffset = 2.5;
cameraLag = 0.9;
explosion = VehicleExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;
maxDamage = 1.40;
destroyedLevel = 1.40;
@ -77,12 +79,6 @@ datablock FlyingVehicleData(ScoutFlyer) : AirVehicleDamageProfile
rotationalDrag = 900; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
rechargeRate = 0.8;
// Turbo Jet
jetForce = 2000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 28; // Afterburner can't be used if below this threshhold.
vertThrustMultiple = 2.0;
jetEnergyDrain = 2.8; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
maxAutoSpeed = 15; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 400; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
autoLinearForce = 300; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
@ -99,17 +95,26 @@ datablock FlyingVehicleData(ScoutFlyer) : AirVehicleDamageProfile
hoverHeight = 5; // Height off the ground at rest
createHoverHeight = 3; // Height off the ground when created
// Turbo Jet
jetForce = 2000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 28; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 2.8; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
vertThrustMultiple = 2.0;
// Rigid body
mass = 150; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 0; // Don't mess with this.
minImpactSpeed = 8; // If hit ground at speed above this then it's an impact. Meters/second
softImpactSpeed = 10; // Sound hooks. This is the soft hit.
softImpactSpeed = 14; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // Sound hooks. This is the hard hit.
speedDamageScale = 0.04;
collDamageThresholdVel = 20.0;
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 23; // If hit ground at speed above this then it's an impact. Meters/second
speedDamageScale = 0.06;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 23.0;
collDamageMultiplier = 0.02;
//
@ -126,10 +131,10 @@ datablock FlyingVehicleData(ScoutFlyer) : AirVehicleDamageProfile
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 15.0;
mediumSplashSoundVelocity = 30.0;
hardSplashSoundVelocity = 60.0;
exitSplashSoundVelocity = 20.0;
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 15.0;
hardSplashSoundVelocity = 20.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;

View file

@ -100,7 +100,7 @@ datablock AudioProfile(AssaultMortarIdleSound)
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock HoverVehicleData(AssaultVehicle) : GroundVehicleDamageProfile
datablock HoverVehicleData(AssaultVehicle) : TankDamageProfile
{
spawnOffset = "0 0 4";
@ -129,15 +129,14 @@ datablock HoverVehicleData(AssaultVehicle) : GroundVehicleDamageProfile
cameraOffset = 3;
cameraLag = 1.5;
explosion = LargeGroundVehicleExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;
maxSteeringAngle = 0.5; // 20 deg.
maxDamage = 3.15;
destroyedLevel = 3.15;
collDamageThresholdVel = 20.0;
collDamageMultiplier = 0.03;
isShielded = true;
rechargeRate = 1.0;
energyPerDamagePoint = 135;
@ -154,10 +153,16 @@ datablock HoverVehicleData(AssaultVehicle) : GroundVehicleDamageProfile
gyroDamping = 0.3;
stabilizerForce = 20;
minDrag = 10;
minImpactSpeed = 5;
softImpactSpeed = 5; // Play SoftImpact Sound
hardImpactSpeed = 15; // Play HardImpact Sound
speedDamageScale = 0.06;
softImpactSpeed = 15; // Play SoftImpact Sound
hardImpactSpeed = 18; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 17;
speedDamageScale = 0.060;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 17;
collDamageMultiplier = 0.070;
dragForce = 40 / 20;
vertFactor = 0.0;
@ -201,10 +206,10 @@ datablock HoverVehicleData(AssaultVehicle) : GroundVehicleDamageProfile
forwardJetEmitter = TankJetEmitter;
//
softSplashSoundVelocity = 15.0;
mediumSplashSoundVelocity = 30.0;
hardSplashSoundVelocity = 60.0;
exitSplashSoundVelocity = 20.0;
softSplashSoundVelocity = 5.0;
mediumSplashSoundVelocity = 10.0;
hardSplashSoundVelocity = 15.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
@ -346,7 +351,7 @@ datablock TurretImageData(AssaultPlasmaTurretBarrel)
usesEnergy = true;
useMountEnergy = true;
fireEnergy = 3.75;
minEnergy = 3.75;
minEnergy = 20.0;
// Turret parameters
activationMS = 4000;
@ -398,9 +403,10 @@ datablock TurretImageData(AssaultPlasmaTurretBarrel)
stateName[5] = "Deactivate";
stateSequence[5] = "Activate";
stateDirection[5] = false;
stateTimeoutValue[5] = 1;
stateTransitionOnLoaded[5] = "ActivateReady";
stateTransitionOnTimeout[5] = "Dead";
stateTimeoutValue[5] = 30;
// stateTransitionOnLoaded[5] = "ActivateReady";
// stateTransitionOnTimeout[5] = "Dead";
stateTransitionOnTimeout[5] = "ActivateReady";
stateName[6] = "Dead";
stateTransitionOnLoaded[6] = "ActivateReady";

View file

@ -31,7 +31,7 @@ datablock AudioProfile(ScoutThrustSound)
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock HoverVehicleData(ScoutVehicle) : GravCycleDamageProfile
datablock HoverVehicleData(ScoutVehicle) : WildcatDamageProfile
{
spawnOffset = "0 0 1";
@ -54,6 +54,8 @@ datablock HoverVehicleData(ScoutVehicle) : GravCycleDamageProfile
numMountPoints = 1;
isProtectedMountPoint[0] = true;
explosion = VehicleExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;
lightOnly = 1;
@ -67,17 +69,20 @@ datablock HoverVehicleData(ScoutVehicle) : GravCycleDamageProfile
minJetEnergy = 15;
jetEnergyDrain = 1.3;
collDamageThresholdVel = 20.0;
collDamageMultiplier = 0.01;
// Rigid Body
mass = 400;
bodyFriction = 0.1;
bodyRestitution = 0.5;
minImpactSpeed = 10;
softImpactSpeed = 10; // Play SoftImpact Sound
hardImpactSpeed = 25; // Play HardImpact Sound
speedDamageScale = 0.008;
softImpactSpeed = 20; // Play SoftImpact Sound
hardImpactSpeed = 28; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 29;
speedDamageScale = 0.010;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 23;
collDamageMultiplier = 0.040;
dragForce = 25 / 45.0;
vertFactor = 0.0;
@ -119,10 +124,10 @@ datablock HoverVehicleData(ScoutVehicle) : GravCycleDamageProfile
wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 20.0;
mediumSplashSoundVelocity = 50.0;
hardSplashSoundVelocity = 100.0;
exitSplashSoundVelocity = 20.0;
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 20.0;
hardSplashSoundVelocity = 30.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterSoftSound;
impactWaterEasy = VehicleImpactWaterSoftSound;

View file

@ -23,7 +23,7 @@ startChatMenu( "G Global" );
addChat( "S Great shot!", 'ChatGreatShot' );
endChatMenu();
startChatMenu( "R Respond" );
addChat( "A Any time", 'ChatAnyTime' );
addChat( "A Anytime", 'ChatAnyTime' );
addChat( "D Don't know", 'ChatDontKnow' );
addChat( "T Thanks", 'ChatThanks' );
addChat( "W Wait", 'ChatWait' );
@ -193,10 +193,10 @@ startChatMenu( "W Warning" );
addChat( "W Watch your shooting", 'ChatWarnShoot' );
endChatMenu();
startChatMenu( "V Very quick" );
startChatMenu( "V Very Quick" );
addChat( "Y Yes", 'ChatTeamYes' );
addChat( "N No", 'ChatTeamNo' );
addChat( "A Any time", 'ChatWelcome' );
addChat( "A Anytime", 'ChatWelcome' );
addChat( "B Base secure?", 'ChatIsBaseSecure' );
addChat( "C Cease fire", 'ChatCeaseFire' );
addChat( "D Don't know", 'ChatDunno' );

View file

@ -218,12 +218,74 @@ function serverCmdListenToNone(%client)
}
//------------------------------------------------------------------------------
function serverCmdSetVoiceChannels(%client, %number)
// Client bind functions:
//------------------------------------------------------------------------------
function voiceCapStart()
{
$voiceCaptureStarted = true;
// client can send voice? (dont bother recording.. server will reject it anyway)
if(($Audio::serverChannels == 0) || ($Audio::serverEncodingLevel < $pref::Audio::encodingLevel))
{
if($Audio::serverChannels == 0)
addMessageHudLine("\c2System:\cr server has disabled voice communication.");
else
{
switch($Audio::serverEncodingLevel)
{
case 0: %level = "Low";
case 1: %level = "Medium";
default: %level = "High";
}
addMessageHudLine("\c2System:\cr server has voice level capped at [\c1" @ %level @ "\cr].");
}
$voiceCaptureStarted = false;
return;
}
vcRecordingHud.setVisible(true);
voiceCommHud.setVisible(true);
resizeVoiceCommWindow();
alxCaptureStart();
}
function voiceCapStop()
{
if(!$voiceCaptureStarted)
return;
vcRecordingHud.setVisible(false);
if($numTalking < 1)
voiceCommHud.setVisible(false);
alxCaptureStop();
}
//------------------------------------------------------------------------------
function serverCmdSetVoiceInfo(%client, %channels, %decodingMask, %encodingLevel)
{
%wasEnabled = %client.listenEnabled();
%client.setVoiceChannels(%number);
if ( %wasEnabled != ( %number > 0 ) )
// server has voice comm turned off?
if($Audio::maxVoiceChannels == 0)
%decodingMask = 0;
else
%decodingMask &= (1 << ($Audio::maxEncodingLevel + 1)) - 1;
if($Audio::maxEncodingLevel < %encodingLevel)
%encodingLevel = $Audio::maxEncodingLevel;
if($Audio::maxVoiceChannels < %channels)
%channels = $Audio::maxVoiceChannels;
%client.setVoiceChannels(%channels);
%client.setVoiceDecodingMask(%decodingMask);
%client.setVoiceEncodingLevel(%encodingLevel);
commandToClient(%client, 'SetVoiceInfo', %channels, %decodingMask, %encodingLevel);
if ( %wasEnabled != ( %channels > 0 ) )
updateCanListenState( %client );
}

View file

@ -111,6 +111,7 @@ function TurretDeployedCamera::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
%obj.mountImage(DeployableCameraBarrel, 0, true);
%obj.setRechargeRate(%this.rechargeRate);
}
function TurretDeployedCamera::onDestroyed(%this, %obj, %prevState)
@ -397,8 +398,9 @@ function MobileTurretBase::onDamage()
function MobileTurretBase::damageObject(%this, %targetObject, %sourceObject, %position, %amount, %damageType)
{
//If vehicle turret is hit then apply damage to the vehicle
%vehicle = %damageObj.getObjectMount();
%vehicle.getDataBlock().damageObject(%vehicle, %sourceObject, %position, %amount, %damageType);
%vehicle = %targetObject.getObjectMount();
if(%vehicle)
%vehicle.getDataBlock().damageObject(%vehicle, %sourceObject, %position, %amount, %damageType);
}
function MobileTurretBase::onEndSequence(%data, %obj, %thread)

View file

@ -50,7 +50,49 @@ datablock AudioProfile(ELFHitTargetSound)
};
//--------------------------------------
// Projectile
// Sparks
//--------------------------------------
datablock ParticleData(ELFSparks)
{
dragCoefficient = 1;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 200;
lifetimeVarianceMS = 0;
textureName = "special/blueSpark";
colors[0] = "0.8 0.8 1.0 1.0";
colors[1] = "0.8 0.8 1.0 1.0";
colors[2] = "0.8 0.8 1.0 0.0";
sizes[0] = 0.35;
sizes[1] = 0.15;
sizes[2] = 0.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(ELFSparksEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 4;
velocityVariance = 2;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 180;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
// lifetimeMS = 100;
particles = "ELFSparks";
};
//--------------------------------------
// Projectile
//--------------------------------------
datablock ELFProjectileData(BasicELF)
{
@ -77,6 +119,7 @@ datablock ELFProjectileData(BasicELF)
textures[1] = "special/ELFLightning";
textures[2] = "special/BlueImpact";
emitter = ELFSparksEmitter;
};
//--------------------------------------

View file

@ -133,6 +133,8 @@ datablock TurretData(TurretDeployedCamera) : TurretDamageProfile
thetaMax = 180;
//thetaNull = 90;
deployedObject = true;
isShielded = false;
energyPerDamagePoint = 40;
maxEnergy = 30;

View file

@ -641,11 +641,11 @@ datablock SeekerProjectileData(ShoulderMissile)
lifetimeMS = 6000;
muzzleVelocity = 10.0;
maxVelocity = 65.0;
maxVelocity = 80.0;
turningSpeed = 90.0;
acceleration = 200.0;
proximityRadius = 5;
proximityRadius = 3;
terrainAvoidanceSpeed = 180;
terrainScanAhead = 25;

View file

@ -79,6 +79,18 @@ function ExecuteSearch(%id)
DatabaseQueryArray(BrowserSearchPane.query,0,trim($BrowserSearchField) TAB 0 TAB 100 TAB 0, BrowserSearchPane, BrowserSearchPane.key);
}
//-----------------------------------------------------------------------------
function getTribeMember(%tribeName)
{
%bResult = false;
%CRec = wonGetAuthInfo();
for(%tribeNo = 0;%tribeNo < getField(getRecord(%CRec,1),0); %tribeNo++)
{
if(strupr(%tribeName) $= strupr(getField(getRecord(%CRec,2+%tribeNo),0)))
%bResult = true;
}
return %bResult;
}
//-----------------------------------------------------------------------------
function CreateTribe()
{
$CreateTribeName = "";
@ -172,10 +184,8 @@ function EditDescriptionApply()
{
%desc = EditDescriptionText.getValue();
TProfileHdr.Desc = %desc;
error("ETYPE: " @ TWBText.editType);
if(TWBText.editType $= "tribe")
{
error("TRIBENAME: " @ TProfileHdr.tribename);
TribePane.key = LaunchGui.key++;
TribePane.state = "editTribeDesc";
canvas.SetCursor(ArrowWaitCursor);
@ -183,7 +193,6 @@ function EditDescriptionApply()
}
else
{
error("PLAYERNAME: " @ TProfileHdr.playername);
TWBText.key = LaunchGui.key++;
TWBText.state = "editWarriorDesc";
canvas.SetCursor(ArrowWaitCursor);
@ -250,6 +259,7 @@ function GetProfileHdr(%type, %line)
W_History.setVisible(1);
W_Tribes.setVisible(1);
%isMe = getField(getRecord(wonGetAuthInfo(),0),0)$=twbTitle.name;
TProfileHdr.isMe = %isMe;
if(%isMe)
{
W_BuddyList.setText("BUDDYLIST");
@ -344,17 +354,6 @@ function LinkEditWarrior()
//-----------------------------------------------------------------------------
function LinkEditWarriorDesc(%player, %handler)
{
// if(%handler.editType $= "tribe")
// if(trim(%player) !$= "")
// {
// %handler.tribe = %player;
// %handler.editType = "tribe";
// }
// else
// {
// TWBText.editType = "warrior";
// }
Canvas.pushDialog(BrowserEditInfoDlg);
EditDescriptionText.setValue(TProfileHdr.Desc);
}
@ -382,10 +381,8 @@ function LinkEditMember(%player, %tribe, %pv, %title,%owner)
// Get callers rank in members tribe
for(%i=0;%i<getfield(getRecord(%ai,1),0);%i++)
{
error("TRIBE:"TAB getField(getRecord(%ai,2+%i),0) TAB %tribe);
if( getField(getRecord(%ai,2+%i),0) == %tribe || (getField(getRecord(%ai,2+%i),3)==1401 && getField(getRecord(%ai,2+%i),4)>1))
{
error("TRIBE MATCH FOUND" TAB getField(getREcord(%ai,2+%i),4));
%callerPv = getField(getRecord(%ai,2+%i),4);
break;
}
@ -400,7 +397,6 @@ function LinkEditMember(%player, %tribe, %pv, %title,%owner)
if(getField(getRecord(%ai,0),0) $= getField(twbTitle.getValue(),0)) //if the caller is the member to be edited
{
error("CALLER IS MEMBER" TAB %rnk TAB %pv TAB %callerPv);
switch( %pv )
{
case 0:
@ -427,7 +423,6 @@ function LinkEditMember(%player, %tribe, %pv, %title,%owner)
}
else
{
error("CALLER IS NOT MEMBER" TAB %rnk TAB %pv TAB %callerPv);
switch( %rnk )
{
case 1:
@ -600,24 +595,20 @@ function TAM_OnAction(%caller)
TribeAdminMemberDlg.vPerm = %caller;
}
//-----------------------------------------------------------------------------
function updateNewTagPreview()
{
%ntag = TAD_NewTag.getValue();
%playerName = GetField(GetRecord(WonGetAuthInfo(),0),0);
if ( $NewTagAppend )
TAD_PreviewTag.setValue( %playerName @ %ntag);
else
TAD_PreviewTag.setValue(%ntag @ %playerName);
}
//-----------------------------------------------------------------------------
function updateTribeTagPreview()
{
%warrior = getField( WONGetAuthInfo(), 0 );
// Validate the tribe tag:
%tag = CT_TagText.getValue();
%realTag = StripMLControlChars( %tag );
if ( %tag !$= %realTag )
CT_TagText.setValue( %realTag );
if ( $CreateTribeAppend )
CT_PreviewText.setValue( %warrior @ %tag );
CT_PreviewText.setValue( %warrior @ %realTag );
else
CT_PreviewText.setValue( %tag @ %warrior );
CT_PreviewText.setValue( %realTag @ %warrior );
}
//-- TribeAndWarriorBrowserGui -----------------------------------------------
@ -638,7 +629,6 @@ function TribeAndWarriorBrowserGui::onWake(%this)
%warrior = getField( %info, 0 );
TWBTabView.view( %warrior, "Warrior" );
w_profile.setValue(1);
w_tribes.setValue(1);
// Add tabs for the player's tribal pages:
%tribeCount = getField( getRecord( %info, 1 ), 0 ); //%cert
@ -681,8 +671,8 @@ function TribeAndWarriorBrowserGui::onSleep(%this)
//==-- CreateTribeDlg -------------------------------------------------------
function CreateTribeDlg::onWake( %this )
{
rbAppendTab.setValue(1);
// updateTribeTagPreview();
//rbAppendTab.setValue(1);
updateTribeTagPreview();
}
//-----------------------------------------------------------------------------
function CreateTribeDlg::CreateTribe(%this)
@ -705,7 +695,7 @@ function CreateTribeDlg::onDatabaseQueryResult(%this,%status,%resultString,%key)
{
if ( %this.key != %key )
return;
echo("RECV: " @ %status);
// echo("RECV: " @ %status);
if(getField(%status,0)==0)
{
switch$(%this.state)
@ -737,7 +727,7 @@ function CreateTribeDlg::onDatabaseRow(%this,%row,%isLastRow,%key)
{
if( %this.key != %key )
return;
echo("RECV: " @ %row);
// echo("RECV: " @ %row);
}
//==-- TribeAdminMemberDlg ---------------------------------------------------
function TribeAdminMemberDlg::onWake(%this)
@ -749,7 +739,7 @@ function TribeAdminMemberDlg::onDatabaseQueryResult( %this, %status, %resultStri
{
if ( %this.key != %key )
return;
echo("RECV: " @ %status);
// echo("RECV: " @ %status);
if(getField(%status,0)==0)
{
switch$(%this.state)
@ -773,7 +763,7 @@ function TribeAdminMemberDlg::onDatabaseRow(%this,%row,%isLastRow,%key)
{
if ( %this.key != %key )
return;
echo("RECV: " @ %row);
// echo("RECV: " @ %row);
}
//-----------------------------------------------------------------------------
function TribeAdminMemberDlg::connectionTerminated( %this, %key )
@ -800,7 +790,7 @@ function BrowserSearchPane::onDatabaseQueryResult(%this, %status, %resultStatus,
{
if(%key != %this.key)
return;
echo("RECV: " @ %status);
// echo("RECV: " @ %status);
if(getField(%status,0)==0)
{
switch$(%this.state)
@ -846,18 +836,16 @@ function BrowserSearchPane::onDatabaseRow(%this, %row, %isLastRow, %key)
{
if(%key != %this.key)
return;
echo("RECV: " @ %row);
// echo("RECV: " @ %row);
switch$(%this.state)
{
case "tribe":
%line = getTribeName(getFields(%row, 1),0) TAB getField(%row, 2);
error("TLine: " @ %line);
BrowserSearchMatchList.addRow(%this.rowNum++, %line);
if(%isLastRow)
%this.state = "done";
case "warrior":
%line = getFields(%row,1);
error("WLine: " @ %line);
BrowserSearchMatchList.addRow(%this.rowNum++, %line);
if(%isLastRow)
%this.state = "done";
@ -1059,13 +1047,14 @@ function TWBText::onDatabaseQueryResult(%this,%status,%resultString,%key)
{
if(%this.key != %key)
return;
echo("TWB RECV: " @ %status);
// echo("TWB RECV: " @ %status);
if(getField(%status,0)==0)
{
switch$(%this.state)
{
case "editWarriorDesc":
%this.state = "done";
WP_WarriorDescription.setText(EditDescriptionText.getValue());
Canvas.popDialog(BrowserEditInfoDlg);
messageBoxOK("COMPLETE","Warrior Description Changed","W_profile.setValue(1);");
WarriorPropertiesDlg.pendingChanges="";
@ -1090,24 +1079,13 @@ function TWBText::onDatabaseRow(%this,%row,%isLastRow, %key)
{
if(!%this.key == %key)
return;
echo("RECV: " @ %row);
// echo("RECV: " @ %row);
}
//-----------------------------------------------------------------------------
function TWBText::connectionTerminated( %this, %key )
{
TWBTabView.refresh();
}
//==-- TribeAttribDlg --------------------------------------------------------
function TribeAttribDlg::onWake(%this)
{
TribeAttribDlg.tribeName = %tribeName;
$CurrentTribeTag = %TribeTag;
$NewTagAppend = %appending;
$NewTribeTag = "";
$NewTagPreview = "";
Canvas.RePaint();
updateNewTagPreview();
}
//-----------------------------------------------------------------------------
//==-- TribePane --------------------------------------------------------------
//-----------------------------------------------------------------------------
@ -1155,7 +1133,7 @@ function TribePane::onDatabaseQueryResult(%this, %status, %resultString , %key)
{
if ( %this.key != %key )
return;
echo("RECV: " @ %status);
// echo("RECV: " @ %status);
if(getField(%status,0)==0)
{
switch$(%this.state)
@ -1192,8 +1170,9 @@ function TribePane::onDatabaseQueryResult(%this, %status, %resultString , %key)
%this.state = "done";
GetProfileHdr(0,getFields(%status,2));
TWBText.Clear();
%isMember = getTribeMember(TProfileHdr.TribeName);
%Tdesc = "<lmargin:10><just:left><Font:Univers Condensed:18><color:ADFFFA>Recruiting: <font:Univers Condensed:18>" @
(TProfileHdr.recruiting ? "YES <a:requestlink\t" @ TProfileHdr.tribename @ ">Request Invite</a>" : "NO");
(TProfileHdr.recruiting ? (%isMember ? "YES" : "YES <a:requestlink\t" @ TProfileHdr.tribename @ ">Request Invite</a>") : "NO");
%Tdesc = %Tdesc @ "<Font:Univers Condensed:18>" NL "<color:82BEB9><lmargin:30><Font:Univers:18>";
TWBText.setText(%TDesc);
TProfileHdr.Desc = %resultString;
@ -1279,7 +1258,7 @@ function TribePane::onDatabaseRow(%this, %row, %isLastRow, %key)
{
if ( %this.key != %key )
return;
echo("RECV: " @ %row);
// echo("RECV: " @ %row);
switch$(%this.state)
{
case "tribeRoster":
@ -1467,7 +1446,7 @@ function PlayerPane::onDatabaseQueryResult(%this,%status,%resultString,%key)
{
if(%this.key != %key)
return;
echo("RECV: " @ %status);
// echo("RECV: " @ %status);
if(getField(%status,0)==0)
{
switch$(%this.state)
@ -1481,26 +1460,16 @@ function PlayerPane::onDatabaseQueryResult(%this,%status,%resultString,%key)
PlayerPix.setBitmap(TProfileHdr.playerGfx);
else
PlayerPix.setBitmap($PlayerGfx);
// if(%isCaller)
// {
// %newText = "<Font:Arial Bold:14><color:ADFFFA>OPTIONS:<lmargin:20><Font:Arial:14>\n\n";
// %newText = %newText @ "<a:editwarrior" TAB TWBTitle.name @ ">Edit Warrior Name</a>\n";
// %newText = %newText @ "<a:editdescription" TAB TWBTitle.name TAB "" @ ">Edit Description</a>\n";
// }
%profileText = "<lmargin:10><just:left>" @ %newText @ "\n<lmargin:10><just:left><Font:Univers Condensed:18><color:ADFFFA>PLAYER PROFILE:\n\n<lmargin:20><Font:Univers:18>";
%profileText = %profileText @ "Registered:" SPC "<color:FFAA00>" @ TProfileHdr.registered @ "<color:ADFFFA>\n";
%profileText = %profileText @ "Online:" SPC (TProfileHdr.onLine ? "<color:33FF33>YES":"<color:FF3333>NO") @ "<color:ADFFFA>\n";
%profileText = "<just:left><lmargin:10><color:ADFFFA><Font:Univers Condensed:10> \n<Font:Univers Condensed:18>";
%profileText = %profileText @ "Registered:<color:FFAA00>" SPC TProfileHdr.registered @ "<color:ADFFFA>\n";
%profileText = %profileText @ "Online: " SPC (TProfileHdr.onLine ? "<color:33FF33>YES":"<color:FF3333>NO") @ "<color:ADFFFA>\n";
if(trim(TProfileHdr.playerURL) !$= "")
%profileText = %profileText @ "WebSite:" SPC "<spush><color:CCAA33><a:wwwlink\t" @ TProfileHdr.playerURL @ ">"@TProfileHdr.playerURL@"</a><spop>\n";
%profileText = %profileText @ "WebSite: " SPC "<spush><color:CCAA33><a:wwwlink\t" @ TProfileHdr.playerURL @ ">"@TProfileHdr.playerURL@"</a><spop>\n\n";
else
%profileText = %profileText @ "WebSite:" SPC "<spush><color:CCAA33><a:wwwlink\twww.tribes2.com>TRIBES 2 BABY!</a><spop>\n";
%profileText = %profileText @ "WebSite: " SPC "<spush><color:CCAA33><a:wwwlink\twww.tribes2.com>www.tribes2.com</a><spop>\n\n";
// W_Text.setText(W_Text.getText() @ "Preferred Armor:" SPC "<color:FFAA00>SCOUT<color:ADFFFA>\n");
// W_Text.setText(W_Text.getText() @ "Preferred Weapon:" SPC "<color:FFAA00>SNIPER RIFLE<color:ADFFFA>\n");
// W_Text.setText(W_Text.getText() @ "Preferred Game:" SPC "<color:FFAA00>CTF<color:ADFFFA>\n");
// W_Text.setText(W_Text.getText() @ "Preferred Role:" SPC "<color:FFAA00>DEFENSE<color:ADFFFA><Font:Arial Bold:14>\n");
%profileText = %profileText @ "<color:82BEB9><lmargin:30><Font:Univers:18>";
%profileText = %profileText @ "<color:82BEB9><Font:Univers:18><just:left><lmargin:20>";
W_Text.setText(%profileText @ %resultString);
TProfileHdr.Desc = %resultString;
if( w_memberlist.rowCount() ==0 )
@ -1598,12 +1567,15 @@ function PlayerPane::onDatabaseQueryResult(%this,%status,%resultString,%key)
MessageBoxOK("CONFIRMED",getField(%status,1));
case "changePlayerName":
%this.state = "done";
echo("wus:"@WonUpdateCertificate());
// echo("wus:"@WonUpdateCertificate());
TProfileHdr.playername = NewNameEdit.getValue();
wp_currentname.setText(NewNameEdit.getValue());
twbTabView.setTabText(twbTabView.getSelectedId(),NewNameEdit.getValue());
w_profile.setValue(1);
MessageBoxOK("CONFIRMED","Warrior name has been changed." NL "This will require you to close and restart the game to ensure proper function","WarriorPropertiesDlg.onWake();");
case "clearWarriorDescription":
%this.state = "done";
MessageBoxOK("CONFIRMED","Warrior Description Cleared");
}
}
else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061")
@ -1623,7 +1595,7 @@ function PlayerPane::onDatabaseRow(%this,%row,%isLastRow,%key)
{
if(%this.key != %key)
return;
echo("RECV: " @ %row);
// echo("RECV: " @ %row);
switch$(%this.state)
{
case "warriorHistory":
@ -1803,7 +1775,7 @@ function W_MemberList::onRightMouseDown( %this, %column, %row, %mousePos )
}
function w_MemberList::onAdd(%this)
{
W_MemberList.addStyle( 1, "Univers Condensed", 12 , "150 150 150", "100 100 000", "000 000 100" );
W_MemberList.addStyle( 1, "Univers", 12 , "150 150 150", "200 200 200", "60 60 60" );
}
//==--------------------------------------------------------------------------
function WarriorPopupDlg::onWake( %this )
@ -1946,7 +1918,7 @@ function MemberList::onRightMouseDown( %this, %column, %row, %mousePos )
}
function Memberlist::onAdd(%this)
{
MemberList.addStyle( 1, "Univers Condensed", 12 , "150 150 150", "100 100 000", "000 000 100" );
MemberList.addStyle( 1, "Univers", 12 , "150 150 150", "200 200 200", "60 60 60" );
}
//-----------------------------------------------------------------------------
function TribeMemberPopupDlg::onWake( %this )
@ -2137,7 +2109,7 @@ function TribePropertiesDlg::ClearDescription(%this)
TP_TribeDescription.setText("");
TProfileHdr.Desc = "";
TWBText.editType = "tribe";
canvas.SetCursor(ArrowWaitCursor);
canvas.SetCursor(ArrowWaitCursor);
DatabaseQuery(15,TProfileHdr.tribename TAB getRecordCount(%desc) TAB %desc,TribePane,TribePane.key);
}
//-----------------------------------------------------------------------------
@ -2150,12 +2122,18 @@ function TribePropertiesDlg::UpdateDescription(%this)
function TribePropertiesDlg::RefreshTag(%this)
{
%this.pendingChanges = "YES";
%playerName = GetField( WonGetAuthInfo(), 0 );
// Validate the tribe tag:
%ntag = TP_NewTag.getValue();
%playerName = GetField(GetRecord(WonGetAuthInfo(),0),0);
%realTag = StripMLControlChars( %ntag );
if ( %ntag !$= %realTag )
TP_NewTag.setValue( %realTag );
if ( TP_PrePendFlagBtn.getValue()==0 )
TP_PreviewTag.setValue( %playerName @ %ntag);
TP_PreviewTag.setValue( %playerName @ %realTag );
else
TP_PreviewTag.setValue(%ntag @ %playerName);
TP_PreviewTag.setValue( %realTag @ %playerName );
}
//-----------------------------------------------------------------------------
function TribePropertiesDlg::LoadGfxPane(%this)
@ -2209,6 +2187,7 @@ function WarriorPropertiesDlg::onWake(%this)
UrlEdit.setValue(TProfileHdr.playerURL);
WP_CurrentName.setValue(TProfileHdr.playername);
NewNameEdit.setValue("");
WP_WarriorDescription.setText(TProfileHdr.Desc);
%this.LoadGfxPane();
}
//-----------------------------------------------------------------------------
@ -2220,6 +2199,8 @@ function WarriorPropertiesDlg::Close(%this)
else
{
Canvas.popDialog(%this);
w_GraphicsControl.setVisible(0);
W_ProfilePane.setVisible(1);
W_Profile.setValue(1);
}
}
@ -2233,27 +2214,31 @@ function WarriorPropertiesDlg::EditDescription(%this)
//-----------------------------------------------------------------------------
function WarriorPropertiesDlg::ClearDescription(%this)
{
MessageBoxYesNo("CONFIRM","Clear your Players Description?","doClearDescription();","");
MessageBoxYesNo("CONFIRM","Clear your Players Description?","WarriorPropertiesDlg.doClearDescription();","");
}
//-----------------------------------------------------------------------------
function WarriorPropertiesDlg::doClearDescription(%this)
{
PlayerPane.key = LaunchGui.key++;
TProfileHdr.Desc = "no description";
PlayerPane.state = "clearWarriorDescription";
TProfileHdr.Desc = "NONE";
TWBText.editType = "warrior";
canvas.SetCursor(ArrowWaitCursor);
%this.pendingChanges = "";
DatabaseQuery(17,TProfileHdr.Playername TAB getRecordCount(%desc) TAB %desc,PlayerPane,PlayerPane.key);
EditDescriptionText.setText("No Description On File");
WP_WarriorDescription.setText(EditDescriptionText.getText());
DatabaseQuery(17,TProfileHdr.Desc,PlayerPane,PlayerPane.key);
}
//-----------------------------------------------------------------------------
function WarriorPropertiesDlg::LoadGfxPane(%this)
{
PlayerGraphic.setBitmap(PlayerPix.bitmap);
%ctrl = WarriorGraphicsList;
%width = getSubStr(%ctrl.getExtent(),0,3)-4;
%fileSpec = "*.jpg";
%ctrl.clearColumns();
%ctrl.clear();
%ctrl.addColumn( 0, "FILENAME", 100, 0, 140 );
%ctrl.addColumn( 0, "FILENAME",%width, 0, 200 );
%id = -1;
%rowId = "";
for ( %file = findFirstFile( %fileSpec ); %file !$= ""; %file = findNextFile( %fileSpec ) )

View file

@ -118,15 +118,14 @@ function EmailMessageDelete()
//-----------------------------------------------------------------------------
function DoEmailDelete(%qnx, %mid, %owner, %key, %row)
{
error("QNX: " @ %qnx TAB %mid TAB %row);
EM_ReplyBtn.setActive( false );
EM_ReplyToAllBtn.setActive( false );
EM_ForwardBtn.setActive( false );
EM_DeleteBtn.setActive( false );
EM_BlockBtn.setActive( false );
EmailMessageVector.deleteLine(EmailMessageVector.getLineIndexByTag(%mid));
EM_Browser.removeRowByIndex( %row );
EmailMessageVector.deleteLine(EmailMessageVector.getLineIndexByTag(%mid));
if(%qnx==6)
EmailGui.dumpCache();
@ -300,7 +299,7 @@ function EmailGetTextDisplay(%text)
else
%curList = ",";
while((%pos = strpos(%curList, ",", %strStart)) != -1 && %cl++ < 50)
while((%pos = strpos(%curList, ",", %strStart)) != -1)
{
if(%strStart==0)
%to = trim(getLinkNameOnly(getSubStr(%curList, %strStart, %pos-%strStart)));
@ -321,7 +320,7 @@ function EmailGetTextDisplay(%text)
else
%curList = ",";
while((%pos = strpos(%curList, ",", %strStart)) != -1 && %ck++<50)
while((%pos = strpos(%curList, ",", %strStart)) != -1)
{
if(%strStart==0)
%ccLine = getLinkNameOnly(getSubStr(%curList, %strStart, %pos-%strStart));
@ -362,13 +361,13 @@ function CheckEmail(%calledFromSched)
{
if(EmailGui.checkingEmail)
{
echo("Check In Progress");
// echo("Check In Progress");
return;
}
if(EmailGui.checkSchedule && !%calledFromSched)
{
echo("Email Schedule " @ EmailGui.checkSchedule @ "Cancelled");
// echo("Email Schedule " @ EmailGui.checkSchedule @ "Cancelled");
cancel(EmailGui.checkSchedule); // cancel schedule
}
EmailGui.checkSchedule = "";
@ -431,7 +430,7 @@ function EMailComposeDlg::onDatabaseQueryResult(%this, %status, %RowCount_Result
{
if(%this.key != %key)
return;
echo("RECV: " @ %status TAB %RowCount_Result);
// echo("RECV: " @ %status TAB %RowCount_Result);
if(getField(%status,0)==0)
{
switch$(%this.state)
@ -460,6 +459,8 @@ function EmailComposeDlg::Cancel(%this)
//-----------------------------------------------------------------------------
function EmailComposeDlg::SendMail(%this)
{
$EmailToAddress = Email_ToEdit.getValue();
$EmailSubject = EMail_Subject.getValue();
// NEED TO CHECK FOR DUPLICATES
if(trim($EmailToAddress) $= "")
MessageBoxOK("No Address","TO Address may not be left blank. Please enter a player name to send this message to.");
@ -476,7 +477,7 @@ function EMailBlockDlg::onDatabaseQueryResult(%this,%status,%ResultString,%key)
{
if(%this.key != %key)
return;
echo("RECV: " @ %status TAB %ResultString);
// echo("RECV: " @ %status TAB %ResultString);
if(getField(%status,0)==0)
{
switch$(%this.state)
@ -506,7 +507,7 @@ function EMailBlockDlg::onDatabaseRow(%this,%row,%isLastRow,%key)
{
if(%this.key != %key)
return;
echo("RECV: " @ %row TAB %isLastRow);
// echo("RECV: " @ %row TAB %isLastRow);
switch$(%this.state)
{
case "names":
@ -595,7 +596,7 @@ function AddressDlg::onDatabaseQueryResult(%this,%status,%resultString,%key)
{
if(%this.key != %key)
return;
echo("RECV: " @ %status TAB %resultString);
// echo("RECV: " @ %status TAB %resultString);
if(getField(%status,0)==0)
{
switch$(%this.state)
@ -663,7 +664,7 @@ function AddressDlg::onDatabaseRow(%this,%row,%isLastRow,%key)
if(%this.key != %key)
return;
echo("RECV : " @ %row);
// echo("RECV : " @ %row);
switch$(%this.state)
{
case "memberList":
@ -913,7 +914,6 @@ function AddressDlg::onWake(%this)
//-- EMailGui ----------------------------------------------------------------
function EmailGui::onWake(%this)
{
error("EMailGui.onWake" TAB %this.cacheFile);
// Make these buttons inactive until a message is selected:
EM_ReplyBtn.setActive( false );
EM_ReplyToAllBtn.setActive( false );
@ -976,7 +976,7 @@ function EMailGui::onDatabaseQueryResult(%this, %status, %RowCount_Result, %key)
{
if(%this.key != %key)
return;
echo("RECV: " @ %status);
// echo("RECV: " @ %status);
if(getField(%status,0)==0)
{
switch$(%this.state)
@ -988,6 +988,7 @@ function EMailGui::onDatabaseQueryResult(%this, %status, %RowCount_Result, %key)
%this.messageCount = 0;
%this.message = "";
%this.state = "NewMail";
%this.getCache();
}
else
{
@ -1000,7 +1001,7 @@ function EMailGui::onDatabaseQueryResult(%this, %status, %RowCount_Result, %key)
EmailGui.btnClicked = false;
}
%this.checkSchedule = schedule(1000 * 60 * 5, 0, CheckEmail, true);
echo("scheduling Email check " @ %this.checkSchedule @ " in 5 minutes");
// echo("scheduling Email check " @ %this.checkSchedule @ " in 5 minutes");
}
case "sendMail":
%this.state = "done";
@ -1054,7 +1055,7 @@ function EMailGui::onDatabaseRow(%this, %row,%isLastRow,%key)
if(%this.key != %key)
return;
echo("RECV: " @ %row NL %isLastRow);
// echo("RECV: " @ %row NL %isLastRow);
switch$(%this.state)
{
case "DeletedMail":
@ -1075,10 +1076,7 @@ function EMailGui::onDatabaseRow(%this, %row,%isLastRow,%key)
EmailMessageVector.pushBackLine(%this.message, getField(%this.message, 0));
if(%isLastRow)
%this.outputVector();
case "NewMail":
if(%this.messageCount++ == 1)
%this.getCache();
case "NewMail":
%this.checkingEmail = "";
%ID = getField(%row,0);
%senderQuad = getFields(%row,1,4);
@ -1110,7 +1108,7 @@ function EMailGui::onDatabaseRow(%this, %row,%isLastRow,%key)
EmailGui.dumpCache();
EmailGui.loadCache();
%this.checkSchedule = schedule(1000 * 60 * 5, 0, CheckEmail, true);
echo("scheduling Email check " @ %this.checkSchedule @ " in 5 minutes");
// echo("scheduling Email check " @ %this.checkSchedule @ " in 5 minutes");
}
}
}
@ -1175,8 +1173,7 @@ function EmailGui::loadCache( %this )
EM_Browser.clear();
EMailMessageVector.clear();
EMailInboxBodyText.setText("");
%fileName = $EmailCachePath @ "email0";
error("EMAIL CACHE" @ %fileName);
%fileName = $EmailCachePath @ "email0";
%file = new FileObject();
if ( %this.cacheFile $= "" )
{
@ -1220,17 +1217,6 @@ function EmailGui::dumpCache( %this )
{
%guid = getField( WONGetAuthInfo(), 3 );
if ( %this.cacheFile $= "" ) %this.cacheFile = "email0";
// {
// %base = $EmailCachePath @ "email";
// %num = 0;
// %cacheFile = %base @ %num;
// while ( isFile( %cacheFile ) )
// {
// %num++;
// %cacheFile = %base @ %num;
// }
// %this.cacheFile = %cacheFile;
// }
EmailMessageVector.dump( $EmailCachePath @ %this.cacheFile, %guid );
}
//-----------------------------------------------------------------------------

View file

@ -67,32 +67,6 @@ if(!isObject(ForumsMessageVector))
new MessageVector(ForumsMessageVector);
}
//-----------------------------------------------------------------------------
function ForumsGui::CheesyGradient(%this,%sender,%text,%startColor,%endColor)
{
%gText = "<spush><color:"@%startColor@">";
if(%endColor > %startColor)
{
%interval = %endColor - %startColor;
for(%x=0;%x<strLen(%text);%x++)
{
%gText = %gText @ getSubStr(%text,%x,1) @ "<color:" @ %startColor+(%interval*%x) @ ">";
}
}
else
{
%interval = %startColor - %endColor;
for(%x=0;%x<strLen(%text);%x++)
{
%gText = %gText @ getSubStr(%text,%x,1) @ "<color:" @ %startColor-(%interval*%x) @ ">";
}
}
error("CG:"@ %startColor TAB %endColor TAB %interval);
%gText = %gText @ "<spop>";
error("CHEESY:" @ %gText);
}
//-----------------------------------------------------------------------------
function DateStrCompare(%date1,%date2)
{
%d1 = getSubStr(%date1,0,2);
@ -283,7 +257,7 @@ function ForumsMessageAddRow(%text)
if(ForumsMessageList.getRowId(%i) == %parentId)
{
%parentRow = ForumsMessageList.getRowText(%i);
echo("Found parent");
// echo("Found parent");
break;
}
}
@ -365,6 +339,7 @@ function ForumsOpenThread(%tid)
//-----------------------------------------------------------------------------
function ForumsPost()
{
$ForumsSubject = FP_SubjectEdit.getValue();
if ( trim($ForumsSubject) $= "" )
{
MessageBoxOK( "POST FAILED", "Your post cannot be accepted without text in the Subject line.",
@ -469,9 +444,18 @@ function ForumsReply()
//-----------------------------------------------------------------------------
function GetQuotedText()
{
ForumsBodyText.setValue("<spush><color:FFCCAA>\"" @ trim(ForumsText.getText()) @ "\"<spop>\n\n");
ForumsBodyText.MakeFirstResponder(1);
ForumsBodyText.setCursorPosition(3600);
if(ForumsComposeDlg.parentPost == 0)
{
ForumsBodyText.setValue("<spush><color:FFCCAA>ALL YOUR BASE ARE BELONG TO US<spop>\n\n");
ForumsBodyText.MakeFirstResponder(1);
ForumsBodyText.setCursorPosition(3600);
}
else
{
ForumsBodyText.setValue("<spush><color:FFCCAA>\"" @ trim(ForumsText.getText()) @ "\"<spop>\n\n");
ForumsBodyText.MakeFirstResponder(1);
ForumsBodyText.setCursorPosition(3600);
}
// ForumsBodyText.setCursorPosition(strLen(ForumsBodyTExt.getText())+5);
}
//-----------------------------------------------------------------------------
@ -504,7 +488,7 @@ function GetTopicsList()
ForumsTopicsList.clear();
canvas.SetCursor(ArrowWaitCursor);
ForumsTopicsList.clearList();
DatabaseQueryArray(8,200,ForumsComposeDlg.forum,ForumsGui,ForumsGui.key);
DatabaseQueryArray(8,80,ForumsComposeDlg.forum,ForumsGui,ForumsGui.key);
ForumsTopicsList.refreshFlag = 0;
}
//-----------------------------------------------------------------------------
@ -589,7 +573,7 @@ function ForumsGui::onDatabaseQueryResult(%this,%status,%resultString,%key)
{
if(%this.key != %key)
return;
echo("RECV: " @ %status TAB %resultString);
// echo("RECV: " @ %status TAB %resultString);
if(getField(%status,0)==0)
{
switch$(%this.state)
@ -716,7 +700,7 @@ function ForumsGui::onDatabaseRow(%this,%row,%isLastRow,%key)
{
if(%this.key != %key)
return;
echo("RECV: " @ %row);
// echo("RECV: " @ %row);
%forumTID = getField(ForumsList.getRowTextbyId(ForumsList.getSelectedID()),2);
switch$(%this.state)
{
@ -749,7 +733,6 @@ function ForumsGui::onDatabaseRow(%this,%row,%isLastRow,%key)
ForumShell.setTitle("FORUMS: " @ getField(ForumsList.getRowTextbyID(ForumsList.getSelectedID()),0));
ForumsTopicsList.updateReadStatus();
%this.refreshFlag = false;
error("TID: " @ ForumsMessageVector.tid);
if ( ForumsGui.LaunchTopic !$= "" )
{
ForumsTopicsList.selectTopic( ForumsGui.LaunchTopic );
@ -927,7 +910,7 @@ function TopicsPopupDlg::onWake( %this )
//-----------------------------------------------------------------------------
function TopicsPopupMenu::onSelect( %this, %id, %text )
{
echo("TPM RECV: " @ %id TAB %text);
// echo("TPM RECV: " @ %id TAB %text);
switch( %id )
{
case 0: // 0 Reset Cache
@ -1122,7 +1105,6 @@ function ForumsMessageList::loadCache( %this, %forumTID)
ForumsMessageVector.clear();
ForumsMessageList.clear();
ForumsMessageVector.tid = %forumTID;
error("BFLAG: " @ ForumsGui.bflag TAB %forumTID);
switch( ForumsGui.bflag )
{
case 0:
@ -1225,11 +1207,10 @@ function ForumsMessageList::loadCache( %this, %forumTID)
FO_EditBtn.visible = true;
}
}
// error( "** ADDING MESSAGE FROM CACHE - " @ %text @ " **" );
if(%this.allRead && DateStrCompare(%this.lastDate,%date))
%text = setRecord( %text, 0, "1" );
echo( "** ADDING MESSAGE FROM CACHE - " @ %postId @ " **" );
// echo( "** ADDING MESSAGE FROM CACHE - " @ %postId @ " **" );
ForumsMessageVector.pushBackLine( %text, %postId );
}
}
@ -1319,7 +1300,7 @@ function ForumsMessagelist::onDatabaseQueryResult(%this,%status,%resultString,%k
{
if(%this.key != %key)
return;
echo("RECV: " @ %status TAB %resultString);
// echo("RECV: " @ %status TAB %resultString);
if(getField(%status,0)==0)
{
switch$(%this.state)

View file

@ -87,7 +87,7 @@ function NewsGui::onDatabaseQueryResult(%this, %status, %RowCount_Result, %key)
{
if(%key != %this.key)
return;
echo("RECV: " @ %status);
// echo("RECV: " @ %status);
%this.maxDate = " ";
%this.minDate = " ";
if(getField(%status,0)==0)
@ -151,7 +151,7 @@ function NewsGui::onDatabaseRow(%this, %row,%isLastRow,%key)
{
if ( %key != %this.key )
return;
echo("RECV: " @ %row);
// echo("RECV: " @ %row);
%this.article[%this.articleCount] = %row;
%this.recordSet--;
if ( %this.articleCount == 0 )
@ -228,7 +228,7 @@ function NewsPostDlg::onDatabaseQueryResult(%this, %status, %RowCount_Result, %k
{
if(%key != %this.key)
return;
echo("RECV: " @ %status);
// echo("RECV: " @ %status);
if(getField(%status,0)==0)
{
switch$(%this.state)
@ -281,9 +281,7 @@ function NewsText::onURL(%this, %url)
Canvas.pushDialog( NewsPostDlg );
case "deletenews":
NewsPostDlg.key = LaunchGui.key++;
NewsPostDlg.state = "delete";
DatabaseQuery(3,getFields(%url,2), NewsPostDlg, NewsPostDlg.Key);
MessageBoxYesNo("CONFIRM","Delete this Article?","NewsPostDlg.doNewsDelete(\"" @ getField(%url,2) TAB getField(%url,3) @ "\");","canvas.setCursor(DefaultCursor);");
case "topiclink":
%articleId = getField(%url,2);
@ -294,6 +292,13 @@ function NewsText::onURL(%this, %url)
}
}
//-----------------------------------------------------------------------------
function NewsPostDlg::doNewsDelete(%this,%fields)
{
%this.key = LaunchGui.key++;
%this.state = "delete";
DatabaseQuery(3,%fields, %this, %this.key);
}
//-----------------------------------------------------------------------------
function NewsHeadlines::onSelect( %this, %id, %text )
{
NewsText.scrollToTag( %id );
@ -302,7 +307,6 @@ function NewsHeadlines::onSelect( %this, %id, %text )
function NewsGui::getPreviousNewsItems( %this )
{
// Fetch the next batch of newer news items:
error("FETCHING PREV NEWS ITEMS");
if ( %this.set == 1 )
return;
canvas.SetCursor(ArrowWaitCursor);
@ -316,7 +320,6 @@ function NewsGui::getPreviousNewsItems( %this )
function NewsGui::getNextNewsItems( %this )
{
// Fetch the next batch of older news items:
error("FETCHING NEXT NEWS ITEMS");
canvas.SetCursor(ArrowWaitCursor);
NewsGui.key = LaunchGui.key++;
%this.state = "status";
@ -329,7 +332,7 @@ function NewsMOTDText::onDatabaseQueryResult(%this, %status, %RowCount_Result, %
{
if(%key != %this.key)
return;
echo("RECV: " @ %status);
// echo("RECV: " @ %status);
if(getField(%status,0)==0)
{
NewsEditMOTDBtn.setVisible( getField(%status,2));
@ -366,7 +369,7 @@ function NewsEditMotdDlg::OnDatabaseQueryResult(%this, %status, %RowCount_Result
{
if(%key != %this.key)
return;
echo("RECV: " @ %status);
// echo("RECV: " @ %status);
if(getField(%status,0)==0)
%this.state = "proceed";
else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061")

View file

@ -162,6 +162,15 @@ function HandleDatabaseProxyResponse(%prefix, %params)
function DatabaseQueryi(%astr, %args, %proxyObject, %key)
{
if ($IRCClient::state !$= IDIRC_CONNECTED)
{
IRCClient::connect();
if (%proxyObject !$= "")
%proxyObject.onDatabaseQueryResult("1\tORA-04061", "", %key);
return;
}
// maxRows will be empty
$NextDatabaseQueryId++;
%id = $NextDatabaseQueryId;
@ -175,8 +184,6 @@ function DatabaseQueryi(%astr, %args, %proxyObject, %key)
%args = strreplace(%args, "\\", "\\\\");
%args = strreplace(%args, "\n", "\\n");
echo("Called DBQueryi - astr: " @ %astr @ " args: " @ %args);
%len = strlen(%args);
%i = 0;
while(%i+400 < %len)
@ -201,5 +208,5 @@ function DatabaseQueryArray(%ordinal, %maxRows, %args, %proxyObject, %key)
function WONUpdateCertificateDone(%errCode, %errStr)
{
echo("Got cert back from WON: " @ %errCode @ " = " @ %errStr);
IRCClient::relogin();
}