Advertisement
TechOFreak

The Wake Episode 5

Nov 12th, 2020
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.05 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. //From my Amnesia Rebirth Tutorial Series
  16. //https://www.youtube.com/channel/UCHEzyhMw1EALBcJEKVJFmwA
  17. //--------------------------------------------------
  18.  
  19. /*Place any global values here. These must be const variables as they will not be saved*/
  20. /*This is also the place for enums and classes, but these should be avoided whenever possible*/
  21.  
  22. //--------------------------------------------------
  23.  
  24. class cScrMap : iScrMap
  25. {
  26.     void Setup()
  27.     {
  28.         PlayerBody_SetActive(true);
  29.         Player_SetCanRun(false);
  30.         Player_SetVertigoActive(false);
  31.     }
  32.        
  33.     void PreloadData()
  34.     {
  35.        
  36.     }
  37.    
  38.     void OnStart()
  39.     {
  40.         if(cLux_ScriptDebugOn())
  41.         {
  42.         }
  43.     }
  44.  
  45.     void OnEnter()
  46.     {  
  47.         Game_AutoSave();
  48.     }
  49.  
  50.     void OnLeave()
  51.     {
  52.     }    
  53.    
  54.     void OnPlayerKilled(int alRecentDeaths, const tString&in asSource)
  55.     {
  56.     }
  57.    
  58.     bool OnDeath(const tString &in asSource)
  59.     {
  60.         cLux_AddTodoMessage("DEAD : SOURCE = " + asSource);
  61.        
  62.         if (asSource == "SomeReason")
  63.         {
  64.             Effect_Fade_Out(1.0f);
  65.             return true;
  66.         }
  67.         return false;
  68.     }
  69.  
  70.     bool OnRespawn(const tString &in asSource)
  71.     {      
  72.         return false;
  73.     }
  74.  
  75.     void OnAction(int alAction, bool abPressed)
  76.     {
  77.         if(abPressed==false) return;
  78.        
  79.         if(alAction == eAction_Test1)
  80.         {
  81.         }
  82.     }
  83.  
  84.     float DrawDebugOutput(cGuiSet @apSet,iFontData @apFont,float afY)
  85.     {
  86.         return afY;
  87.     }
  88.    
  89.     //Our functions------------------------------------------------------------
  90.    
  91.     bool OnCollide_Player_Trigger_1(const tString &in asParent, const tString &in asChild, int alState)
  92.     {
  93.         //asParent is the name of the object that has the callback
  94.         //asChild is the name of the object that collided with the parent
  95.         if(alState == 1){
  96.             //This stuff will happen when the player enters the trigger area
  97.             cLux_AddDebugMessage("Enabling players running");
  98.             Player_SetCanRun(true);
  99.             return false;
  100.         }else{
  101.             //This stuff will happen when the player leaves trigger area
  102.             return false;
  103.         }
  104.     }
  105.    
  106.     void OnBreak_Bottle_1(const tString &in asEntity)
  107.     {
  108.         //asEntity is the name of the object that broke
  109.         cLux_AddDebugMessage("The bottle broke");
  110.     }
  111.    
  112.     void OnLookAt_Door_1(const tString &in asEntity, int alState)
  113.     {
  114.         //asEntity is the name of the object that is being looked at or not looked at
  115.         if(alState == 1){
  116.             //This stuff will happen when the player is looking at the door
  117.             cLux_AddDebugMessage("Player is looking at the door");
  118.         }else{
  119.             //This stuff will happen when the player is not looking at the door
  120.             cLux_AddDebugMessage("Player is not looking at the door");
  121.         }
  122.     }
  123.    
  124.     void OnInteract_Player_Door_1(const tString &in asEntity)
  125.     {
  126.         //asEntity is the name of the object that is being interacted with
  127.         cLux_AddDebugMessage("Player interacted with the door");
  128.     }
  129.    
  130.     void OnConnectionStateChange_Candle_1(const tString &in asEntity, int alState)
  131.     {
  132.         //asEntity is the name of the object that had its state changed
  133.         if(alState == 1){
  134.             //This stuff will happen when the candle is turned on
  135.             cLux_AddDebugMessage("Candle just turned on");
  136.         }
  137.         if(alState == 0){
  138.             //This stuff will happen when the candle is switching between on and off
  139.             cLux_AddDebugMessage("Candle just changed states");
  140.         }
  141.         if(alState == -1){
  142.             //This stuff will happen when the candle is turned off
  143.             cLux_AddDebugMessage("Candle just turned off");
  144.         }
  145.     }
  146.    
  147. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement