Allow customizing how much food a waterfall takes
This commit is contained in:
@@ -195,7 +195,9 @@ a boat to the space (for example) just north of a spot of terrain with this prop
|
||||
are sucked through to the space south of it. There is a screaming noise and they lose some
|
||||
food. Extra 1 specifies the direction of suction (the example above is for a south
|
||||
waterfall). The choice of Cave/Surface determines whether the Cave Lore or Woodsman trait
|
||||
is checked for to reduce the food lost.</li>
|
||||
is checked for to reduce the food lost. Extra 2 specifies how much food they lose as a
|
||||
percentage of their total food, and Extra 3 places a hard cap on how much food they
|
||||
lose.</li>
|
||||
<li><b>Conveyor belt -</b> This space is a conveyor belt, which moves everything on it in
|
||||
the indicated direction. Extra 1 specifies the direction it pushes in.</li>
|
||||
<li><b>Blocked to Monsters -</b>Monsters will never walk into a space of this type. Extra
|
||||
|
||||
@@ -15,8 +15,8 @@ Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Percentage of food lost
|
||||
Percentage of food lost
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
|
||||
@@ -15,8 +15,8 @@ Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Max food lost
|
||||
Max food lost
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
|
||||
@@ -2802,15 +2802,14 @@ static void run_waterfalls(short mode){ // mode 0 - town, 1 - outdoors
|
||||
print_buf();
|
||||
if(wilderness_lore_present(coord_to_ter(x - dir_x_dif[dir], y - dir_y_dif[dir]) > 0) && get_ran(1,0,1) == 0)
|
||||
add_string_to_buf(" (No supplies lost.)");
|
||||
else if(univ.party.food > 1800){
|
||||
// TODO: Shouldn't this check n instead of univ.party.food?
|
||||
add_string_to_buf(" (Many supplies lost.)");
|
||||
univ.party.food -= 50;
|
||||
}
|
||||
else {
|
||||
int n = univ.party.food;
|
||||
univ.party.food = (univ.party.food * 19) / 20;
|
||||
add_string_to_buf(" (" + std::to_string(n - univ.party.food) + " supplies lost.)");
|
||||
cTerrain& ter = univ.scenario.ter_types[coord_to_ter(x, y)];
|
||||
int lost = univ.party.food * ter.flag2 / 100;
|
||||
if(lost >= ter.flag3) {
|
||||
lost = ter.flag3;
|
||||
add_string_to_buf(" (Many supplies lost.)");
|
||||
} else add_string_to_buf(" (" + std::to_string(lost) + " supplies lost.)");
|
||||
univ.party.food -= lost;
|
||||
}
|
||||
put_pc_screen();
|
||||
play_sound(28);
|
||||
|
||||
@@ -221,7 +221,8 @@ void cTerrain::append(legacy::terrain_type_type& old){
|
||||
case 15:
|
||||
special = eTerSpec::WATERFALL_CAVE;
|
||||
flag1 = DIR_S;
|
||||
flag3 = 0;
|
||||
flag2 = 5;
|
||||
flag3 = 90;
|
||||
break;
|
||||
case 16:
|
||||
special = eTerSpec::CONVEYOR;
|
||||
|
||||
Reference in New Issue
Block a user