TechOFreak

The Wake Episode 11

Nov 25th, 2020
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.22 KB | None | 0 0
  1. #include "interfaces/Map_Interface.hps"
  2. #include "base/Inputhandler_Types.hps"
  3.  
  4. #include "helpers/helper_map.hps"
  5. #include "helpers/helper_props.hps"
  6. #include "helpers/helper_effects.hps"
  7. #include "helpers/helper_audio.hps"
  8. #include "helpers/helper_imgui.hps"
  9. #include "helpers/helper_sequences.hps"
  10. #include "helpers/helper_game.hps"
  11. #include "helpers/helper_modules.hps"
  12. #include "helpers/helper_ai.hps"
  13. #include "player.hps"
  14.  
  15. #include "helpers/helper_agent.hps"
  16.  
  17. //From my Amnesia Rebirth Tutorial Series
  18. //Episode 11 Enemies! Basic Functionality!
  19. //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
  20. //-----------------------------------------------------------
  21.  
  22. class cScrMap : iScrMap
  23. {
  24.     void Setup()
  25.     {
  26.         PlayerBody_SetActive(true);
  27.         Player_SetCanRun(false);
  28.     }
  29.    
  30.     void OnStart()
  31.     {
  32.         if(cLux_ScriptDebugOn())
  33.         {
  34.         }
  35.     }
  36.  
  37.     void OnEnter()
  38.     {  
  39.         Game_AutoSave();
  40.     }
  41.  
  42.     void OnLeave()
  43.     {
  44.     }    
  45.    
  46.     void OnPlayerKilled(int alRecentDeaths, const tString&in asSource)
  47.     {
  48.     }
  49.    
  50.     bool OnDeath(const tString &in asSource)
  51.     {
  52.         cLux_AddTodoMessage("DEAD : SOURCE = " + asSource);
  53.        
  54.         if (asSource == "SomeReason")
  55.         {
  56.             Effect_Fade_Out(1.0f);
  57.             return true;
  58.         }
  59.         return false;
  60.     }
  61.  
  62.     bool OnRespawn(const tString &in asSource)
  63.     {      
  64.         return false;
  65.     }
  66.  
  67.     void OnAction(int alAction, bool abPressed)
  68.     {
  69.         if(abPressed==false) return;
  70.        
  71.         if(alAction == eAction_Test1)
  72.         {
  73.         }
  74.     }
  75.  
  76.     float DrawDebugOutput(cGuiSet @apSet,iFontData @apFont,float afY)
  77.     {
  78.         return afY;
  79.     }
  80.    
  81.     //My global variables
  82.     int storageDoorTimesInteracted = 0;
  83.    
  84.     //Our functions------------------------------------------------------------
  85.    
  86.     bool OnCollide_Player_Trigger_1(const tString &in asParent, const tString &in asChild, int alState)
  87.     {
  88.         //asParent is the name of the object that has the callback
  89.         //asChild is the name of the object that collided with the parent
  90.         if(alState == 1){
  91.             //This stuff will happen when the player enters the trigger area
  92.             cLux_AddDebugMessage("Enabling players running");
  93.             Player_SetCanRun(true);
  94.             return false;
  95.         }else{
  96.             //This stuff will happen when the player leaves trigger area
  97.             return false;
  98.         }
  99.     }
  100.  
  101.     void OnBreak_Bottle_1(const tString &in asEntity)
  102.     {
  103.         //asEntity is the name of the object that broke
  104.         cLux_AddDebugMessage("The bottle broke");
  105.     }
  106.    
  107.     void OnLookAt_Door_1(const tString &in asEntity, int alState)
  108.     {
  109.         //asEntity is the name of the object that is being looked at or not looked at
  110.         if(alState == 1){
  111.             //This stuff will happen when the player is looking at the door
  112.             cLux_AddDebugMessage("Player is looking at the door");
  113.         }else{
  114.             //This stuff will happen when the player is not looking at the door
  115.             cLux_AddDebugMessage("Player is not looking at the door");
  116.         }
  117.     }
  118.    
  119.     void OnInteract_Player_Door_1(const tString &in asEntity)
  120.     {
  121.         //asEntity is the name of the object that is being interacted with
  122.         cLux_AddDebugMessage("Player interacted with the door");
  123.         if(SwingDoor_GetLocked(asEntity)){
  124.             if(!Hint_IsGiven("Hints", "HintStorageDoor")){
  125.                 Hint_ShowHint("Hints", "HintStorageDoor", false, 1.5f, true);
  126.             }
  127.             if(storageDoorTimesInteracted > 4){
  128.                 storageDoorTimesInteracted = 0;
  129.                 Hint_RemoveFromGiven("Hints", "HintStorageDoor");
  130.             }else{
  131.                 storageDoorTimesInteracted += 1;
  132.             }
  133.         }
  134.     }
  135.    
  136.     void OnConnectionStateChange_Candle_1(const tString &in asEntity, int alState)
  137.     {
  138.         //asEntity is the name of the object that had its state changed
  139.         if(alState == 1){
  140.             //This stuff will happen when the candle is turned on
  141.             cLux_AddDebugMessage("Candle just turned on");
  142.         }
  143.         if(alState == 0){
  144.             //This stuff will happen when the candle is switching between on and off
  145.             cLux_AddDebugMessage("Candle just changed states");
  146.         }
  147.         if(alState == -1){
  148.             //This stuff will happen when the candle is turned off
  149.             cLux_AddDebugMessage("Candle just turned off");
  150.         }
  151.     }
  152.    
  153.     bool OnCollide_Player_TriggerBottomStairs(const tString &in asParent, const tString &in asChild, int alState)
  154.     {
  155.         if(alState == 1){
  156.             Map_AddTimer("Timer_HallwayGhoulSpawn", 10.0f, "OnTimer_HallwayGhoulSpawn");
  157.             return false;
  158.         }
  159.         return false;
  160.     }
  161.    
  162.     void OnTimer_HallwayGhoulSpawn(const tString &in asTimer){
  163.         Entity_SetActive("ghoul_hallway", true);
  164.         Ghoul_Mode_Set("ghoul_hallway", eGhoulMode_Hunt);
  165.         //Ghoul_SetInstantKill("ghoul_hallway", true);
  166.         Ghoul_SetSmellingActive("ghoul_hallway", false);
  167.         Ghoul_SetPlayerThrowForcedDirection("ghoul_hallway", 0);
  168.         Ghoul_SetCallback_ThrowAnimationOver("ghoul_hallway", "OnThrowFinish_GhoulHallway", true);
  169.     }
  170.    
  171.     void OnThrowFinish_GhoulHallway(){
  172.         cLux_AddDebugMessage("You got yeeted!");
  173.     }
  174.    
  175. }
Advertisement
Add Comment
Please, Sign In to add comment