Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class UACMech : Actor
- {
- Default
- {
- //$Category Monsters
- //$Title UAC-93 Combat Mech
- Health 3500;
- Radius 40;
- Height 110;
- Mass 4000;
- Speed 24;
- MaxTargetRange 8192;
- SeeSound "mech/see";
- ActiveSound "mech/active";
- DropItem "ClipBox"; DropItem "ClipBox"; DropItem "ClipBox";
- Obituary "%o was mowed down by the UAC Mech";
- Monster;
- +NoBlood;
- +Boss;
- +FloorClip;
- +MissileMore;
- +Telestomp;
- +NoPain;
- +AvoidMelee;
- }
- int bulletsfired;
- override void Tick()
- {
- Super.Tick();
- if (health <= 1200)
- {
- //If at 1200 health, turn the frightened flag on to back away more from enemies.
- bFrightened = True;
- //Increase the chance of attacking to account for above flag technically making the mech scared
- MinMissileChance = 50;
- bMissileEvenMore = True;
- }
- if (health >= 1200)
- {
- //If at more than 1200 health, turn the frightened flag off. This is in case something heals the mech.
- bFrightened = False;
- //Reset the chance of attacking to the default
- MinMissileChance = 200;
- bMissileEvenMore = False;
- }
- }
- States
- {
- Spawn:
- UACB G 8 A_LookEx (maxseedist:8192,4096);
- Loop;
- See:
- UACB ABCDEF 4 A_Chase (null,"DecideAttack");
- TNT1 A 0 A_StartSound ("spider/walk",CHAN_AUTO);
- Loop;
- DecideAttack:
- TNT1 A 0
- {
- if (Distance3D (target) > 1024) //If too far, fire the chaingun
- {
- SetStateLabel ("ChaingunFire",False);
- }
- if (Distance3D (target) < 1024) //If close enough, deploy grenades
- {
- SetStateLabel ("LaunchGrenades",False);
- }
- }
- Goto See;
- LaunchGrenades:
- TNT1 A 0 A_Jump (96,"ChaingunFire"); //May just gun you down instead.
- UACB G 6
- {//I'd add the A_Jump here, but it doesn't seem to work in anonymous functions
- if (target.pos.z - GetZAt() >= 128) //Will definitely mow you down if you are too high.
- {
- SetStateLabel ("ChaingunFire",False);
- }
- }
- UACB H 3 A_StartSound ("mech/deploy",CHAN_AUTO);
- UACB IJ 3 A_FaceTarget();
- //First grenade
- UACB K 6 Bright
- {
- A_StartSound ("gren",CHAN_AUTO);
- A_SpawnProjectile ("MechGrenade",106);
- }
- UACB J 6 A_FaceTarget();
- //Second grenade
- UACB K 6 Bright
- {
- A_StartSound ("gren",CHAN_AUTO);
- A_SpawnProjectile ("MechGrenade",106);
- }
- UACB J 6 A_FaceTarget();
- //Third grenade
- UACB K 6 Bright
- {
- A_StartSound ("gren",CHAN_AUTO);
- A_SpawnProjectile ("MechGrenade",106);
- }
- UACB J 0 A_StartSound ("mech/deploy",CHAN_AUTO);
- UACB JIG 3;
- Goto See;
- ChainGunFire:
- TNT1 A 0 //Checks if 40 or more bullets have been fired before stopping.
- {
- if (bulletsfired > 40)
- {
- bulletsfired = 0;
- SetStateLabel ("See",False);
- }
- Return;
- }
- UACB G 1
- {
- A_FaceTarget();
- }
- UACB H 1 Bright
- {
- A_CustomBulletAttack (3.0,3.0,2,3,range:8192*2);
- A_StartSound ("weapons/chngun",CHAN_AUTO);
- A_MonsterRefire (128,"AbortAttack");
- }
- UACB G 1
- {
- bulletsfired++;
- }
- Loop;
- AbortAttack:
- TNT1 A 0
- {
- bulletsfired = 0;
- }
- Goto See;
- Death:
- UACD K 4 Bright
- {
- A_NoBlocking();
- A_StartSound ("mech/explode",50,CHANF_OVERLAP,attenuation:0.7);
- A_Explode (32,96);
- }
- UACD LMNOPQRS 4;
- UACD T 4 Bright
- {
- A_StartSound ("mech/explode",50,attenuation:0.7);
- A_Explode (32,96);
- }
- UACD UVW 4 ;
- UACD XYZAB 4;
- UACD C -1;
- Stop;
- }
- }
Add Comment
Please, Sign In to add comment