Permalink
Browse files

non-ufo crash and recovery

  • Loading branch information...
Istrebitel committed Oct 9, 2017
1 parent 4fab37d commit 95a0546b22367749c1dd130023b454bfce0af684
View
Binary file not shown.
View
Binary file not shown.
View
@@ -221,26 +221,25 @@ ConfigOptionBool optionEnableAgentTemplates("OpenApoc.NewFeature", "EnableAgentT
ConfigOptionBool optionStoreDroppedEquipment("OpenApoc.NewFeature", "StoreDroppedEquipment",
"Attempt to recover agent equipment dropped in city",
true);
ConfigOptionBool optionAbsorbingVehicles("OpenApoc.NewFeature", "AbsorbingVehicles",
"Ground vehicles absorb damage dealt to roads under them",
false);
ConfigOptionBool
optionRecoverGroundVehicles("OpenApoc.NewFeature", "RecoverGroundVehicles",
"Ground vehicles crash when road dies and can be recovered", true);
ConfigOptionBool optionFallingGroundVehicles("OpenApoc.NewFeature", "CrashingGroundVehicles",
"Unsupported ground vehicles crash", true);
ConfigOptionBool optionEnforceCargoLimits("OpenApoc.NewFeature", "EnforceCargoLimits",
"Enforce vehicle cargo limits", false);
ConfigOptionBool optionAllowNearbyVehicleLootPickup("OpenApoc.NewFeature",
"AllowNearbyVehicleLootPickup",
"Allow nearby vehicles to pick up loot", true);
ConfigOptionBool optionAllowBuildingLootDeposit("OpenApoc.NewFeature", "AllowBuildingLootDeposit",
"Allow loot to be stashed in the building", true);
ConfigOptionBool optionArmoredRoads("OpenApoc.NewFeature", "ArmoredRoads", "Armored roads", false);
ConfigOptionBool optionBSKLauncherSound("OpenApoc.Mod", "BSKLauncherSound",
"(MOD) Original Brainsucker Launcher SFX", true);
ConfigOptionBool optionArmoredRoads("OpenApoc.Mod", "ArmoredRoads", "(MOD) Armored roads", false);
ConfigOptionBool optionInvulnerableRoads("OpenApoc.Mod", "InvulnerableRoads",
"(MOD) Invulnerable roads", false);
ConfigOptionBool optionATVTank("OpenApoc.Mod", "ATVTank",
"(MOD) Griffon becomes an All-Terrain Vehicle", true);
ConfigOptionBool optionATVTank("OpenApoc.Mod", "ATVTank", "(MOD) Griffon becomes All-Terrain",
true);
ConfigOptionBool optionCrashingVehicles("OpenApoc.Mod", "CrashingVehicles",
"Vehicles crash on low HP", false);
} // anonymous namespace
@@ -70,8 +70,8 @@ bool AgentTileHelper::canEnterTile(Tile *from, Tile *to, bool, bool &, float &co
}
// Agents can only move to and from scenery
sp<Scenery> sceneryFrom = from->intactScenery;
sp<Scenery> sceneryTo = to->intactScenery;
sp<Scenery> sceneryFrom = from->presentScenery;
sp<Scenery> sceneryTo = to->presentScenery;
if (!sceneryFrom || !sceneryTo)
{
return false;
@@ -116,7 +116,7 @@ bool AgentTileHelper::canEnterTile(Tile *from, Tile *to, bool, bool &, float &co
continue;
}
auto checkedTile = map.getTile(checkedPos);
sp<Scenery> checkedScenery = checkedTile->intactScenery;
sp<Scenery> checkedScenery = checkedTile->presentScenery;
if (checkedScenery &&
checkedScenery->type->tile_type == SceneryTileType::TileType::PeopleTubeJunction)
{
@@ -1,4 +1,5 @@
#include "game/state/city/scenery.h"
#include "framework/configfile.h"
#include "framework/framework.h"
#include "framework/logger.h"
#include "framework/sound.h"
@@ -65,6 +66,18 @@ bool Scenery::applyDamage(GameState &state, int power)
int damage = randDamage050150(state.rng, power);
if (type->tile_type == SceneryTileType::TileType::Road)
{
if (config().getBool("OpenApoc.Mod.InvulnerableRoads"))
{
return false;
}
if (config().getBool("OpenApoc.NewFeature.ArmoredRoads"))
{
damage -= ROAD_ARMOR;
}
}
if (damage <= type->constitution)
{
return false;
@@ -92,6 +105,18 @@ void Scenery::die(GameState &state)
if (!this->damaged && type->damagedTile)
{
this->damaged = true;
if (this->overlayDoodad)
this->overlayDoodad->remove(state);
this->overlayDoodad = nullptr;
type = type->damagedTile;
if (type->overlaySprite)
{
this->overlayDoodad =
mksp<Doodad>(this->getPosition(), type->imageOffset, false, 1, type->overlaySprite);
city->map->addObjectToMap(this->overlayDoodad);
}
// Reapply tile params
tileObject->setPosition(currentPosition);
}
else
{
@@ -8,6 +8,8 @@
namespace OpenApoc
{
static const int ROAD_ARMOR = 20;
class TileObjectScenery;
class SceneryTileType;
class Building;
@@ -41,7 +43,7 @@ class Scenery : public std::enable_shared_from_this<Scenery>
bool handleCollision(GameState &state, Collision &c);
// Returns true if sound and doodad were handled by it
bool applyDamage(GameState &state, int power);
// Handles mappart ceasing to exist (fatal damage or fell on something)
// Handles scenery ceasing to exist (fatal damage or fell on something)
void die(GameState &state);
void update(GameState &state, unsigned int ticks);
Oops, something went wrong.

0 comments on commit 95a0546

Please sign in to comment.