Attached Files |
xtahua.patch [^] (5,716 bytes) 2014-04-21 13:12 [Show Content] [Hide Content]diff -Bwur stone_soup-0.14.0/source/l_mons.cc stone_soup-0.14.0 xtahua shelf final/source/l_mons.cc
--- stone_soup-0.14.0/source/l_mons.cc 2014-04-10 01:36:33.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/l_mons.cc 2014-04-11 23:00:11.114716400 +1000
@@ -206,7 +206,11 @@
static const char *_moneat_names[] =
{
- "nothing", "items", "corpses", "food",
+ "nothing", "items", "corpses",
+ #if TAG_MAJOR_VERSION == 34
+ "food",
+ #endif
+ "doors"
};
static const char *_moneat_to_str(mon_itemeat_type etyp)
diff -Bwur stone_soup-0.14.0/source/mon-act.cc stone_soup-0.14.0 xtahua shelf final/source/mon-act.cc
--- stone_soup-0.14.0/source/mon-act.cc 2014-04-10 01:37:00.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/mon-act.cc 2014-04-21 20:58:55.370965500 +1000
@@ -3598,7 +3598,25 @@
if (grd(f) == DNGN_CLOSED_DOOR || grd(f) == DNGN_SEALED_DOOR)
{
- if (mons_can_open_door(mons, f))
+ if (mons_can_destroy_door(mons, f))
+ {
+ grd(f) = DNGN_FLOOR;
+ set_terrain_changed(f);
+
+ if (you.see_cell(f))
+ {
+ viewwindow();
+
+ if (!you.can_see(mons))
+ {
+ mpr("The door bursts into shrapnel!");
+ interrupt_activity(AI_FORCE_INTERRUPT);
+ }
+ else
+ simple_monster_message(mons, " bursts through the door, destroying it!");
+ }
+ }
+ else if (mons_can_open_door(mons, f))
{
_mons_open_door(mons, f);
return true;
diff -Bwur stone_soup-0.14.0/source/mon-data.h stone_soup-0.14.0 xtahua shelf final/source/mon-data.h
--- stone_soup-0.14.0/source/mon-data.h 2014-04-10 01:36:33.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/mon-data.h 2014-04-11 22:24:21.215749200 +1000
@@ -123,9 +123,11 @@
gmon_eat explanation:
MONEAT_ITEMS,
MONEAT_CORPSES,
+ MONEAT_DOORS,
Monsters with MONEAT_ITEMS are capable of eating most items,
and monsters with MONEAT_CORPSES are capable of eating corpses.
+ Monsters with MONEAT_DOORS will destroy doors instead of opening them.
size:
SIZE_TINY, // rats/bats
@@ -6149,7 +6151,7 @@
{ 19, 0, 0, 133 },
15, 7, MST_NO_SPELLS, CE_CONTAMINATED, Z_NOZOMBIE, S_ROAR,
I_NORMAL, HT_LAND, FL_WINGED, 10, DEFAULT_ENERGY,
- MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_HUGE
+ MONUSE_NOTHING, MONEAT_DOORS, SIZE_HUGE
},
{
@@ -6174,7 +6176,7 @@
{ 20, 0, 0, 160 },
16, 12, MST_SERPENT_OF_HELL_GEHENNA, CE_CLEAN, Z_NOZOMBIE, S_ROAR,
I_HIGH, HT_LAND, FL_WINGED, 14, DEFAULT_ENERGY,
- MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_HUGE
+ MONUSE_NOTHING, MONEAT_DOORS, SIZE_HUGE
},
{
@@ -6187,7 +6189,7 @@
{ 20, 0, 0, 160 },
16, 12, MST_SERPENT_OF_HELL_COCYTUS, CE_CLEAN, Z_NOZOMBIE, S_ROAR,
I_HIGH, HT_LAND, FL_WINGED, 14, DEFAULT_ENERGY,
- MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_HUGE
+ MONUSE_NOTHING, MONEAT_DOORS, SIZE_HUGE
},
{
@@ -6200,7 +6202,7 @@
{ 20, 0, 0, 160 },
20, 12, MST_SERPENT_OF_HELL_DIS, CE_CLEAN, Z_NOZOMBIE, S_ROAR,
I_HIGH, HT_LAND, FL_NONE, 14, DEFAULT_ENERGY,
- MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_HUGE
+ MONUSE_NOTHING, MONEAT_DOORS, SIZE_HUGE
},
{
@@ -6213,7 +6215,7 @@
{ 20, 0, 0, 160 },
16, 12, MST_SERPENT_OF_HELL_TARTARUS, CE_CLEAN, Z_NOZOMBIE, S_ROAR,
I_HIGH, HT_LAND, FL_WINGED, 14, DEFAULT_ENERGY,
- MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_HUGE
+ MONUSE_NOTHING, MONEAT_DOORS, SIZE_HUGE
},
// "e"lves
diff -Bwur stone_soup-0.14.0/source/mon-enum.h stone_soup-0.14.0 xtahua shelf final/source/mon-enum.h
--- stone_soup-0.14.0/source/mon-enum.h 2014-04-10 01:36:33.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/mon-enum.h 2014-04-11 22:06:56.620001800 +1000
@@ -181,6 +181,7 @@
#if TAG_MAJOR_VERSION == 34
MONEAT_FOOD,
#endif
+ MONEAT_DOORS,
NUM_MONEAT
};
diff -Bwur stone_soup-0.14.0/source/mon-util.cc stone_soup-0.14.0 xtahua shelf final/source/mon-util.cc
--- stone_soup-0.14.0/source/mon-util.cc 2014-04-10 01:37:00.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/mon-util.cc 2014-04-11 22:12:49.646193700 +1000
@@ -3915,11 +3915,23 @@
return true;
}
+bool mons_can_destroy_door(const monster* mon, const coord_def& pos)
+{
+ if (mons_itemeat(mon) != MONEAT_DOORS)
+ return false;
+
+ if (env.markers.property_at(pos, MAT_ANY, "door_restrict") == "veto")
+ return false;
+
+ return true;
+}
+
static bool _mons_can_pass_door(const monster* mon, const coord_def& pos)
{
return mon->can_pass_through_feat(DNGN_FLOOR)
&& (mons_can_open_door(mon, pos)
- || mons_can_eat_door(mon, pos));
+ || mons_can_eat_door(mon, pos)
+ || mons_can_destroy_door(mon, pos));
}
bool mons_can_traverse(const monster* mon, const coord_def& p,
diff -Bwur stone_soup-0.14.0/source/mon-util.h stone_soup-0.14.0 xtahua shelf final/source/mon-util.h
--- stone_soup-0.14.0/source/mon-util.h 2014-04-10 01:36:33.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/mon-util.h 2014-04-11 23:02:47.314650500 +1000
@@ -438,6 +438,7 @@
bool mons_class_can_pass(monster_type mc, const dungeon_feature_type grid);
bool mons_can_open_door(const monster* mon, const coord_def& pos);
bool mons_can_eat_door(const monster* mon, const coord_def& pos);
+bool mons_can_destroy_door(const monster* mon, const coord_def& pos);
bool mons_can_traverse(const monster* mon, const coord_def& pos,
bool only_in_sight = false,
bool checktraps = true);
xtahua fixed tabs.patch [^] (5,779 bytes) 2014-04-21 13:18 [Show Content] [Hide Content]diff -Bwur stone_soup-0.14.0/source/l_mons.cc stone_soup-0.14.0 xtahua shelf final/source/l_mons.cc
--- stone_soup-0.14.0/source/l_mons.cc 2014-04-10 01:36:33.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/l_mons.cc 2014-04-21 21:15:13.752925700 +1000
@@ -206,7 +206,11 @@
static const char *_moneat_names[] =
{
- "nothing", "items", "corpses", "food",
+ "nothing", "items", "corpses",
+ #if TAG_MAJOR_VERSION == 34
+ "food",
+ #endif
+ "doors"
};
static const char *_moneat_to_str(mon_itemeat_type etyp)
diff -Bwur stone_soup-0.14.0/source/mon-act.cc stone_soup-0.14.0 xtahua shelf final/source/mon-act.cc
--- stone_soup-0.14.0/source/mon-act.cc 2014-04-10 01:37:00.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/mon-act.cc 2014-04-21 21:14:18.091742100 +1000
@@ -3598,7 +3598,25 @@
if (grd(f) == DNGN_CLOSED_DOOR || grd(f) == DNGN_SEALED_DOOR)
{
- if (mons_can_open_door(mons, f))
+ if (mons_can_destroy_door(mons, f))
+ {
+ grd(f) = DNGN_FLOOR;
+ set_terrain_changed(f);
+
+ if (you.see_cell(f))
+ {
+ viewwindow();
+
+ if (!you.can_see(mons))
+ {
+ mpr("The door bursts into shrapnel!");
+ interrupt_activity(AI_FORCE_INTERRUPT);
+ }
+ else
+ simple_monster_message(mons, " bursts through the door, destroying it!");
+ }
+ }
+ else if (mons_can_open_door(mons, f))
{
_mons_open_door(mons, f);
return true;
diff -Bwur stone_soup-0.14.0/source/mon-data.h stone_soup-0.14.0 xtahua shelf final/source/mon-data.h
--- stone_soup-0.14.0/source/mon-data.h 2014-04-10 01:36:33.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/mon-data.h 2014-04-21 21:15:24.239525500 +1000
@@ -123,9 +123,11 @@
gmon_eat explanation:
MONEAT_ITEMS,
MONEAT_CORPSES,
+ MONEAT_DOORS,
Monsters with MONEAT_ITEMS are capable of eating most items,
and monsters with MONEAT_CORPSES are capable of eating corpses.
+ Monsters with MONEAT_DOORS will destroy doors instead of opening them.
size:
SIZE_TINY, // rats/bats
@@ -6149,7 +6151,7 @@
{ 19, 0, 0, 133 },
15, 7, MST_NO_SPELLS, CE_CONTAMINATED, Z_NOZOMBIE, S_ROAR,
I_NORMAL, HT_LAND, FL_WINGED, 10, DEFAULT_ENERGY,
- MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_HUGE
+ MONUSE_NOTHING, MONEAT_DOORS, SIZE_HUGE
},
{
@@ -6174,7 +6176,7 @@
{ 20, 0, 0, 160 },
16, 12, MST_SERPENT_OF_HELL_GEHENNA, CE_CLEAN, Z_NOZOMBIE, S_ROAR,
I_HIGH, HT_LAND, FL_WINGED, 14, DEFAULT_ENERGY,
- MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_HUGE
+ MONUSE_NOTHING, MONEAT_DOORS, SIZE_HUGE
},
{
@@ -6187,7 +6189,7 @@
{ 20, 0, 0, 160 },
16, 12, MST_SERPENT_OF_HELL_COCYTUS, CE_CLEAN, Z_NOZOMBIE, S_ROAR,
I_HIGH, HT_LAND, FL_WINGED, 14, DEFAULT_ENERGY,
- MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_HUGE
+ MONUSE_NOTHING, MONEAT_DOORS, SIZE_HUGE
},
{
@@ -6200,7 +6202,7 @@
{ 20, 0, 0, 160 },
20, 12, MST_SERPENT_OF_HELL_DIS, CE_CLEAN, Z_NOZOMBIE, S_ROAR,
I_HIGH, HT_LAND, FL_NONE, 14, DEFAULT_ENERGY,
- MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_HUGE
+ MONUSE_NOTHING, MONEAT_DOORS, SIZE_HUGE
},
{
@@ -6213,7 +6215,7 @@
{ 20, 0, 0, 160 },
16, 12, MST_SERPENT_OF_HELL_TARTARUS, CE_CLEAN, Z_NOZOMBIE, S_ROAR,
I_HIGH, HT_LAND, FL_WINGED, 14, DEFAULT_ENERGY,
- MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_HUGE
+ MONUSE_NOTHING, MONEAT_DOORS, SIZE_HUGE
},
// "e"lves
diff -Bwur stone_soup-0.14.0/source/mon-enum.h stone_soup-0.14.0 xtahua shelf final/source/mon-enum.h
--- stone_soup-0.14.0/source/mon-enum.h 2014-04-10 01:36:33.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/mon-enum.h 2014-04-21 21:15:33.669064900 +1000
@@ -181,6 +181,7 @@
#if TAG_MAJOR_VERSION == 34
MONEAT_FOOD,
#endif
+ MONEAT_DOORS,
NUM_MONEAT
};
diff -Bwur stone_soup-0.14.0/source/mon-util.cc stone_soup-0.14.0 xtahua shelf final/source/mon-util.cc
--- stone_soup-0.14.0/source/mon-util.cc 2014-04-10 01:37:00.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/mon-util.cc 2014-04-21 21:15:44.883706300 +1000
@@ -3915,11 +3915,23 @@
return true;
}
+bool mons_can_destroy_door(const monster* mon, const coord_def& pos)
+{
+ if (mons_itemeat(mon) != MONEAT_DOORS)
+ return false;
+
+ if (env.markers.property_at(pos, MAT_ANY, "door_restrict") == "veto")
+ return false;
+
+ return true;
+}
+
static bool _mons_can_pass_door(const monster* mon, const coord_def& pos)
{
return mon->can_pass_through_feat(DNGN_FLOOR)
&& (mons_can_open_door(mon, pos)
- || mons_can_eat_door(mon, pos));
+ || mons_can_eat_door(mon, pos)
+ || mons_can_destroy_door(mon, pos));
}
bool mons_can_traverse(const monster* mon, const coord_def& p,
diff -Bwur stone_soup-0.14.0/source/mon-util.h stone_soup-0.14.0 xtahua shelf final/source/mon-util.h
--- stone_soup-0.14.0/source/mon-util.h 2014-04-10 01:36:33.000000000 +1000
+++ stone_soup-0.14.0 xtahua shelf final/source/mon-util.h 2014-04-11 23:02:47.314650500 +1000
@@ -438,6 +438,7 @@
bool mons_class_can_pass(monster_type mc, const dungeon_feature_type grid);
bool mons_can_open_door(const monster* mon, const coord_def& pos);
bool mons_can_eat_door(const monster* mon, const coord_def& pos);
+bool mons_can_destroy_door(const monster* mon, const coord_def& pos);
bool mons_can_traverse(const monster* mon, const coord_def& pos,
bool only_in_sight = false,
bool checktraps = true);
|