Air Rapier Zombies

Added the new AI capabilities to air rapiers. They will still function
just like before. Missile damage has been increased.
This commit is contained in:
Robert Fritzen 2017-10-17 16:12:59 -05:00
parent 923eb2ce37
commit 5106a3fbff
4 changed files with 160 additions and 169 deletions

View file

@ -83,6 +83,8 @@ PLEASE NOTE: I've moved all old changelogs into the version_history folder. This
* Replaced the acid cannon with an anti-tank photon cannon * Replaced the acid cannon with an anti-tank photon cannon
* Zombie lords will now preferential target enemy ground armor before infantry, and engage their photon cannon on targets * Zombie lords will now preferential target enemy ground armor before infantry, and engage their photon cannon on targets
* Zombie lords can now activate a defensive barrier to protect themselves and allies from damage temporarily... enjoy this new rage inducing mechanic :) * Zombie lords can now activate a defensive barrier to protect themselves and allies from damage temporarily... enjoy this new rage inducing mechanic :)
* Air Rapier
* Modified the damage scalar of missiles to be a OHK on rapier zombies
* Added Boss Proficiency * Added Boss Proficiency
* Hidden challenges embedded in boss fights that award additional experience for completing tough feats * Hidden challenges embedded in boss fights that award additional experience for completing tough feats
* For example: Defeat the shade lord without dying by the elemental shades * For example: Defeat the shade lord without dying by the elemental shades

View file

@ -23,7 +23,7 @@ $Zombie::BaseSpeed = 150;
$Zombie::TypeSpeed[2] = 300; $Zombie::TypeSpeed[2] = 300;
$Zombie::TypeSpeed[3] = 4000; $Zombie::TypeSpeed[3] = 4000;
$Zombie::TypeSpeed[4] = 240; $Zombie::TypeSpeed[4] = 240;
$Zombie::TypeSpeed[5] = 300; $Zombie::TypeSpeed[5] = 1500;
//$Zombie::BaseJumpCooldown: The time zombies must elapse before jumping / lunging //$Zombie::BaseJumpCooldown: The time zombies must elapse before jumping / lunging
$Zombie::BaseJumpCooldown = 1500; $Zombie::BaseJumpCooldown = 1500;
@ -37,6 +37,7 @@ $Zombie::SpeedMultiplier[4] = 0.75;
$Zombie::BaseSpeedUpdateTime = 100; $Zombie::BaseSpeedUpdateTime = 100;
//$Zombie::SpeedUpdateTime[#]: An override to the base update type, use for specific types that need slower or faster processing between AI steps //$Zombie::SpeedUpdateTime[#]: An override to the base update type, use for specific types that need slower or faster processing between AI steps
$Zombie::SpeedUpdateTime[3] = 500; $Zombie::SpeedUpdateTime[3] = 500;
$Zombie::SpeedUpdateTime[5] = 500;
//$Zombie::LungeDistance: How far (m) a zombie must be to lunge at a target //$Zombie::LungeDistance: How far (m) a zombie must be to lunge at a target
$Zombie::LungeDistance = 10; $Zombie::LungeDistance = 10;
@ -437,7 +438,6 @@ function TWM2Lib_Zombie_Core(%functionName, %arg1, %arg2, %arg3, %arg4) {
%zombie.mountImage(zLordPhotonCannonImg, 7); %zombie.mountImage(zLordPhotonCannonImg, 7);
%zombie.canFireWeapon = 1; %zombie.canFireWeapon = 1;
%zombie.canShield = 1; %zombie.canShield = 1;
%zombie.canmove = 1;
//Demon Zombie //Demon Zombie
case 4: case 4:
@ -445,6 +445,7 @@ function TWM2Lib_Zombie_Core(%functionName, %arg1, %arg2, %arg3, %arg4) {
Datablock = "DemonZombieArmor"; Datablock = "DemonZombieArmor";
}; };
%zombie.mountImage(ZdummyslotImg, 4); %zombie.mountImage(ZdummyslotImg, 4);
%zombie.canFireWeapon = 1;
//Air-Rapier Zombie //Air-Rapier Zombie
case 5: case 5:

View file

@ -1,5 +1,4 @@
datablock PlayerData(RapierZombieArmor) : LightMaleBiodermArmor datablock PlayerData(RapierZombieArmor) : LightMaleBiodermArmor {
{
maxDamage = 1.0; maxDamage = 1.0;
minImpactSpeed = 50; minImpactSpeed = 50;
speedDamageScale = 0.015; speedDamageScale = 0.015;
@ -19,24 +18,14 @@ datablock PlayerData(RapierZombieArmor) : LightMaleBiodermArmor
boundingBox = "2.0 2.0 1.2"; boundingBox = "2.0 2.0 1.2";
damageScale[$DamageType::M1700] = 2.0; damageScale[$DamageType::M1700] = 2.0;
damageScale[$DamageType::Missile] = 100.0;
max[RepairKit] = 0; max[RepairKit] = 0;
max[Mine] = 0; max[Mine] = 0;
max[Grenade] = 0; max[Grenade] = 0;
}; };
datablock StaticShapeData(fakeRapierZombie) : StaticShapeDamageProfile { datablock ShapeBaseImageData(ZWingImage) {
className = "player";
shapeFile = "bioderm_light.dts"; // dmiscf.dts, alternate
mass = 1;
elasticity = 0.1;
friction = 0.9;
collideable = 0;
isInvincible = true;
};
datablock ShapeBaseImageData(ZWingImage)
{
shapeFile = "flag.dts"; shapeFile = "flag.dts";
mountPoint = 1; mountPoint = 1;
@ -44,8 +33,7 @@ datablock ShapeBaseImageData(ZWingImage)
rotation = "0 1 0 90"; // L/R - F/B - T/B rotation = "0 1 0 90"; // L/R - F/B - T/B
}; };
datablock ShapeBaseImageData(ZWingImage2) datablock ShapeBaseImageData(ZWingImage2) {
{
shapeFile = "flag.dts"; shapeFile = "flag.dts";
mountPoint = 1; mountPoint = 1;
@ -53,8 +41,7 @@ datablock ShapeBaseImageData(ZWingImage2)
rotation = "0 -1 0 90"; // L/R - F/B - T/B rotation = "0 -1 0 90"; // L/R - F/B - T/B
}; };
datablock ShapeBaseImageData(ZWingAltImage) datablock ShapeBaseImageData(ZWingAltImage) {
{
shapeFile = "flag.dts"; shapeFile = "flag.dts";
mountPoint = 1; mountPoint = 1;
@ -62,8 +49,7 @@ datablock ShapeBaseImageData(ZWingAltImage)
rotation = "-0.5 2 0 35"; // L/R - F/B - T/B rotation = "-0.5 2 0 35"; // L/R - F/B - T/B
}; };
datablock ShapeBaseImageData(ZWingAltImage2) datablock ShapeBaseImageData(ZWingAltImage2) {
{
shapeFile = "flag.dts"; shapeFile = "flag.dts";
mountPoint = 1; mountPoint = 1;
@ -71,20 +57,25 @@ datablock ShapeBaseImageData(ZWingAltImage2)
rotation = "-0.5 -2 0 35"; // L/R - F/B - T/B rotation = "-0.5 -2 0 35"; // L/R - F/B - T/B
}; };
function RZombiemovetotarget(%zombie){ function RapierZombieArmor::AI(%datablock, %zombie) {
if(!isobject(%Zombie)) //No special AI here, we'll let %block.move() handle it...
if(!isObject(%zombie) || %zombie.getState() $= "dead") {
return; return;
if(%Zombie.getState() $= "dead") }
return;
%zombie.setHeat(999); %zombie.setHeat(999);
%pos = %zombie.getworldboxcenter();
%zombie.setActionThread("scoutRoot",true); %zombie.setActionThread("scoutRoot",true);
%closestClient = ZombieLookForTarget(%zombie); %datablock.move(%zombie);
%closestDistance = getWord(%closestClient,1); %datablock.schedule(%zombie.updateTimeFrequency, "AI", %zombie);
%closestClient = getWord(%closestClient,0).Player; }
if(%closestDistance <= $zombie::detectDist){
function RapierZombieArmor::move(%datablock, %zombie) {
%pos = %zombie.getworldboxcenter();
%targetParams = TWM2Lib_Zombie_Core("lookForTarget", %zombie);
%targetClient = getWord(targetParams, 0);
%distance = getWord(%targetParams, 1);
%target = %targetClient.player;
if(%distance <= $zombie::detectDist) {
if(%zombie.wingset == 1){ if(%zombie.wingset == 1){
%zombie.wingset = 0; %zombie.wingset = 0;
%Zombie.mountImage(ZWingImage, 3); %Zombie.mountImage(ZWingImage, 3);
@ -98,84 +89,81 @@ function RZombiemovetotarget(%zombie){
%chance = (getrandom() * 20); %chance = (getrandom() * 20);
if(%chance >= 19) { if(%chance >= 19) {
%chance = (getRandom() * 12); %chance = (getRandom() * 12);
if(%chance <= 11) if(%chance <= 11) {
serverPlay3d("ZombieMoan",%zombie.getWorldBoxCenter()); serverPlay3d("ZombieMoan", %zombie.getWorldBoxCenter());
else }
serverPlay3d("ZombieHOWL",%zombie.getWorldBoxCenter()); else {
serverPlay3d("ZombieHOWL", %zombie.getWorldBoxCenter());
}
} }
if(%zombie.iscarrying == 1) { if(%zombie.iscarrying == 1) {
%vector = vectorscale(%zombie.getForwardVector(),($Zombie::RForwardSpeed / 2)); %vector = vectorscale(%zombie.getForwardVector(), (%zombie.speed / 2));
%vector = getword(%vector, 0)@" "@getword(%vector, 1)@" "@($zombie::Rupvec * 1.5); %vector = getword(%vector, 0)@" "@getword(%vector, 1)@" "@($Zombie::RapierUpwardScaling * 1.5);
%zombie.applyImpulse(%zombie.getposition(), %vector); %zombie.applyImpulse(%zombie.getposition(), %vector);
} }
else { else {
%vector = TWM2Lib_Zombie_Core("zombieGetFacingDirection", %zombie, %target.getPosition());
%vector = ZgetFacingDirection(%zombie, %closestClient, %pos);
%z = Getword(%vector,2); %z = Getword(%vector,2);
%spd = vectorLen(%zombie.getVelocity()); %spd = vectorLen(%zombie.getVelocity());
%fallpoint = 0.05 - (%spd / 630); %fallpoint = 0.05 - (%spd / 630);
if(%closestdistance <= 15 || %z > (0.25 + %fallpoint) || %z < (-1 * (0.25 + %fallpoint))){ if(%distance <= 15 || %z > (0.25 + %fallpoint) || %z < (-1 * (0.25 + %fallpoint))) {
if(%z < 0) if(%z < 0) {
%upvec = ($zombie::Rupvec * (%z - (%spd / 130))); %upvec = ($Zombie::RapierUpwardScaling * (%z - (%spd / 130)));
if(%z >= 0) }
%upvec = ($zombie::Rupvec * (%z + 1)); if(%z >= 0) {
if(%spd <= 5) %upvec = ($Zombie::RapierUpwardScaling * (%z + 1));
}
if(%spd <= 5) {
%vector = vectorScale(%vector,3); %vector = vectorScale(%vector,3);
} }
else{ }
%upvec = $zombie::Rupvec * (%z + 1.2); else {
%upvec = $Zombie::RapierUpwardScaling * (%z + 1.2);
%spdmod = 1; %spdmod = 1;
} }
if(%z < 0) if(%z < 0) {
%z = %z * -1; %z = %z * -1;
%Zz = getWord(%zombie.getVelocity(),2);
if(%Zz <= -40){
%result = containerRayCast(%pos, vectoradd(%pos,vectorScale("0 0 1",%Zz * 2)), $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::TerrainObjectType, %zombie);
if(%result)
%upvec = $zombie::Rupvec * 5;
} }
%vector = vectorscale(%vector, ($Zombie::RForwardSpeed * (1 - %z))); %Zz = getWord(%zombie.getVelocity(), 2);
if(%Zz <= -40) {
%result = containerRayCast(%pos, vectoradd(%pos, vectorScale("0 0 1", %Zz * 2)), $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::TerrainObjectType, %zombie);
if(%result) {
%upvec = $Zombie::RapierUpwardScaling * 5;
}
}
%vector = vectorscale(%vector, (%zombie.speed * (1 - %z)));
%x = Getword(%vector,0); %x = Getword(%vector,0);
%y = Getword(%vector,1); %y = Getword(%vector,1);
%vector = %x@" "@%y@" "@%upvec; %vector = %x@" "@%y@" "@%upvec;
%zombie.applyImpulse(%pos, %vector); %zombie.applyImpulse(%pos, %vector);
} }
} }
%zombie.moveloop = schedule(500, %zombie, "RZombiemovetotarget", %zombie);
} }
function RkillLoop(%zombie,%target,%count){ function RapierZombieArmor::zCarryLoop(%datablock, %zombie, %target, %count) {
if(!isObject(%zombie)){ if(!isObject(%zombie) || %zombie.getState() $= "dead") {
%zombie.iscarrying = 0; %zombie.iscarrying = 0;
%target.grabbed = 0; %target.grabbed = 0;
return; return;
} }
if(!isObject(%target)){ if(!isObject(%target) || %target.getState() $= "dead") {
%zombie.iscarrying = 0; %zombie.iscarrying = 0;
%target.grabbed = 0; %target.grabbed = 0;
return; return;
} }
if (%Zombie.getState() $= "dead"){ if(%count == 50) {
%zombie.iscarrying = 0; %chance = getRandom(1, 3);
%target.grabbed = 0; if(%chance == 3) {
return;
}
if (%target.getState() $= "dead"){
%zombie.iscarrying = 0;
%target.grabbed = 0;
return;
}
if(%count == 50){
%chance = getRandom(1,3);
if(%chance == 3)
%target.damage(0, %tpos, 10.0, $DamageType::Zombie); %target.damage(0, %tpos, 10.0, $DamageType::Zombie);
else{ }
else {
%target.isFTD = 1; %target.isFTD = 1;
if(%target.getMountedImage($Backpackslot) !$= "") if(%target.getMountedImage($Backpackslot) !$= "") {
%target.throwPack(); %target.throwPack();
}
%target.finishingfall = schedule(5000, 0, "eval", ""@%target@".isFTD = 0; "@%target@".grabbed = 0;"); %target.finishingfall = schedule(5000, 0, "eval", ""@%target@".isFTD = 0; "@%target@".grabbed = 0;");
} }
%zombie.iscarrying = 0; %zombie.iscarrying = 0;
@ -184,5 +172,5 @@ function RkillLoop(%zombie,%target,%count){
%target.setPosition(vectoradd(%zombie.getPosition(),"0 0 -4")); %target.setPosition(vectoradd(%zombie.getPosition(),"0 0 -4"));
%target.setVelocity(%zombie.getVelocity()); %target.setVelocity(%zombie.getVelocity());
%count++; %count++;
%zombie.killingplayer = schedule(100, 0, "RkillLoop", %zombie, %target, %count); %zombie.killingplayer = %datablock.schedule(100, "zCarryLoop", %zombie, %target, %count);
} }

View file

@ -3017,7 +3017,7 @@ function Armor::onCollision(%this,%obj,%col,%forceVehicleNode)
%col.iscarrying = 1; %col.iscarrying = 1;
%obj.grabbed = 1; %obj.grabbed = 1;
%obj.damage(0, %obj.position, 0.2, $DamageType::Zombie); %obj.damage(0, %obj.position, 0.2, $DamageType::Zombie);
%col.killingPlayer = schedule(10, 0, "RkillLoop", %col, %obj, 0); %col.killingPlayer = %col.getDatablock().zCarryLoop(%col, %obj, 0); // schedule(10, 0, "RkillLoop", %col, %obj, 0);
} }
} }
else if(%colarmortype $= "ShifterZombieArmor" && %obj.Infected != 1 && %objiszomb != 1 && !%obj.rapierShield){ else if(%colarmortype $= "ShifterZombieArmor" && %obj.Infected != 1 && %objiszomb != 1 && !%obj.rapierShield){