Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Random Encounters
- //NPCData->Attributes[]
- const int RPG_ENEMY_STAT_IQ = 18;
- const int RPG_ENEMY_STAT_STR = 19;
- const int RPG_ENEMY_STAT_DEF = 20;
- const int RPG_ENEMY_STAT_SR = 21; //SPELL RESIST
- 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?
- //how best to handle this?
- //this script runs whenever there is a random encounter
- ffc script encounter
- {
- void run
- {
- int turn; //player or enemy
- int encounter_data[1024]; //ptr
- while(1)
- {
- //determine terrain type
- //Draw opening anim
- //draw enemy tiles
- //menus
- //do turn
- Waitframe();
- }
- Quit();
- }
- //return if there is an encounter this step
- bool check
- {
- }
- void generate(int ptr) //ptr to encounter_data
- {
- //read the screen enemy list
- //determine how many enemies
- //determine enemy IDs
- //send data to *ptr
- }
- //choose an action
- int action(int IQ)
- {
- //choose an action based on enemy IQ
- //run
- //dodge
- //parry
- //defend
- //cast
- //attack
- }
- //normal attacks
- void attack
- {
- //calculate THAC0
- //if multiple party members, target one
- //if monster IQ is high, roll against it for best choice
- //favour:
- //1. Weak HP players
- //2. Spellcasters
- //try hitting player
- //read enemy damage
- //call attack anim
- //advance turn
- }
- void attack_anim
- {
- }
- //cast a spell
- void cast
- {
- }
- //player damages enemy
- void takehit(int id)
- {
- //read enemy defences
- //multiply damage as needed
- //calc THAC0
- //apply damage
- //do visual effect
- //show message
- }
- void draw(int id)
- {
- //grab the npc tile
- //grab the npc size
- //draw to box
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement