Advertisement
TechOFreak

Episode 39 Functions

Apr 14th, 2021
1,187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. //From my Amnesia Rebirth Tutorial Series
  2. //Episode 39 Randomness Pt.2!
  3. //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
  4. //-----------------------------------------------------------
  5.  
  6. bool RandomChance(int percentChance){
  7.     int randomNumber = cMath_RandRectl(1, 100);
  8.     if(randomNumber <= percentChance){
  9.         return true;
  10.     }
  11.     return false;
  12. }
  13.    
  14. SwingDoor_SetLocked("door_1", RandomChance(50), true);
  15.    
  16. Map_AddTimer("Timer_HallwayGhoulSpawn", cMath_RandRectf(1.0, 15.0), "OnTimer_HallwayGhoulSpawn");
  17.    
  18. Entity_SetActive("ghoul_hallway", RandomChance(50));
  19.  
  20. Entity_AddForce("bottle_1", cMath_RandRectVector3f(cVector3f(-10000.0f, 0.0f, -10000.0f), cVector3f(10000.0f, 10000.0f, 10000.0f)), false, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement