Guest User

Untitled

a guest
Mar 16th, 2017
91
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Actor HellfireRevenant : Revenant Replaces BabelRevenant
  2. {
  3.     Obituary "%o couldn't dodge the Hellfire Revenant's fireball."
  4.     Hitobituary "%o was spooked by a Hellfire Revenant!"
  5.     Species "AAAAA" //Internal name for Revenant species, required for chain/sync system
  6.     Health 400
  7.     Radius 20
  8.     Height 56
  9.     Mass 500
  10.     Speed 12
  11.     Painchance 100
  12.     MONSTER
  13.     +FloorClip
  14.     +MissileMore
  15.     +MISSILEEVENMORE
  16.     +FastMelee
  17.     DamageFactor "SoulBurn", 0 //Lost soul afterimages use this damage type, so ensure all monsters are immune
  18.     States
  19.     {
  20.     Spawn:
  21.         /*
  22.             This is the first important part of making a monster work with Babel.
  23.             Firstly, we have ACS_NamedExecuteWithResult ("fearMonitor", 450, 550, 2, 22);
  24.                 This initiates the fear monitoring script so that the monster can register fear from various stimuli
  25.                 Arguments are:
  26.                     threshold (How much fear to enter a fear state),
  27.                     max fear (How high the meter can go),
  28.                     fallOff (rough amount of fear to lose per tic. When afraid fear is lost at 4x this rate),
  29.                     ignore chance (a percentage to have the meter halve itself and not enter fear once threshold is passed)
  30.             Secondly, we have ACS_NamedExecuteWithResult ("chainAttack", 25);
  31.                 This initiates a chain signal monitor, which will cause the monster to skip to its "Missile" state
  32.                 when a chain signal is received from another event.
  33.                 Argument is:
  34.                     chance (percentage value to jump to missile, higher means more chaining)
  35.                 If we wanted to make the monster use sync-fire instead (typically used to cause multiple monsters to
  36.                 attack at the same time) we could use ACS_NamedExecuteWithResult ("syncAttack", 25). This would cause
  37.                 the monster to jump to a "MissileNoSignal" state when a synctoken is received. Argument is the same,
  38.                 chance to succeed.
  39.         */
  40.         TNT1 A 0 Nodelay
  41.         {
  42.             ACS_NamedExecuteWithResult ("fearMonitor", 450, 550, 2, 22);
  43.             ACS_NamedExecuteWithResult ("chainAttack", 25);
  44.         }
  45.     Look:
  46.         //This ensures the monitor scripts never re-run.
  47.         GSKL AB 10 A_Look
  48.         Loop
  49.     See:
  50.         /*
  51.             These two lines remove the "Hold State" token (which prevents chaining/syncing when held) and
  52.             jump to "Fear" if the monster is holding an "Afraid" token, which is similar to HoldState but for
  53.             the fear monitor.
  54.         */
  55.         TNT1 A 0 A_TakeInventory("HoldState", 0)
  56.         TNT1 A 0 A_JumpIfInventory("Afraid", 1, "Fear")
  57.         GSKL AABBCCDDEEFF 2 A_Chase
  58.         Loop
  59.     /*
  60.         The Fear state, which is required for fear responses
  61.     */
  62.     Fear:
  63.        
  64.         GSKL AABBCCDDEEFF 2
  65.         {
  66.             //Firstly, scare the monster
  67.             A_ChangeFlag("FRIGHTENED", TRUE);
  68.             //Add a token to the monster so the fearMonitor knows the monster is afraid
  69.             A_GiveInventory ("Afraid", 1);
  70.             //Typically monsters gain 25% speed boosts (rounded up) while afraid
  71.             A_SetSpeed(13);
  72.             //And lost the ability to shoot
  73.             A_Chase("Melee", "");
  74.         }
  75.         //This will cause the monster to flee until its fear meter is empty
  76.         TNT1 A 0 A_JumpIfInventory("FearToken", 1, "Fear")
  77.        
  78.         //Once the fear meter is empty, change everything back and go to See.
  79.         TNT1 A 0
  80.         {
  81.             A_TakeInventory("FearToken", 0);
  82.             A_TakeInventory("Afraid", 0);
  83.             A_ChangeFlag("FRIGHTENED", FALSE);
  84.             A_SetSpeed(10);
  85.         }
  86.         Goto See
  87.     Melee:
  88.         GSKL G 0
  89.         GSKL G 6
  90.         {
  91.             //At the beginning of any attack, give a HoldState token so the attack won't be interrupted
  92.             A_GiveInventory("HoldState", 1);
  93.             //This token will be removed by the beginning lines of "See"
  94.             A_FaceTarget;
  95.             A_SkelWhoosh;
  96.         }
  97.         GSKL H 6 A_FaceTarget
  98.         GSKL I 6 A_CustomMeleeAttack(random(1,10)*12,"skeleton/melee","none")
  99.         Goto See
  100.     Missile:
  101.         //Generally missil attacks should check if their target is in LOS before continuing.
  102.         TNT1 A 0 A_JumpIfTargetInLOS(2)
  103.         TNT1 A 0 A_Jump(256, "See")
  104.         //If we can see our target, give a HoldState token
  105.         TNT1 A 0 A_GiveInventory("HoldState", 1)
  106.         //-------------------------------
  107.         GSKL J 0 Bright A_Jump(128,"Missile2")
  108.         GSKL J 0 Bright A_FaceTarget
  109.         GSKL J 10 Bright A_FaceTarget
  110.         GSKL K 2 A_CustomMissile("HFRevShot",64,14)
  111.         GSKL K 8 A_CustomMissile("HFRevShot",64,-14)
  112.         GSKL K 10 A_FaceTarget
  113.         //Since this monster uses chaining, before we end our attack we should give out some chain tokens
  114.         TNT1 A 0
  115.         {
  116.             A_RadiusGive ("ChainToken", 512, RGF_MONSTERS, 1, none, "AAAAA");
  117.             A_TakeInventory("ChainToken", 0);
  118.         }
  119.         Goto See
  120.     Missile2:
  121.         GSKL J 0 Bright A_FaceTarget
  122.         GSKL J 0 Bright A_PlaySound("skeleton/sight", 0)
  123.         GSKL J 10 Bright A_FaceTarget
  124.         GSKL K 10 A_CustomMissile("HFRevShot",64,-14)
  125.         GSKL J 6 A_FaceTarget
  126.         GSKL K 10 A_CustomMissile("HFRevShot",64,14)
  127.         GSKL J 6 A_FaceTarget
  128.         GSKL K 10 A_CustomMissile("HFRevShot",64,-14)
  129.         GSKL J 6 A_FaceTarget
  130.         GSKL K 10 A_CustomMissile("HFRevShot",64,14)
  131.         GSKL K 10 A_FaceTarget
  132.         //Since this monster uses chaining, before we end our attack we should give out some chain tokens
  133.         TNT1 A 0
  134.         {
  135.             A_RadiusGive ("ChainToken", 512, RGF_MONSTERS, 1, none, "AAAAA");
  136.             A_TakeInventory("ChainToken", 0);
  137.         }
  138.         Goto See
  139.     Pain:
  140.         GSKL L 5
  141.         GSKL L 5 A_Pain
  142.         //Being hurt usually causes fear, so we can manually give our monster some fear tokens here.
  143.         TNT1 A 0 A_GiveInventory("FearToken", random(0,45))
  144.         //This is not entirely necessary due to See's copy of this line, but it doesn't hurt to have just in case
  145.         TNT1 A 0 A_JumpIfInventory("Afraid", 0, "Fear")
  146.         Goto See
  147.     /*
  148.         Above the Death State should be deaths for each player damage type
  149.         Inside each of them should be any special reactions you want to have for these types
  150.         Death.Player should always contain some fear-giving action
  151.     */
  152.     Death.PlayerSSG:
  153.         //This typically contains a distance check to jump to XDeath
  154.     Death.PlayerRocket:
  155.     Death.PlayerBFG:
  156.     Death.Player:
  157.         TNT1 A 0 A_RadiusGive ("FearToken", 1024, RGF_MONSTERS, random(99,275))
  158.         TNT1 A 0 A_Jump(160, "Death")
  159.         //This skippable frame passes out Sync and Chain tokens to nearby enemies to aggro them if this monster dies
  160.         TNT1 A 0
  161.         {
  162.             A_RadiusGive ("SyncToken", 1024, RGF_MONSTERS, 1, none, "Zombie");
  163.             A_RadiusGive ("SyncToken", 1024, RGF_MONSTERS, 1, none, "Demon");
  164.             A_RadiusGive ("SyncToken", 1024, RGF_MONSTERS, 1, none, "Imp");
  165.             A_RadiusGive ("SyncToken", 1024, RGF_MONSTERS, 1, none, "Balloon");
  166.             A_RadiusGive ("ChainToken", 1024, RGF_MONSTERS, 1, none, "AAAAA");
  167.         }
  168.     Death:
  169.         GSKL LM 7
  170.         GSKL N 7 A_Scream
  171.         GSKL O 7 A_NoBlocking
  172.         GSKL P 7
  173.         GSKL Q -1
  174.         Stop
  175.     //If your monster has XDeath, ensure to add XDeath states for each Damage type as well.
  176.     //XDeath usually causes extra fear
  177.     Raise:
  178.         //When raised, we must ensure we reset our speed and re-run the monitor scripts (as they terminate on death)
  179.         TNT1 A 0
  180.         {
  181.             A_SetSpeed(10);
  182.             ACS_NamedExecuteWithResult ("fearMonitor", 450, 550, 2, 22); //threshold, maxfear, fallOff (*35 = fear drop per second), ignore chance
  183.             ACS_NamedExecuteWithResult ("chainAttack", 25); //succeed chance
  184.         }
  185.         GSKL QPONML 5
  186.         Goto See
  187.     }
  188. }
  189.  
  190. /*
  191.     And that's it! Not really that much work and it ensures that the monster will have all the advanced behaviors you want!
  192. */
  193.  
  194. ACTOR HFRevShot : FatShot
  195. {
  196.     Speed 15
  197.     Damage 8
  198.     +StrifeDamage
  199.     +SeekerMissile
  200.     Scale 0.5
  201.     States
  202.     {
  203.     Spawn:
  204.         TNT1 A 0 NoDelay ACS_NamedExecuteAlways("spawnParticles", 0, 0) //This is just a particle effect for imp-style particles
  205.         MANF AB 4 Bright A_SeekerMissile (10,5)
  206.         Loop
  207.     }
  208. }
RAW Paste Data