Advertisement
Slowhand-VI

perk_ms_test.fos

Dec 31st, 2015
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.45 KB | None | 0 0
  1. /**
  2.  *  Perk: Mysterious Stranger   -   Tests
  3.  *
  4.  *  Description: Check perk_ms_h.fos
  5.  *  Author:     Slowhand
  6.  *  Reviewer:   n/a
  7.  */
  8.  
  9. #include "perk_ms_h.fos"
  10.  
  11. #include "_defines.fos"
  12. #include "_macros.fos"
  13. #include "perk_ms.fos"
  14.  
  15.  
  16. /**< Prototype of target dummy. */
  17. #define TARGET_DUMMY_PID                (80)        //  Gecko.
  18.  
  19.  
  20. /**< Dialogue scripts */
  21.  
  22. void r_spawnTargetDummy(Critter& player, Critter@ npc)
  23. {
  24.     npc.Say(SAY_NORM, "Spawning a Target Dummy!");
  25.     Log("Spawning a Target Dummy!");
  26.     int[] params =
  27.     {
  28.         ST_TEAM_ID, 0,
  29.         ST_NPC_ROLE, 0,
  30.         ST_REPLICATION_TIME, REPLICATION_NEVER
  31.     };
  32.     Map@ map = player.GetMap();
  33.     Critter@ monster = map.AddNpc(TARGET_DUMMY_PID, player.HexX + 5, player.HexY + 5, 5, params, null, "mob@critter_init");
  34.     if(valid(monster))
  35.     {
  36.         monster.SpawnedBy = player.Id;
  37.         monster.Say(SAY_NORM, "You target dummy has arrived " + GetCritter(monster.SpawnedBy).Name + "!");
  38.     }
  39. }
  40.  
  41. void r_spawnMs(Critter& player, Critter@ npc)
  42. {
  43.     if (isMsReadyToSpawn(player.Id))
  44.     {
  45.         npc.Say(SAY_NORM, "Spawning a Mysterious Stranger!");
  46.         Log("Spawning a Mysterious Stranger!");
  47.         spawnMysteriousStranger(player.Id);
  48.     }
  49. }
  50.  
  51. void r_despawnMs(Critter& player, Critter@ npc)
  52. {
  53.     if (isMsSpawned(player.Id))
  54.     {
  55.         npc.Say(SAY_NORM, "Despawning a Mysterious Stranger!");
  56.         Log("Despawning a Mysterious Stranger!");
  57.         despawnMysteriousStranger(player.Id);
  58.     }
  59.     else
  60.     {
  61.         npc.Say(SAY_NORM, "Your Mysterious Stranger was not spawned!");
  62.         Log("Your Mysterious Stranger was not spawned!");
  63.     }
  64. }
  65.  
  66. void r_resetMsPerkVars(Critter& player, Critter@ npc)
  67. {
  68.     MS_LOG("r_addMsPerk - called from dialogue.");
  69.     givePlayerMsPerkInit(player.Id);
  70. }
  71.  
  72. void r_queryMsPerkStatus(Critter& player, Critter@ npc)
  73. {
  74.     uint playerId = player.Id;
  75.     string message = "Spawned = " + isMsSpawned(playerId)
  76.                     + ", Dead = " + isMsDead(playerId)
  77.                     + ", NormalSpawnAvail = " + isMsNormalSpawnAvailable(playerId)
  78.                     + ", MedicalSpawnAvail = " + isMsMedicalSpawnAvailable(playerId)
  79.                     + ", FirstAidAvail = " + isMsFirstAidAvailable(playerId)
  80.                     + ", DoctorAvail = " + isMsDoctorAvailable(playerId);
  81.     MS_LOG(message);
  82. }
  83.  
  84. void r_cripplePlayer(Critter& player, Critter@ npc)
  85. {
  86.     player.DamageBase[DAMAGE_EYE] = 1;
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement