OSDN Git Service

Add monster race parsing for reinforcement data.
authordeskull <deskull@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 6 Jun 2013 12:08:29 +0000 (12:08 +0000)
committerdeskull <deskull@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 6 Jun 2013 12:08:29 +0000 (12:08 +0000)
lib/edit/r_info.txt
src/init1.c
src/types.h

index dc39291..65dc188 100644 (file)
@@ -16384,6 +16384,7 @@ F:FORCE_SLEEP | FORCE_MAXHP | NO_CONF | NO_SLEEP | HUMAN |
 F:DROP_4D2 | DROP_1D2 | DROP_GOOD | DROP_60 | DROP_90 | ONLY_ITEM |
 F:POWERFUL |
 F:EVIL |IM_COLD | IM_POIS | IM_ACID | IM_ELEC | REGENERATE
+R:1094:5d6
 S:1_IN_4 |
 S:SCARE | CONF | TPORT | TELE_TO | S_MONSTER | DRAIN_MANA |
 S:CAUSE_3 | BO_ACID | BO_MANA | HOLD | BA_FIRE | BA_COLD |
index 2cf71db..f41bb9d 100644 (file)
@@ -2828,6 +2828,23 @@ errr parse_r_info(char *buf, header *head)
                r_ptr->next_r_idx = nextmon;
        }
 
+       /* Process 'R' for "Reinforcement" (up to six lines) */
+       else if (buf[0] == 'R')
+       {
+               int id, ds, dd;
+               /* Find the next empty blow slot (if any) */
+               for (i = 0; i < 6; i++) if (r_ptr->reinforce_id[i] == 0) break;
+
+               /* Oops, no more slots */
+               if (i == 6) return (1);
+
+               /* Scan for the values */
+               if (3 != sscanf(buf+2, "%d:%dd%d", &id, &dd, &ds)) return (1);
+               r_ptr->reinforce_id[i] = id;
+               r_ptr->reinforce_dd[i] = dd;
+               r_ptr->reinforce_ds[i] = ds;
+       }
+
        /* Process 'B' for "Blows" (up to four lines) */
        else if (buf[0] == 'B')
        {
index d07953e..4e84cc8 100644 (file)
@@ -329,6 +329,9 @@ struct monster_race
        u32b flagsr;                    /* Flags R (resistances info) */
 
        monster_blow blow[4];   /* Up to four blows per round */
+       u16b reinforce_id[6];
+       u16b reinforce_dd[6];
+       u16b reinforce_ds[6];
 
        s16b next_r_idx;
        u32b next_exp;