Advertisement
ZoriaRPG

RPG_Encounter.zlib

Jul 28th, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.76 KB | None | 0 0
  1. //Random Encounters
  2.  
  3. //NPCData->Attributes[]
  4.  
  5. const int RPG_ENEMY_STAT_IQ = 18;
  6. const int RPG_ENEMY_STAT_STR = 19;
  7. const int RPG_ENEMY_STAT_DEF = 20;
  8. const int RPG_ENEMY_STAT_SR = 21; //SPELL RESIST
  9. const int RPG_ENEMY_SPELLLIST = 22; //Flagset, or xxxxx.xxxx where every spot is a type, and the number is a spell of that type?
  10. //how best to handle this?
  11.  
  12. //this script runs whenever there is a random encounter
  13. ffc script encounter
  14. {
  15.     void run
  16.     {
  17.         int turn; //player or enemy
  18.         int encounter_data[1024]; //ptr
  19.         while(1)
  20.         {
  21.             //determine terrain type
  22.             //Draw opening anim
  23.             //draw enemy tiles
  24.            
  25.             //menus
  26.            
  27.             //do turn
  28.            
  29.             Waitframe();
  30.         }
  31.         Quit();
  32.     }
  33.     //return if there is an encounter this step
  34.     bool check
  35.     {
  36.        
  37.     }
  38.     void generate(int ptr) //ptr to encounter_data
  39.     {
  40.         //read the screen enemy list
  41.         //determine how many enemies
  42.         //determine enemy IDs
  43.         //send data to *ptr
  44.     }
  45.     //choose an action
  46.     int action(int IQ)
  47.     {
  48.         //choose an action based on enemy IQ
  49.         //run
  50.         //dodge
  51.         //parry
  52.         //defend
  53.         //cast
  54.         //attack
  55.     }
  56.     //normal attacks
  57.     void attack
  58.     {
  59.         //calculate THAC0
  60.         //if multiple party members, target one
  61.             //if monster IQ is high, roll against it for best choice
  62.                 //favour:
  63.                 //1. Weak HP players
  64.                 //2. Spellcasters
  65.         //try hitting player
  66.             //read enemy damage
  67.             //call attack anim
  68.             //advance turn
  69.     }
  70.     void attack_anim
  71.     {
  72.        
  73.     }
  74.     //cast a spell
  75.     void cast
  76.     {
  77.        
  78.     }
  79.     //player damages enemy
  80.     void takehit(int id)
  81.     {
  82.         //read enemy defences
  83.         //multiply damage as needed
  84.         //calc THAC0
  85.         //apply damage
  86.         //do visual effect
  87.         //show message
  88.     }
  89.     void draw(int id)
  90.     {
  91.         //grab the npc tile
  92.         //grab the npc size
  93.         //draw to box
  94.     }
  95.    
  96.    
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement