1,690 save.bls

Large diffs are not rendered by default.

17,273 saveBK.bls

Large diffs are not rendered by default.

@@ -15,6 +15,8 @@
exec("./lib/Support_Raycasts.cs");
exec("./lib/text.cs");
exec("./lib/items.cs");
exec("./lib/timedfiring.cs");
exec("./lib/timedraycast.cs");
//src
exec("./src/overwrite.cs");
exec("./src/events.cs");
@@ -99,6 +99,7 @@ function serverCmdReport(%this, %m1, %m2, %m3, %m4, %m5, %m6, %m7, %m8, %m9, %m1
if (%other.isAdmin)
messageClient(%other, '', '\c0REPORT from \c3%1\c6: %2', %this.getPlayerName(), %text);
}
messageClient(%this, '', '\c0Your report\c6: %1', %text);
%this.lastReport = getSimTime();
}
function serverCmdGetKiller(%client)
@@ -28,8 +28,21 @@
%maxstamina = %this.player.energyLimit;
}

%roleColor = "\c7";
%role = "Undecided";
if (%this.inDefaultGame() && isObject(%this.miniGame.gameMode.killer))
{
%roleColor = "\c2";
%role = "Innocent";
if (%this.miniGame.gameMode.killer == %this)
{
%roleColor = "\c0";
%role = "Killer";
}
}

%text = "\c6Health: \c0"@%health@"/"@%maxhealth@"<just:right>\c6Name: <color:"@%nameTextColor@">"@%character.name@"\c6 (\c3Room #"@%character.room@"\c6)";
%text = %text @ "<just:left><br>\c6Stamina: \c5"@%stamina@"/"@%maxstamina;
%text = %text @ "<br>\c6Exhaustion: \c5" @ %bar;
%text = %text @ "<just:left><br>\c6Stamina: \c5"@%stamina@"/"@%maxstamina @ "<just:right>\c6Role:" SPC %roleColor @ %role;
%text = %text @ "<just:left><br>\c6Exhaustion: \c5" @ %bar;
%this.bottomPrint(%text, 5, 0);
}
@@ -93,19 +93,21 @@ function serverCmdMessageSent(%client, %text)
if (isObject(%client.character))
%name = %client.character.name;

%structure = '<color:ffaa44>%1<color:ffffff> %3, \"%2\"';
%structure = '<color:ffaa44>%1<color:ffffff> %3, %4\"%2\"';
%does = "says";
%range = 24;
if (getSubStr(%text, 0, 1) $= "!") //shouting
{
%text = getSubStr(%text, 1, strLen(%text));
%does = "shouts";
%font = "<font:Verdana:28>";
%range = 100;
}
else if(getSubStr(%text, 0, 1) $= "@") //Whispering
{
%text = getSubStr(%text, 1, strLen(%text));
%does = "whispers";
%font = "<font:segoe ui light:24>";
%range = 4;
}

@@ -150,13 +152,13 @@ function serverCmdMessageSent(%client, %text)
}

messageClient(%other, '', %structure,
%name, %text, %does);
%name, %text, %does, %font);
}
}

function serverCmdTeamMessageSent(%client, %text) //OOC
{
if (!%client.inDefaultGame())
if (!%client.inDefaultGame() && %client.hasSpawnedOnce)
return Parent::serverCmdMessageSent(%client, %text);
if (isEventPending(%client.miniGame.resetSchedule))
return serverCmdMessageSent(%client, %text);
@@ -40,6 +40,7 @@ function serverCmdHelp(%this, %cat)
%text[%count++] = " \c6To navigate the inventory menu, use building controls (move brick forward/backward, brick plant key and cancel brick key)";
%text[%count++] = " \c3Double-click and hold\c6 to carry around a corpse. Hold click to carry an item. Fast click to pick up an item.";
%text[%count++] = " \c6Dormitory rooms are \c3SOUNDPROOF\c6, meaning all sound made inside the room is isolated. Nobody will hear you scream on the outside unless you leave the door open!";
%text[%count++] = " \c6To sleep, say \c3/sleep\c6. You will be unconscious for some time.";
%text[%count++] = " \c5Page Up to read the above.";
case "5" or "combat":
%text[%count++] = "\c3[COMBAT]";
@@ -1,4 +1,4 @@
$FOOTSTEPS_INTERVAL = 150;
$FOOTSTEPS_INTERVAL = 300;
$FOOTSTEPS_MIN_LANDING = -1.5;
$FOOTSTEPS_WALKING_FACTOR = 0.5;
$FOOTSTEPS_BLOODYFOOTPRINTS = 1;
@@ -49,7 +49,7 @@

%this.getDataBlock().onFootstep(%this, %foot);
// 290?
%this.playFootsteps = %this.schedule(300, "playFootsteps", !%foot);
%this.playFootsteps = %this.schedule($FOOTSTEPS_INTERVAL * (%this.running ? 0.75 : 1), "playFootsteps", !%foot);
}

function Player::getFootPosition(%this, %foot)
@@ -181,7 +181,10 @@ package DespairSyndromePackage
%message = '%2 killed %1';

if (%sourceClient == %client || %sourceClient == 0)
{
%message = $DeathMessage_Suicide[%damageType];
%client.corpse.suicide = true;
}
else
%message = $DeathMessage_Murder[%damageType];

@@ -272,7 +275,8 @@ function serverCmdAlarm(%this)
{
if (isObject(%player.tool[%player.currTool]) && %corpse.addTool(%player.tool[%player.currTool], %player.getItemProps(%player.currTool)) != -1) //Tool selected, plant on body
{
%player.removeToolSlot(%player.currTool, 1);
%player.itemProps[%player.currTool] = "";
%player.removeToolSlot(%player.currTool);
%player.playThread(2, "shiftAway");
if (%this.isViewingInventory)
%this.updateInventoryView();
@@ -9,6 +9,7 @@
function DSGameMode::onStart(%this, %miniGame)
{
$DefaultMiniGame.noWeapons = false;
$DefaultMiniGame.shapeNameDistance = 13.5;
%miniGame.messageAll('', '\c5A new round has started. Current mode is: %1! %2', %this.name, %this.desc);

// Close *all* doors
@@ -96,7 +97,7 @@
%point = %roomSpawn.getTransform();
%player.setTransform(%point);
%player.setShapeName(%character.name, 8564862);
%player.setShapeNameDistance(13.5);
%player.setShapeNameDistance($DefaultMiniGame.shapeNameDistance);
if (%character.gender $= "female")
{
%nameTextColor = "ff11cc";
@@ -177,6 +178,16 @@
}
function DSGameMode::onDay(%this, %miniGame)
{
$DefaultMiniGame.shapeNameDistance = 13.5;
for (%i = 0; %i < %miniGame.numMembers; %i++)
{
%member = %miniGame.member[%i];
%player = %member.player;

if (!isObject(%player))
continue;
%player.setShapeNameDistance($DefaultMiniGame.shapeNameDistance); //Update shapenames
}
loadEnvironment($DS::Path @ "data/env/day.txt");
%miniGame.messageAll('', '\c5All water in the building has resumed function. Cafeteria has been unlocked.');
%name = "_sink";
@@ -191,6 +202,7 @@
}
function DSGameMode::onNight(%this, %miniGame)
{
$DefaultMiniGame.shapeNameDistance = 5;
//Exhaust all players
for (%i = 0; %i < %miniGame.numMembers; %i++)
{
@@ -201,6 +213,7 @@
continue;

%player.updateExhaustion();
%player.setShapeNameDistance($DefaultMiniGame.shapeNameDistance); //Update shapenames
}
loadEnvironment($DS::Path @ "data/env/night.txt");
%miniGame.messageAll('', '\c5All water in the building has been disabled for the night. Cafeteria will be off-limits in 30 seconds.');
@@ -11,6 +11,23 @@ class = DSGameMode;
};
}

datablock ItemData(MemorialItem)
{
canPickUp = false;
doColorShift = true;
colorShiftColor = "0.7 0.7 0.2 1";
shapeFile = $DS::Path @ "res/shapes/props/memorial.dts";

uiName = "Memorial";
canDrop = false;

mass = 2;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
};

function DSGameMode_Trial::onStart(%this, %miniGame)
{
parent::onStart(%this, %miniGame);
@@ -106,12 +123,7 @@ class = DSGameMode;
if (%body.Discovered[%i] $= %client)
return;
}
for (%i=1;%i<=%body.attackCount;%i++) //Parse attack logs for info
{
if (%body.attackType[%i] $= "Suicide")
%suicide = true;
}
if (!%body.ignore && !%suicide && !%body.unconscious)
if (!%body.ignore && !%body.suicide && !%body.unconscious)
{
%body.Discovered[%body.bodyDiscoveries++] = %client;
%client.play2d(bodyDiscoveryNoise @ getRandom(1,2));
@@ -146,33 +158,37 @@ class = DSGameMode;
}
function DSGameMode_Trial::trialStart(%this, %miniGame)
{
for (%i = 0; %i < %miniGame.numMembers; %i++)
for (%i = 0; %i < GameCharacters.getCount(); %i++)
{
%member = %miniGame.member[%i];
%player = %member.player;
if (!isObject(%member.character))
%character = GameCharacters.getObject(%i);
%player = %character.player;
if (!isObject(%character))
continue;

%character = %member.character;
%stand = BrickGroup_888888.NTObject["_courtstand_" @ %character.room, 0];
%center = BrickGroup_888888.NTObject["_courtroom_center", 0];
if (!isObject(%player))
if (!isObject(%player) || %player.getState() $= "Dead")
{
%sign = new Item() {
dataBlock = hammerItem;
position = vectorAdd(getWords(%stand.getTransform(), 0, 2), "0 0 2");
dataBlock = MemorialItem;
position = vectorAdd(getWords(%stand.getTransform(), 0, 2), "0 0 1.9");
static = true;
};
missionCleanUp.add(%sign);
GameRoundCleanup.add(%sign);
%sign.setShapeName(%character.name SPC "(DEAD)");
%sign.PointAt(getWords(%center.getTransform(), 0, 2));
%status = "(LEFT)";
if (isObject(%player))
%status = %player.ignore ? "(FREEKILL)" : (%player.suicide ? "(SUICIDE)" : "(DEAD)");
%sign.setShapeName(%character.name SPC %status);
%sign.setShapeNameColor("0.5 0.5 0.5");
continue;
}
%player.setTransform(vectorAdd(getWords(%stand.getTransform(), 0, 2), "0 0 0.3"));
%player.PointAt(getWords(%center.getTransform(), 0, 2));
%player.setVelocity("0 0 0"); //Prevents sliding around
%player.setShapeNameDistance(120);
%player.wakeUp();
%player.setShapeNameDistance(120);
%player.changeDataBlock(PlayerDSFrozenArmor);
}
%this.trial = true;
@@ -198,6 +214,7 @@ class = DSGameMode;
}
function DSGameMode_Trial::checkVotes(%this, %miniGame)
{
cancel(%this.trialSchedule);
%correct = 0;
%wrong = 0;
%miniGame.messageAll('', '\c5 There were \c3%1 votes in total!', %this.voteCount);
@@ -76,6 +76,7 @@
%this.setArmThread(land);
%this.getDataBlock().onDisabled(%this, 1);
%this.unconscious = true;
%this.setShapeNameDistance(0);
%this.isBody = true;
%this.wakeUpSchedule = %this.schedule(%duration, WakeUp);
}
@@ -95,6 +96,7 @@
%this.setArmThread(look);
%this.unconscious = false;
%this.isBody = false;
%this.setShapeNameDistance($defaultMinigame.shapeNameDistance);
%this.changeDataBlock(PlayerDSArmor);
}

@@ -188,29 +190,34 @@ function serverCmdUnUseTool(%client, %slot)
// echo("HARM:" SPC %obj.attackCount SPC %obj.attackRegion[%obj.attackCount] SPC %obj.attackType[%obj.attackCount] SPC %obj.attacker[%obj.attackCount].GetPlayerName());
%obj.setDamageFlash(getMax(0.25, %damage / %obj.maxHealth));

%randMax = %type == $DamageType::Sharp ? 2 : 3; //Sharp weapons have higher chance to cause blood
%blood = %type != $DamageType::Suicide && %type != $DamageType::Stamina;
%obj.playPain();
if (%blood)
%obj.doSplatterBlood(3);
%obj.doSplatterBlood(%randMax, %pos, %vector, %type == $DamageType::Sharp ? 45 : 180);
if (%source.getClassName() $= "Player") //rather good chance of getting blood on yourself
{
if (getRandom(1, 3) == 1 && %blood)
%image = %source.getMountedImage(0);
%props = %source.getItemProps();
if (%props.class $= "MeleeProps") //Can bloodify!
%props.bloody = true; //Always bloodify
if (getRandom(1, %randMax) == 1 && %blood)
{
%source.bloody["rhand"] = true;
// %source.bloody["lhand"] = true; //Idea: bloodify the other hand if player tries to carry the body!
%source.bloody["chest_front"] = true; //you filthy murderer, get blood on your chest.
if (isObject(%source.client))
%source.client.applyBodyParts();
}
if (getRandom(1, 2) == 1 && %blood)
if (getRandom(1, %randMax) == 1 && %blood)
{
%obj.bloody["chest_" @ (%dot > 0 ? "back" : "front")] = true; //TODO: take sides into account, too. Maybe.
if (isObject(%obj.client))
%obj.client.applyBodyParts();
}
if (%dot > 0) //Backstab
{
%damage *= 1 + %dot; //double it
%damage *= getMin(1, %image.backstabMult) + %dot;
}
}
if (%type == $DamageType::Stamina)
@@ -227,7 +234,7 @@ function serverCmdUnUseTool(%client, %slot)
if (%obj.health <= 0)
{
if (%blood)
%obj.doSplatterBlood(10);
%obj.doSplatterBlood(6, %pos, %vector, %type == $DamageType::Sharp ? 45 : 180);
Parent::damage(%this, %obj, %src, %position, %this.maxDamage * 4, %type);
}
}
@@ -129,7 +129,7 @@ datablock PlayerData(PlayerCorpseArmor : PlayerStandardArmor)
if (%this.exhaustion <= 0)
{
%msg = "You got too exhausted and have fallen unconscious...";
%this.KnockOut(90000, 2); //1 minute 30 seconds KO. Regain 2 bars tho
%this.KnockOut(120000, 2); //2 minute KO. Regain 2 bars tho
}
if (isObject(%this.client))
{
@@ -140,15 +140,15 @@ datablock PlayerData(PlayerCorpseArmor : PlayerStandardArmor)

function serverCmdSleep(%this, %bypass)
{
if(!isObject(%this.player))
if(!isObject(%this.player) || !%this.inDefaultGame() || %this.miniGame.gameMode.trial)
return;
if (%bypass)
{
%this.player.KnockOut(60000, 2); //1 minute KO w/ 2 bars of exhaustion recovery
%this.player.KnockOut(90000, 2); //1.30 minute KO w/ 2 bars of exhaustion recovery
%this.updateBottomPrint();
return;
}
%message = "\c2Are you sure you want to sleep?\nYou will be unconscious for a minute!";
%message = "\c2Are you sure you want to sleep?\nYou will be unconscious for a minute and a half!";
commandToClient(%this, 'messageBoxYesNo', "Sleep Prompt", %message, 'SleepAccept');
}

@@ -287,7 +287,11 @@ function serverCmdSleepAccept(%this)
}
else
{
%text = "\c6This is" SPC (isObject(%found.character) ? %found.character.name : "Unknown") @ "'s body.";
if (isObject(%found.client))
%character = %found.client.character;
else
%character = %found.character;
%text = "\c6This is" SPC (isObject(%character) ? %character.name : "Unknown") @ "'s body.";
if (%found.unconscious)
%text = %text @ "\n\c3They are unconscious.";
//Unfinished body examination flavortext below
@@ -24,7 +24,14 @@
function BucketItem::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
// Stuff
// %obj.alpha = 0.5;
// %obj.setNodeColor("liquid", "0.2 0.8 1" SPC %obj.alpha);
}

function BucketItem::updateLiquidColor(%this, %obj)
{
// %bucketProps = %obj.getItemProps();
// %obj.setNodeColor("liquid", BlendRGBA("0.2 0.8 1", "0.7 0 0" SPC %bucketProps.blood/%this.maxBlood) SPC getMax(%obj.alpha, %bucketProps.blood/%this.maxBlood));
}

function BucketProps::onAdd(%this)
@@ -139,6 +139,7 @@ datablock ShapeBaseImageData(mopImage)

%availableClean = getMin(%props.blood, BucketItem.maxBlood - %bucketProps.blood);
%bucketProps.blood += %availableClean;
%ray.getDataBlock().updateLiquidColor(%ray);
%props.blood -= %availableClean;

if (%props.blood > 0)
@@ -20,6 +20,8 @@ datablock ItemData(CaneItem)
doColorShift = false;
colorShiftColor = "0.100 0.500 0.250 1.000";

itemPropsClass = "MeleeProps";

// Dynamic properties defined by the scripts
image = CaneImage;
canDrop = true;
@@ -53,6 +53,8 @@ datablock ItemData(KnifeItem)
doColorShift = false;
colorShiftColor = "0.100 0.500 0.250 1.000";

itemPropsClass = "MeleeProps";

// Dynamic properties defined by the scripts
image = KnifeImage;
canDrop = true;
@@ -66,6 +68,14 @@ datablock ItemData(KnifeItem)
// blockEnemyDrain = 15; //How much stamina to drain from opponent on succesful block
};

function KnifeItem::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
// %props = %obj.getItemProps();
// if (!%props.bloody)
%obj.hideNode("blood");
}

////////////////////////////////////////////////////////
//weapon image//////////////////////////////////////////
////////////////////////////////////////////////////////
@@ -139,6 +149,7 @@ datablock ShapeBaseImageData(KnifeImage)
raycastRange = 2.5;
raycastFromEye = true;
directDamage = 15;
backstabMult = 3; //Rather huge backstab bonus
directDamageType = $DamageType::Sharp;
raycastHitExplosion = hammerProjectile;
};
@@ -17,6 +17,8 @@ datablock ItemData(AdvSwordItem)
doColorShift = true;
colorShiftColor = "0.471 0.471 0.471 1.000";

itemPropsClass = "MeleeProps";

// Dynamic properties defined by the scripts
image = AdvSwordImage;
canBlock = true; //Can you block w/ rightclick using this weapon?
@@ -28,6 +28,8 @@ datablock ItemData(UmbrellaItem)
friction = 0.6;
emap = true;

itemPropsClass = "MeleeProps";

//gui stuff
uiName = "Umbrella";
iconName = $DS::Path @ "res/icons/icon_Umbrella";
@@ -28,6 +28,8 @@ datablock ItemData(MonkeyWrenchItem)
friction = 0.6;
emap = true;

itemPropsClass = "MeleeProps";

//gui stuff
uiName = "Monkey Wrench";
iconName = $DS::Path @ "res/icons/icon_Wrench";