7/5/17 Fixes

Numerous fixes from today, see addition notes on Readme.md for details
This commit is contained in:
Robert Fritzen 2017-07-05 21:45:03 -05:00
parent 66218bf83b
commit 91c8b768f7
12 changed files with 644 additions and 922 deletions

View file

@ -3593,31 +3593,9 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
//now call the "onKilled" function if the client was... you know...
if(%targetObject.getState() $= "Dead") {
//Is there a boss going?
if(!%targetObject.isZombie && !%targetObject.isBossMinion) {
if($TWM2::BossGoing) {
//Chalk up the kill count :P
$TWM2::BossManager.addKill(%targetObject);
}
}
if(%targetObject.isVardisonMinion) {
$TWM2::VardisonManager.minionCount--;
}
if($TWM2::PlayingSabo) {
if(Game.Bomb.Carrier == %targetObject) {
if(%damageType == $DamageType::FellOff) {
MessageAll('msgWhoops', "\c5SABOTAGE: Bomb Reset.");
Game.BombDropped(Game.Bomb, %targetObject);
Game.bomb.setPosition($SabotageGame::BombLocation[$CurrentMission]);
}
else {
Game.BombDropped(Game.Bomb, %targetObject);
}
}
}
// where did this guy get it?
%damLoc = %targetObject.getDamageLocation(%position);
%damLoc = %targetObject.getDamageLocation(%position);
postObjectDestroyed(%sourceObject, %targetObject, %damageType, %damLoc);
// should this guy be blown apart?
if( %damageType == $DamageType::Explosion ||
@ -3646,138 +3624,6 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
// If we were killed, max out the flash
%targetObject.setDamageFlash(0.75);
%damLoc = %targetObject.getDamageLocation(%position);
if($TWM2::UseGoreMod) {
CreateBlood(%targetObject);
}
if(%damageType == $DamageType::RapierShield) {
if(%sourceObject.client !$= "") {
UpdateWeaponKillFile(%sourceObject.client, "rapierShieldImage");
}
}
if(%targetObject.isZombie) {
if($TWM::PlayingHorde == 1) {
if($HordeGame::Zombiecount > 0) { //ha! this should stop multiple waves from spawning
$HordeGame::Zombiecount--;
messageAll('MsgSPCurrentObjective1' ,"", "Wave "@$HordeGame::CurrentWave@" | Zombies Left: "@$HordeGame::Zombiecount@"");
}
//Echo("Horde: Zombie Killed, "@$HordeGame::Zombiecount@" remain."); //was used for debugging
if($HordeGame::Zombiecount <= 0) {
HordeNextWave($HordeGame::Game, $HordeGame::NextWave); //working on this
}
}
//
if($TWM::PlayingHelljump == 1) {
if($HellJump::Zombiecount > 0) { //ha! this should stop multiple waves from spawning
$HellJump::Zombiecount--;
messageAll('MsgSPCurrentObjective1' ,"", "[W"@$HellJump::CurrentWave@"|G"@$HellJump::CurrentGroup@"|S"@$HellJump::CurrentStrike@"] | Zombies Left: "@$HellJump::Zombiecount@"");
}
//Echo("Horde: Zombie Killed, "@$HordeGame::Zombiecount@" remain."); //was used for debugging
if($HellJump::Zombiecount <= 0) {
$HellJump::Game.GoNextStrike();
}
}
//
if(%targetObject.isPlayerZombie) {
%sourceClient.TWM2Core.PvPZombieKills++;
if(%sourceClient.TWM2Core.PvPZombieKills >= 100) {
CompleteNWChallenge(%sourceClient, "Defectionator1");
if(%sourceClient.TWM2Core.PvPZombieKills >= 250) {
CompleteNWChallenge(%sourceClient, "Defectionator2");
if(%sourceClient.TWM2Core.PvPZombieKills >= 500) {
CompleteNWChallenge(%sourceClient, "Defectionator3");
}
}
}
}
//
Game.ZkillUpdateScore(%sourceClient, %sourceObject, %targetObject);
%sourceObject.zombiekillsinarow++;
DoZKillstreakChecks(%sourceClient);
}
else {
if(%targetObject.team != %sourceClient.team && !%targetObject.isBoss) {
if(isObject(%sourceClient) && %sourceClient.IsActivePerk("Double Down")) {
GainExperience(%sourceClient, $TWM2::KillXPGain * 2, "[D-D]Enemy Killed ");
}
else {
GainExperience(%sourceClient, $TWM2::KillXPGain, "Enemy Killed ");
}
//Kill Recording..
if(!%targetObject.isZombie && %sourceObject.isZombie) {
%sourceClient.TWM2Core.PvPHumanKills++;
if(%sourceClient.TWM2Core.PvPHumanKills >= 50) {
CompleteNWChallenge(%sourceClient, "Infectionator1");
if(%sourceClient.TWM2Core.PvPHumanKills >= 100) {
CompleteNWChallenge(%sourceClient, "Infectionator2");
if(%sourceClient.TWM2Core.PvPHumanKills >= 250) {
CompleteNWChallenge(%sourceClient, "Infectionator3");
}
}
}
}
else {
%sourceClient.TWM2Core.PvPKills++;
if(%sourceClient.TWM2Core.PvPKills >= 100) {
CompleteNWChallenge(%sourceClient, "Slayer1");
if(%sourceClient.TWM2Core.PvPKills >= 250) {
CompleteNWChallenge(%sourceClient, "Slayer2");
if(%sourceClient.TWM2Core.PvPKills >= 500) {
CompleteNWChallenge(%sourceClient, "Slayer3");
if(%sourceClient.TWM2Core.PvPKills >= 750) {
CompleteNWChallenge(%sourceClient, "Slayer4");
if(%sourceClient.TWM2Core.PvPKills >= 1000) {
CompleteNWChallenge(%sourceClient, "Slayer5");
}
}
}
}
}
}
//Team Gain Perk
if(isObject(%sourceClient) && %sourceClient.IsActivePerk("Team Gain")) {
%TargetSearchMask = $TypeMasks::PlayerObjectType;
InitContainerRadiusSearch(%sourceObject.getPosition(), 20, %TargetSearchMask); //small distance
while ((%potentialTarget = ContainerSearchNext()) != 0){
if (%potentialTarget.getPosition() != %pos) {
if(%potentialTarget.client.team == %sourceClient.team && %potentialTarget != %sourceObject) {
GainExperience(%potentialTarget.client, $TWM2::KillXPGain, "Team Gain From "@%sourceClient.namebase@" ");
}
}
}
}
//End
doChallengeCheck(%sourceClient, %targetClient);
%sourceObject.killsinarow++;
%sourceObject.killsinarow2++;
//TWM2 3.2 -> Successive Kills
%sourceObject.kills[%damageType]++;
PerformSuccessiveKills(%sourceObject, %damageType);
//
if(%sourceObject.killsinarow2 == 10 && !(%sourceObject.isBoss || %sourceObject.isZombie)) {
MessageAll('MsgWOW', "\c2TWM2: "@%sourceClient.namebase@" is on a killsteak of 10");
awardClient(%sourceClient, "14");
}
if(%sourceObject.killsinarow2 == 20 && !(%sourceObject.isBoss || %sourceObject.isZombie)) {
MessageAll('MsgWOW', "\c2TWM2: "@%sourceClient.namebase@" is on a killsteak of 20");
}
if(%sourceObject.killsinarow2 == 25 && !(%sourceObject.isBoss || %sourceObject.isZombie)) {
MessageAll('MsgWOW', "\c2TWM2: "@%sourceClient.namebase@" is on a killsteak of 25");
}
DoKillstreakChecks(%sourceClient);
}
}
//Challenges!
doChallengeKillRecording(%sourceObject, %targetObject);
//
//martydom
if(%targetClient !$= "" && %targetClient.IsActivePerk("Martydom")) {
serverPlay3d(SatchelChargeActivateSound, %targetObject.getPosition());
schedule(2200, 0, "MartydomExplode", %targetObject.getPosition(), %targetClient);
}
Game.onClientKilled(%targetClient, %sourceClient, %damageType, %sourceObject, %damLoc);
}
else if ( %amount > 0.1 )