home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Messiah
/
data1.cab
/
Program_Executable_Files
/
messiahscripts
/
Enemies
/
SharedPain.hxx
< prev
next >
Wrap
Text File
|
1999-11-29
|
35KB
|
1,316 lines
//make sure BloodPos is set for ABSoulte Blood types
SubRoutine(Sub_BloodFx2Abs)
{
call(SetParticleSetID);
spawnparticle(fx_blood,-1,BloodPos,emptyvector,-1);
spawnparticle(fx_blood,-1,BloodPos,emptyvector,-1);
}
SubRoutine(Sub_BloodFxSprayAbs)
{
call(SetParticleSetID);
spawnparticle(fx_bloodspray,-1,BloodPos,emptyvector,-1);
}
SubRoutine(Sub_BloodFxSpurtAbs)
{
call(SetParticleSetID);
spawnparticle(fx_bloodspurt,-1,BloodPos,emptyvector,-1);
}
//no follow
SubRoutine(Sub_BloodFx2)
{
spawnparticle(fx_blood,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
}
SubRoutine(Sub_BloodFx5)
{
spawnparticle(fx_blood,0,emptyvector,emptyvector,-1);
spawnparticle(fx_blood,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
}
SubRoutine(Sub_BloodFx10)
{
spawnparticle(fx_blood,0,emptyvector,emptyvector,-1);
spawnparticle(fx_blood,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodlesser,0,emptyvector,emptyvector,-1);
}
SubRoutine(Sub_BloodFxSpray)
{
spawnparticle(fx_bloodspray,0,emptyvector,emptyvector,-1);
}
SubRoutine(Sub_BloodFxSpurt)
{
spawnparticle(fx_bloodspurt,0,emptyvector,emptyvector,-1);
}
//follow
SubRoutine(Sub_BloodFx2REL)
{
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
}
SubRoutine(Sub_BloodFx5REL)
{
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
}
SubRoutine(Sub_BloodFx10REL)
{
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
spawnparticle(fx_bloodREL,0,emptyvector,emptyvector,-1);
}
SubRoutine(Sub_BloodFxSprayREL)
{
spawnparticle(fx_bloodsprayREL,0,emptyvector,emptyvector,-1);
}
SubRoutine(Sub_BloodFxSpurtREL)
{
spawnparticle(fx_bloodspurtREL,0,emptyvector,emptyvector,-1);
}
//must be StateDead to call this
SubRoutine(Sub_LostAnyLimbsLately,float(thislimb))
{
if(vaction==CopHeadBlownOffDead)
{
scalebonematrix(4,0.001,_SXBoneAttRelative);
if(vframe<74)
{
if(vrnd<50)
{
if(vframe<24)
{
spawnparticle(fx_blood,4,emptyvector,emptyvector,-1);
spawnparticle(fx_blood,4,emptyvector,emptyvector,-1);
}
spawnparticle(fx_bloodspray,4,emptyvector,emptyvector,-1);
}
}
}
else
{
if(VSpecialFlag==_sFLAGLostALimb)
{
if(thislimb==0)
{
if(vrnd<25)
{
float(_set,thislimb,1);
}
elseif(vrnd<50)
{
float(_set,thislimb,2);
}
elseif(vrnd<75)
{
float(_set,thislimb,3);
}
elseif(vrnd<100)
{
float(_set,thislimb,4);
}
}
else
{
if(thislimb==1)
{
//right leg
scalebonematrix(20,0.001,_SXBoneAttAbsolute);
}
elseif(thislimb==2)
{
//left arm
scalebonematrix(6,0.001,_SXBoneAttAbsolute);
}
elseif(thislimb==3)
{
//left leg
scalebonematrix(16,0.001,_SXBoneAttAbsolute);
}
elseif(thislimb==4)
{
//right arm
scalebonematrix(10,0.001,_SXBoneAttAbsolute);
}
}
}
}
}
Subroutine(Sub_DieBitch)
{
state(_or,StateDead);
if(VAICon==0 && VDifficulty<_DifficultyHard)
{
direction(_or,_DIRdepossesion);
}
}
SubRoutine(Sub_CheckDeadOrDying,float(AIAbility),const(PoleDead),const(CrawlDead),const(StandDead),const(CrawlSpreadOut),const(CrawlEnergy),const(FallToCrawl),const(CrouchDead),const(ThrownDeath))
{
//tony added, becoz Perry wants the borken leg people to eventually die ..paff!
if(vaction==CopCrawlIdle)
{
call(SubtractHealth,0,DamageCrawlDamage)
}
//CrawlEnergy is how much energy you must have to enter crawling mode, or 0 if there is no crawling
if(VHealth<=CrawlEnergy&&vstate!=StateDead)
{
if(VHealth<=0)
{
call(CheckAttached,_CADropWeaponAndShells);
callsub(Sub_DieBitch);
if(vstate==StateHarpooned)
{
spawnaction(PoleDead)
//MISSING: Sound: dead
}
elseif(VState==StateCrawling)
{
if(VColSphereScale<60) //Must be crawling already
{
spawnaction(CrawlDead)
//MISSING: Sound: dead
}
else
{
spawnaction(FallToCrawl);
}
}
elseif(VState==StateCrouching || VAIState==_AIstateCowering)
{
spawnaction(CrouchDead);
}
elseif(VState==StateThrown)
{
if(ThrownDeath!=0)
{
SpawnAction(ThrownDeath);
}
else
{
spawnaction(StandDead);
}
}
else
{
spawnaction(StandDead);
//MISSING: Sound: dead
}
}
elseif(vstate!=StateCrawling&&vstate!=StateHarpooned)
{
//MISSING: Sound: hit ground because energy is low
if(AIAbility&!=_AIANoCrawl && vtrigger==_DIRhorcol && VState!=StateCrawling)
{
state(_or,StateCrawling);
call(CheckAttached,_CADropWeaponAndShells);
}
}
}
}
//using "WoundLightNoBreak" really sucks, because you can NEVER efficiently run away when you are being shot at
//especially by the machine gun ....
SubRoutine(Sub_CheckHit,float(AIAbility),const(WoundLight),const(WoundLightRun),const(WoundLightNoBreak),float(FireCount),const(PoleDead),const(WoundLightCrouch),const(ThrownForward),const(ThrownBack),const(ThrownLeft),const(ThrownRight))
{
if(vtrigger==_DIRactorbulletcol)
{
//Please note: DIRactorbulletcol can be set, even when VActorColType=0. That is because you fall, or health is restored
if(VActorColType==_COLFire||VActorColType==_COLSteam||VActorColType==_COLsingleattach||VActorColType==_COLelectricity)
{
//call(CheckAttached,_CADropWeaponAndShells);
if(VActorColType==_COLsingleattach&&vstate!=StateHarpooned)
{
if(vstate==StateAttached)
{
if(vstate==StateDead) //Already dead before this hit
{
spawnaction(PoleDead)
}
else
{
callsub(Sound_HitSmall);
}
state(_or,StateHarpooned)
state(_clr,StateExecuteAnim);
}
else
{
if(vstate!=StateDead)
{
if(vstate==StateCrawling)
{
spawnaction(CopShotCrawl);
}
else
{
spawnaction(WoundLight);
}
}
}
}
elseif(VActorColType==_COLFire)
{
if(Vstate!=StateOnFire)
{
//MISSING: AI Get waypoint
call(CheckAttached,_CADropWeaponAndShells);
state(_clr,StateExecuteAnim);
state(_or,StateOnFire)
}
if(FireCount>50)
{
float(_set,FireCount,50); //Dont set to zero, that restarts fireanimation(with only head on fire at first)
}
}
elseif(VActorColType==_COLelectricity)
{
if(Vstate!=StateElectricShock && VState!=StateThrown)
{
//MISSING: AI Get waypoint
state(_clr,StateExecuteAnim);
state(_or,StateElectricShock)
}
callsub(Sound_Steamed); //steamed should be fine
}
elseif(VActorColType==_COLSteam)
{
if(Vstate!=StateSteamed)
{
//MISSING: AI Get waypoint
if(vstate!=StateDead)
{
//Missing: play sound
}
state(_clr,StateExecuteAnim);
state(_or,StateSteamed)
}
callsub(Sound_Steamed);
}
}
else //Not mortal.
{
//MISSING: when actor is dying, it should still react to explosions(except when on harpoon), and play sounds
if(vstate!=StateDead&&vstate!=StateHarpooned&&VState!=StateOnFire&&VState!=StateSteamed&&VState!=StateCrawling)
{
if(AIAbility&!=_AIANoThrown && VTrigger==_DIRCloseToCollision && VState!=StateThrown)
{
if(VClass!=_ClassAngel)
{
if(vrnd<50)
{
sample(SFXManBlastHit1,-1);
}
else
{
sample(SFXManBlastHit2,-1);
}
}
if(VColAngle>=3584 || VColAngle<=512) //throw back
{
spawnaction(ThrownBack);
}
elseif(VColAngle>512 && VColAngle<1536) //throw left
{
spawnaction(ThrownLeft);
}
elseif(VColAngle>=1536 && VColAngle<=2560) //throw forward
{
spawnaction(ThrownForward);
}
elseif(VColAngle>2560 && VColAngle<3584) //throw right
{
spawnaction(ThrownRight);
}
call(ThrowCharacter,20,20,-1); //up, directionstrength
state(_or,StateExecuteAnim);
state(_or,StateThrown);
PrintILog("THROWN ",VColAngle); //torgeir, temp debug text
}
elseif(AIAbility&!=_AIANoCrawl && VAction!=WoundLightNoBreak && VAction!=WoundLight && VAction!=WoundLightRun && VTrigger==_DIRalive)
{
if(VHealth>0)
{
sample(SFXShotReact,-1);
}
if(VTrigger==_noDIR || VAICon!=0)
{
if(VState==StateCrouching)
{
spawnaction(WoundLightCrouch);
}
else
{
spawnaction(WoundLightNoBreak);
}
//callsub(Sound_HitSmall);
}
elseif(VTrigger==_DIRforward && VTrigger!=_DIRwalking)
{
//callsub(Sound_HitSmall);
spawnaction(WoundLightRun);
}
}
}
}
}
call(ChangeHitByFireCount,-1);
}
SubRoutine(Sub_CheckThrownFallDamage,float(FallStartAltitude),const(MaxFallAltitude))
{
vector(_settoactorpos,TmpVector);
vector(_copyy,TmpVector,SubVar1);
float(_set,SubVar2,SubVar1)
float(_sub,SubVar1,FallStartAltitude);
float(_div,SubVar1,MaxFallAltitude);
if(VTrigger!=_DIRhorcol)
{
if(SubVar1>4)
{
call(SubtractHealth,_COLFalling,50000)
callsub(Sub_DieBitch);
}
}
elseif(VState!=StateNormal)
{
if(SubVar1>2)
{
call(SubtractHealth,_COLFalling,50000)
callsub(Sub_DieBitch);
}
State(_or,StateNormal);
}
if(VTrigger==_DIRhorcol || FallStartAltitude<SubVar2)
{
float(_set,FallStartAltitude,SubVar2); //FallDamage is measured from this height.
}
}
SubRoutine(Sub_CheckFallDamage,float(AIAbility),const(LandAction),float(FallStartAltitude),const(MaxFallAltitude),const(MaxHealthLossFall),float(SubParmFallDead),const(BangHeadAction),const(FreakAction))
{
vector(_settoactorpos,SubVector1);
vector(_copyy,SubVector1,SubVar1);
float(_set,SubVar3,SubVar1)
ActorFlag(_clr,_AFLAGsignalfromparent);
if(VState!=StateJump) //might need an else for banging the head
{
float(_sub,SubVar1,FallStartAltitude);
float(_div,SubVar1,MaxFallAltitude)
if(Vtrigger!=_DIRhorcol)
{
//special code for pak weapon to avoid fall damage and to use different animation
if(VTrigger==_DIRHaveGun && VWeaponType==WeaponPak && SubVar1>0.02)
{
SpawnAction(CopPakWeaponDrift);
ActorFlag(_or,_AFLAGsignalfromparent);
float(_set,FallStartAltitude,SubVar3);
}
elseif(SubVar1>0.3)
{
spawnaction(FreakAction);
State(_clr,StateNormal);
}
if(SubVar1>4) //2 times allowed height, instant death
{
call(SubtractHealth,_COLFalling,50000)
callsub(Sub_DieBitch);
//direction(_set,_DIRdepossesion);
state(_clr,StateExecuteAnim);
spawnaction(SubParmFallDead);
CallSub(Sub_ChangeStateToNormal);
}
elseif(SubVar1>0.5)
{
//fallen for a long time
if(VAIclass!=_AIclassAngel)
{
sample(SFXLongFallReact,-1);
}
}
}
else
{
float(_set,SubVar4,0);
if(VClass==_ClassAngel && VActorFlag==_AFLAGcolfromabove)
{
float(_set,SubVar4,1);
}
if(SubVar1>0.5)
{
if(VAIclass!=_AIclassAngel)
{
sample(SFXHardLandingReact,-1);
}
}
if(SubVar4==0)
{
//MISSING: Sound: Stop the scream again
if(SubVar1>2) //2 times allowed height, instant death
{
//MISSING: sound: FallDead
call(SubtractHealth,_COLFalling,50000)
callsub(Sub_DieBitch);
//direction(_set,_DIRdepossesion);
state(_clr,StateExecuteAnim);
spawnaction(SubParmFallDead);
CallSub(Sub_ChangeStateToNormal);
}
elseif(SubVar1>1&&VClass!=_ClassAngel) //over allowed height: Break legs
{
if(AIAbility&!=_AIANoCrawl)
{
state(_or,StateCrawling)
}
state(_clr,StateExecuteAnim);
sample(SFXShotInLegReact,-1);
call(CheckAttached,_CADropWeaponAndShells);
call(SubtractHealth,_COLFalling,MaxHealthLossFall)
CallSub(Sub_ChangeStateToNormal);
}
else
{
if(SubVar1>0.5) //If falldistance >50% of maxfallheight, subtract health
{
if(SubVar1>1)
{
float(_set,SubVar1,1);
}
float(_mul,SubVar1,MaxHealthLossFall);
call(SubtractHealth,_COLFalling,SubVar1)
callsub(Sound_HitSmall);
}
if(VState!=StateNormal)
{
float(_Seti,SubVar2,VColFeetSphereBottom)
float(_mul,SubVar2,-1)
float(_add,SubVar2,70)
if(VDistToGround<SubVar2) //Same as InAirCheckGround:
{
CallSub(Sub_ChangeStateToNormal);
if(VAICon==0 && vaction!=LandAction)
{
if(VClass!=_ClassAngel)
{
if(vrnd<25)
{
sample(SFXFootStepBig1,-1);
}
elseif(vrnd<50)
{
sample(SFXFootStepBig2,-1);
}
elseif(vrnd<75)
{
sample(SFXFootStepBig3,-1);
}
else
{
sample(SFXFootStepBig4,-1);
}
}
else //VClass==_ClassAngel (this is for Bob), uses softer footstep sample
{
if(vrnd<25)
{
sample(SFXFootStepReg1,-1,75);
}
elseif(vrnd<50)
{
sample(SFXFootStepReg2,-1,75);
}
elseif(vrnd<75)
{
sample(SFXFootStepReg3,-1,75);
}
else
{
sample(SFXFootStepReg4,-1,75);
}
}
}
spawnaction(LandAction);
// call(checkconnections);
}
else
{
move(0,-4,0);
}
}
}
}
}
}
elseif(VClass!=_ClassAngel)
{
vector(_set,TmpVector,0,0,0);
float(_seti,TmpFloat,VColSphereOffsetY);
vector(_sety,TmpVector,TmpFloat);
vector(_copy,TmpVector2,TmpVector);
float(_seti,TmpFloat2,VColSphereSize);
float(_add,TmpFloat2,10); //some slack
vector(_addy,TmpVector2,TmpFloat2);
Collision(TmpVector,TmpVector2);
if(vcolflag==_DIRhorcol)
{
//PrintILog("BANGHEAD VColDistance: ",VColDistance);
vector(_settoactorpos,TmpVector);
float(_seti,TmpFloat,VColSphereSize);
vector(_addy,TmpVector,TmpFloat);
vector(_settocolpos,TmpVector2);
vector(_sub,TmpVector2,TmpVector);
vector(_copyy,TmpVector2,TmpFloat);
move(0,TmpFloat,0);
//PrintLog("BANGHEAD ColMovedDist: ",TmpFloat);
if(VState==StateBangedHead)
{
state(_clr,StateBangedHead|StateNormal);
//maybe or in statefalling?
//CallSub(Sub_ChangeStateToNormal);
if(VDistToGround<150) //torg is pulling a late night number out of his ass here
{
spawnaction(BangHeadAction);
}
}
elseif(VState==StateJump)
{
//break();
state(_or,StateBangedHead);
}
}
//MISSING: Sound: Klonk head against object
}
elseif(VClass==_ClassAngel &&VTrigger==_DIRjump && Vtrigger==_DIRhorcol)
{
Collision(0,30,0,0,50,0);
if(vcolflag==_DIRhorcol)
{
if(VState==StateBangedHead)
{
state(_clr,StateBangedHead);
CallSub(Sub_ChangeStateToNormal);
spawnaction(BangHeadAction);
}
elseif(VState==StateJump)
{
//break();
state(_or,StateBangedHead);
}
}
//MISSING: Sound: Klonk head against object
}
if(VTrigger==_DIRhorcol || FallStartAltitude<SubVar3 || Vstate==StateFlying || VState==StateGliding || VActiveTime==1)
//Delete the last two checks if you have to lose energy even if you flap before you land
{
float(_set,FallStartAltitude,SubVar3); //FallDamage is measured from this height.
}
}
//Subtract energy and handle actions
SubRoutine(Sub_Harpooned,const(FlyFront),const(WallFront),const(IdleFront),const(BurnFront),const(FlyBack),const(WallBack),const(IdleBack),const(BurnBack))
{
// SubVar1 - HitFront
float(_set,SubVar1,1); //harpooned in stomach
if(VColAngle>1024 && VColAngle<3072)
{
float(_set,SubVar1,0); //harpooned in back
}
if(VAction!=IdleFront && VAction!=IdleBack && VAction!=GENHarpoonFrontBeg) //in idle?
{
if(VAction==BurnFront || VAction==BurnBack) //burning
{
if(VState!=StateOnFire)
{
if(SubVar1==0)
{
SpawnAction(IdleBack);
}
else
{
SpawnAction(IdleFront);
}
state(_clr,StateExecuteAnim);
}
}
else
{
State(_copyparent);
if(SubVar1==0)
{
if(VState==BulletStateStuckInWall) //harpoon hit the wall yet?
{
if(VAction!=WallBack)
{
SpawnAction(WallBack);
}
}
elseif(VAction!=FlyBack)
{
spawnaction(FlyBack); //rocket forward
float(_seti,TmpFloat,VColAngle);
float(_sub,TmpFloat,2048);
Turn(0,TmpFloat,0);
}
}
else
{
if(VState==BulletStateStuckInWall) //harpoon hit the wall yet?
{
if(VAction!=WallFront)
{
SpawnAction(WallFront);
}
}
elseif(VAction!=FlyFront)
{
spawnaction(FlyFront); //rocket backwards
float(_seti,TmpFloat,VColAngle);
Turn(0,TmpFloat,0);
}
}
}
}
elseif(VState==StateOnFire) //idle & on fire?
{
state(_or,StateExecuteAnim);
if(SubVar1==0)
{
SpawnAction(BurnBack);
}
else
{
SpawnAction(BurnFront);
}
}
else
{
if(VAction==IdleFront && VAction!=GENHarpoonFrontBeg)
{
call(SearchForCloseActor,_AIclasscop|_AIclassworker|_AIclasschot|_AIclassangel|_AIclassbeast|_AIclassprost|_AIclasspimp|_AIclasspriest|_AIclassdweller|_AIclassscientist|_AIclassbarpeople|_AIclassmale|_AIclassfemale|_AIclassriotcop|_AIclassmedic|_AIclasssubgirl,256);
if(VTrigger==_DIRTempFlag)
{
SpawnAction(GENHarpoonFrontBeg);
}
}
}
float(_seti,TmpFloat,VActiveTime)
float(_and,TmpFloat,31);
if(TmpFloat==0)
{
call(SubtractHealth,_COLsingleattach,DamageOnSpear);
}
}
subroutine(Sub_Crawling,const(SubParmCrawlSpreadOut),const(SubParmFallToCrawl))
{
if(VColSphereScale>60) // || vactionlist!=SubParmCrawlSpreadOut)
{
spawnaction(SubParmFallToCrawl);
}
}
subroutine(Sub_ElectricShock,const(ElectricShock0),const(ElectricShock1))
{
if(VState==StateElectricShock)
{
if(vaction!=ElectricShock0 && vaction!=ElectricShock1)
{
spawnaction(ElectricShock0);
}
elseif(vaction==ElectricShock0)
{
float(_rnd2,tmpfloat1,100);
float(_rnd2,tmpfloat2,100);
float(_rnd2,tmpfloat3,100);
float(_sub,tmpfloat1,50);
float(_sub,tmpfloat2,50);
float(_sub,tmpfloat3,50);
vector(_setx,gactorpos,tmpfloat1);
vector(_sety,gactorpos,tmpfloat2);
vector(_setz,gactorpos,tmpfloat3);
spawnparticle(fx_impactsparks,0,gactorpos,emptyvector,-1);
}
else
{
float(_rnd2,tmpfloat1,100);
float(_rnd2,tmpfloat2,100);
float(_rnd2,tmpfloat3,100);
float(_sub,tmpfloat1,50);
float(_sub,tmpfloat2,50);
float(_sub,tmpfloat3,50);
vector(_setx,gactorpos,tmpfloat1);
vector(_sety,gactorpos,tmpfloat2);
vector(_setz,gactorpos,tmpfloat3);
spawnparticle(fx_impactsparks,0,gactorpos,emptyvector,-1);
}
}
}
subroutine(Sub_BurnedSteamedBlind,const(SubVarBurningRollOnFloor),const(SubVarBurnedIdle),const(SubVarGettingBurned),const(SubVarBlindForward),const(SubVarBlindBackwards),const(SubVarBurningRunInCircle),const(SubVarSlowGetUpFace),float(SubSteamCounter),const(IdleAction))
{
if(VState==StateOnFire)
{
call(SubtractHealth,_COLfire,DamageInsideFire)
if(vtrigger==_DIRactorbulletcol&&VActorColType==_COLfire) //Still inside the fire??
{
if(vaction!=SubVarGettingBurned && vaction!=SubVarBlindForward && vaction!=SubVarBlindBackwards)
{
spawnaction(SubVarGettingBurned);
}
//MISSING: AI must control him when inside fire - give waypoint to the outside, and make him run he has been there after a little while
}
else //Not inside fire any more
{
if(vaicon!=0) //When computer has control of character, run and fall
{
if(vaction!=SubVarBurningRunInCircle && vaction!=SubVarBurningRollOnFloor)
{
spawnaction(SubVarBurningRunInCircle);
}
elseif(vframe==20 && vaction==SubVarBurningRollOnFloor)
{
state(_change,StateOnFire,StateBlind);
}
}
else //The player controls him
{
if(vaction!=SubVarBurnedIdle && vaction!=SubVarBlindForward && vaction!=SubVarBlindBackwards)
{
spawnaction(SubVarBurnedIdle);
}
}
}
}
else //Steamed or Blind
{
if(vtrigger==_DIRactorbulletcol&&VActorColType==_COLSteam)
{
float(_set,SubSteamCounter,DamageSteamDuration);
if(vaicon!=0)
{
//MISSING: Control using AI here while inside steam
if(vaction!=SubVarGettingBurned&&vaction!=SubVarBlindForward&&vaction!=SubVarBlindBackwards)
{
spawnaction(SubVarGettingBurned);
}
}
else
{
if(vaction!=SubVarGettingBurned&&vaction!=SubVarBlindForward&&vaction!=SubVarBlindBackwards)
{
spawnaction(SubVarGettingBurned);
}
}
}
else
{
//if this is here character is useless after being hit once by steam, not very player friendly
// if(vstate==StateSteamed)
// {
// state(_change,StateSteamed,StateBlind)
// }
if(vaicon!=0)
{
//MISSING: Decent AI to control him around when he is steamed. This also used for when he is crawling
if(vtrigger==_DIRhorcol)
{
if(VColAngle>=3584 || VColAngle<=512) //throw back
{
turn(0,-5,0);
}
elseif(VColAngle>512 && VColAngle<1536) //throw left
{
turn(0,5,0);
}
elseif(VColAngle>=1536 && VColAngle<=2560) //throw forward
{
turn(0,5,0);
}
elseif(VColAngle>2560 && VColAngle<3584) //throw right
{
turn(0,-5,0);
}
}
Direction(_clr,_DIRwalking);
Direction(_set,_DIRforward);
}
if(vstate!=StateSteamed || SubSteamCounter!=0)
{
if(vaction!=SubVarBurnedIdle&&vaction!=SubVarBlindForward&&vaction!=SubVarBlindBackwards&&vaction!=SubVarSlowGetUpFace&&vaction!=SubVarBurningRollOnFloor)
{
spawnaction(SubVarBurnedIdle);
}
}
}
if(VState==StateSteamed)
{
if(SubSteamCounter==0)
{
State(_clr,StateSteamed);
SpawnAction(IdleAction);
}
else
{
float(_sub,SubSteamCounter,1);
}
}
call(SubtractHealth,_COLSteam,DamageInsideSteam) //you're basicly dying?
}
}
//type 0 : full body
//type 1 : both hands
//type 2 : left leg
//type 3 : right arm
//type 4 : torso
//type 5 : shoulders up
// spawnparticle(fx_actorfire,1,EmptyVector,EmptyVector,-1);
// spawnparticle(fx_actorfire,3,EmptyVector,EmptyVector,-1);
// spawnparticle(fx_actorfire,6,EmptyVector,EmptyVector,-1);
// spawnparticle(fx_actorfire,7,EmptyVector,EmptyVector,-1);
// spawnparticle(fx_actorfire,16,EmptyVector,EmptyVector,-1);
// spawnparticle(fx_actorfire,18,EmptyVector,EmptyVector,-1);
// spawnparticle(fx_actorfire,22,EmptyVector,EmptyVector,-1);
SubRoutine(Sub_ActorSmokeHands)
{
//hands
if(ActorSmokeCount<190)
{
spawnparticle(fx_actorsmoke,8,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,12,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,8,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,12,EmptyVector,EmptyVector,fx_sub);
}
}
SubRoutine(Sub_ActorSmokeLeftLeg)
{
//lower leg
if(ActorSmokeCount<185)
{
spawnparticle(fx_actorsmoke,16,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,17,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,18,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,16,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,17,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,18,EmptyVector,EmptyVector,fx_sub);
}
}
SubRoutine(Sub_ActorSmokeRightArm)
{
//lower arms
if(ActorSmokeCount<215)
{
spawnparticle(fx_actorsmoke,11,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,12,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,11,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,12,EmptyVector,EmptyVector,fx_sub);
}
}
SubRoutine(Sub_ActorSmokeTorso)
{
//collar and chest
if(ActorSmokeCount<225)
{
spawnparticle(fx_actorsmoke,1,EmptyVector,EmptyVector, fx_add);
spawnparticle(fx_actorsmoke,3,EmptyVector,EmptyVector, fx_sub);
spawnparticle(fx_actorsmoke,6,EmptyVector,EmptyVector, fx_add);
spawnparticle(fx_actorsmoke,7,EmptyVector,EmptyVector, fx_sub);
spawnparticle(fx_actorsmoke,16,EmptyVector,EmptyVector,fx_add);
}
}
SubRoutine(Sub_ActorSmokeShouldersUp)
{
//neck and head and torso
if(ActorSmokeCount<255)
{
spawnparticle(fx_actorsmoke,5,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,9,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,5,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,9,EmptyVector,EmptyVector,fx_sub);
}
}
SubRoutine(Sub_ActorSmokeFullBody)
{
//hands
if(ActorSmokeCount<190)
{
spawnparticle(fx_actorsmoke,8,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,12,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,8,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,12,EmptyVector,EmptyVector,fx_sub);
}
//lower arms
if(ActorSmokeCount<215)
{
spawnparticle(fx_actorsmoke,11,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,11,EmptyVector,EmptyVector,fx_sub);
}
//upper arms
if(ActorSmokeCount<130)
{
spawnparticle(fx_actorsmoke,10,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,10,EmptyVector,EmptyVector,fx_add);
}
//collar and chest
if(ActorSmokeCount<225)
{
spawnparticle(fx_actorsmoke,5,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,9,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,13,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,14,EmptyVector,EmptyVector,fx_add);
}
//neck and head and torso
if(ActorSmokeCount<255)
{
spawnparticle(fx_actorsmoke,4,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,2,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,4,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,2,EmptyVector,EmptyVector,fx_sub);
}
//upper thigh
if(ActorSmokeCount<165)
{
spawnparticle(fx_actorsmoke,15,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,19,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,15,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,19,EmptyVector,EmptyVector,fx_sub);
}
//lower leg
if(ActorSmokeCount<185)
{
spawnparticle(fx_actorsmoke,17,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,21,EmptyVector,EmptyVector,fx_add);
spawnparticle(fx_actorsmoke,17,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,21,EmptyVector,EmptyVector,fx_sub);
}
//feet
if(ActorSmokeCount<195)
{
spawnparticle(fx_actorsmoke,18,EmptyVector,EmptyVector,fx_sub);
spawnparticle(fx_actorsmoke,22,EmptyVector,EmptyVector,fx_sub);
}
}
SubRoutine(Sub_ActorSmokeEffect,float(SubParmSmokeCount),float(lifespan)) //Body is smoking
{
//SubParmSmokeCount - Counter that starts at zero,
float(_add,SubParmSmokeCount,1);
float(_set,ActorSmokeCount,SubParmSmokeCount);
callsub(Sub_ActorSmokeFullBody);
/*
if(ActorFireType<=20)
{
callsub(Sub_ActorSmokeFullBody);
}
elseif(ActorFireType<=30)
{
callsub(Sub_ActorSmokeLeftLeg);
}
elseif(ActorFireType<=40)
{
callsub(Sub_ActorSmokeRightArm);
}
elseif(ActorFireType<=50)
{
callsub(Sub_ActorSmokeHands);
}
elseif(ActorFireType<=60)
{
callsub(Sub_ActorSmokeTorso);
}
else
{
callsub(Sub_ActorSmokeShouldersUp);
}
*/
}
SubRoutine(Sub_ActorFireRightArm)
{
//lower arms
if(ActorFireCount>4)
{
spawnparticle(fx_actorfire,11,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,12,EmptyVector,EmptyVector,-1);
}
}
SubRoutine(Sub_ActorFireHands)
{
//hands
if(ActorFireCount>4)
{
spawnparticle(fx_actorfire,8,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,12,EmptyVector,EmptyVector,-1);
}
}
SubRoutine(Sub_ActorFireTorso)
{
//collar and chest
if(ActorFireCount>4)
{
spawnparticle(fx_actorfire,1,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,3,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,6,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,7,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,16,EmptyVector,EmptyVector,-1);
}
}
SubRoutine(Sub_ActorFireShouldersUp)
{
//neck and head and torso
if(ActorFireCount>4)
{
spawnparticle(fx_actorfire,5,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,9,EmptyVector,EmptyVector,-1);
}
}
SubRoutine(Sub_ActorFireLeftLeg)
{
//lower leg
if(ActorFireCount>12)
{
spawnparticle(fx_actorfire,16,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,17,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,18,EmptyVector,EmptyVector,-1);
}
}
SubRoutine(Sub_ActorFireFullBody)
{
//hands
if(ActorFireCount>4)
{
spawnparticle(fx_actorfire,8,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,12,EmptyVector,EmptyVector,-1);
}
//lower arms
if(ActorFireCount>8)
{
spawnparticle(fx_actorfire,11,EmptyVector,EmptyVector,-1);
}
//upper arms
if(ActorFireCount>12)
{
spawnparticle(fx_actorfire,10,EmptyVector,EmptyVector,-1);
}
//neck and head and torso
if(ActorFireCount>18)
{
spawnparticle(fx_actorfire,4,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,2,EmptyVector,EmptyVector,-1);
}
//collar and chest
if(ActorFireCount>23)
{
spawnparticle(fx_actorfire,5,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,9,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,13,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,14,EmptyVector,EmptyVector,-1);
}
//upper thigh
if(ActorFireCount>30)
{
spawnparticle(fx_actorfire,15,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,19,EmptyVector,EmptyVector,-1);
}
//lower thigh
if(ActorFireCount>35)
{
spawnparticle(fx_actorfire,20,EmptyVector,EmptyVector,-1);
}
//lower leg
if(ActorFireCount>40)
{
spawnparticle(fx_actorfire,17,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,21,EmptyVector,EmptyVector,-1);
}
//feet
if(ActorFireCount>50)
{
spawnparticle(fx_actorfire,18,EmptyVector,EmptyVector,-1);
spawnparticle(fx_actorfire,22,EmptyVector,EmptyVector,-1);
}
}
SubRoutine(Sub_ActorFireEffect,float(SubParmSmokeCount),float(SubParmFireCount),float(lifespan)) //Put his body on fire
{
float(_set,SubParmSmokeCount,0);
call(ModelAmbient,-4,-7,-7);
if(vrnd<50) //firelightflag>=5)
{
vector(_set,tmpvector,255,32,16);
SpawnLight(fire_light,0,emptyvector,tmpvector,EmptyVector,400);
//float(_set,firelightflag,0);
}
//float(_add,firelightflag,1);
float(_set,TmpFloat,SubParmFireCount)
float(_and,TmpFloat,31); //Speed for how often it must subtract energy
if(TmpFloat==0)
{
call(SubtractHealth,_COLfire,DamageOnFire)
}
float(_add,SubParmFireCount,1);
float(_set,ActorFireCount,SubParmFireCount);
callsub(Sub_ActorFireFullBody);
/*
if(ActorFireType<=20)
{
callsub(Sub_ActorFireFullBody);
}
elseif(ActorFireType<=30)
{
callsub(Sub_ActorFireLeftLeg);
}
elseif(ActorFireType<=40)
{
callsub(Sub_ActorFireRightArm);
}
elseif(ActorFireType<=50)
{
callsub(Sub_ActorFireHands);
}
elseif(ActorFireType<=60)
{
callsub(Sub_ActorFireTorso);
}
else
{
callsub(Sub_ActorFireShouldersUp);
}
*/
if(SubParmFireCount>lifespan) //The fire must stop automatically if the character cant do it by himself.
{
if(VState==StateHarpooned||VState==StateCrawling||VState==StateDead||VAICon==0)
{
state(_change,StateOnFire,StateBlind)
float(_set,SubParmFireCount,0)
}
}
}
SubRoutine(Sub_SqueezeCheck,const(CrushAction));
{
if(VTrigger==_DIRalive && VActorFlag==_AFLAGSqueeze)
{
state(_set,StateDead);
Direction(_clr,_DIRalive);
spawnaction(CrushAction);
if(VAICon!=0)
{
sample(SFXWorkerCrushed2,Gactorpos);
}
}
}