1748 |
void animcb() { |
void animcb() { |
1749 |
GridPos p = get_pos(); |
GridPos p = get_pos(); |
1750 |
if (state == IGNITE || state == BURNING) { |
if (state == IGNITE || state == BURNING) { |
1751 |
// spread to neighbouring tiles |
bool spread = true; |
1752 |
if( DoubleRand(0, 1) > 0.3) ignite (move(p, NORTH)); |
if( Stone *st = GetStone( p)) { |
1753 |
if( DoubleRand(0, 1) > 0.3) ignite (move(p, EAST)); |
if( ! st->is_floating()) |
1754 |
if( DoubleRand(0, 1) > 0.3) ignite (move(p, SOUTH)); |
spread = false; // only hollow stones allow the fire to spread |
1755 |
if( DoubleRand(0, 1) > 0.3) ignite (move(p, WEST)); |
|
|
|
|
|
if( Stone *st = GetStone( p)) { // The fire has burnt away the wooden stone |
|
1756 |
string model = st->get_kind(); |
string model = st->get_kind(); |
1757 |
if( model == "st-wood1" || model == "st-wood2") |
if( model == "st-wood1" || model == "st-wood2") { |
1758 |
KillStone( p); |
KillStone( p); // The fire has burnt away the wooden stone |
1759 |
|
spread = true; |
1760 |
|
} |
1761 |
|
} |
1762 |
|
|
1763 |
|
// spread to neighbouring tiles |
1764 |
|
if( spread) { |
1765 |
|
if( DoubleRand(0, 1) > 0.3) ignite (move(p, NORTH)); |
1766 |
|
if( DoubleRand(0, 1) > 0.3) ignite (move(p, EAST)); |
1767 |
|
if( DoubleRand(0, 1) > 0.3) ignite (move(p, SOUTH)); |
1768 |
|
if( DoubleRand(0, 1) > 0.3) ignite (move(p, WEST)); |
1769 |
} |
} |
1770 |
} |
} |
1771 |
if (state == IGNITE) { |
if (state == IGNITE) { |
1802 |
} |
} |
1803 |
|
|
1804 |
void ignite( GridPos p) { |
void ignite( GridPos p) { |
1805 |
|
bool only_ignite = false; |
1806 |
|
|
1807 |
|
if( Stone *st = GetStone( p)) { |
1808 |
|
if( ! st->is_floating() && ! st->is_movable()) |
1809 |
|
return; // Stone does not allow to ignite. |
1810 |
|
if( st->is_movable()) |
1811 |
|
only_ignite = true; // only ignit burnable items |
1812 |
|
} |
1813 |
|
|
1814 |
if (Item *it = GetItem(p)) { // spread to other items |
if (Item *it = GetItem(p)) { // spread to other items |
1815 |
string model = it->get_kind(); |
string model = it->get_kind(); |
1816 |
// ignite burnable items |
// ignite burnable items |
1826 |
SetItem( p, MakeItem("it-burnable-ignited")); |
SetItem( p, MakeItem("it-burnable-ignited")); |
1827 |
//SendMessage (it, "ignite"); |
//SendMessage (it, "ignite"); |
1828 |
} |
} |
1829 |
} else { // spread on the same floor |
} else if( ! only_ignite){ // spread on the same floor (if stone allows) |
1830 |
if( Floor *fl1 = GetFloor( get_pos())) { |
if( Floor *fl1 = GetFloor( get_pos())) { |
1831 |
string model1 = fl1->get_kind(); |
string model1 = fl1->get_kind(); |
1832 |
if( Floor *fl2 = GetFloor( p)) { |
if( Floor *fl2 = GetFloor( p)) { |