Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

medikit: add load/save

Add needed code to save and load medikit info(in save game and ruleset)
  • Loading branch information...
commit efba43a7d1585be40a6e83b0ddbb2c44cabe9199 1 parent bae828a
Guillaume Chevallereau authored
Showing with 46 additions and 0 deletions.
  1. +40 −0 src/Ruleset/RuleItem.cpp
  2. +6 −0 src/Savegame/BattleItem.cpp
View
40 src/Ruleset/RuleItem.cpp
@@ -176,6 +176,38 @@ void RuleItem::load(const YAML::Node &node)
{
i.second() >> _invHeight;
}
+ else if (key == "painKiller")
+ {
+ i.second() >> _painKiller;
+ }
+ else if (key == "heal")
+ {
+ i.second() >> _heal;
+ }
+ else if (key == "stimulant")
+ {
+ i.second() >> _stimulant;
+ }
+ else if (key == "healAmount")
+ {
+ i.second() >> _healAmount;
+ }
+ else if (key == "healthAmount")
+ {
+ i.second() >> _healthAmount;
+ }
+ else if (key == "stun")
+ {
+ i.second() >> _stun;
+ }
+ else if (key == "energy")
+ {
+ i.second() >> _energy;
+ }
+ else if (key == "tuMedikit")
+ {
+ i.second() >> _tuMedikit;
+ }
}
}
@@ -216,6 +248,14 @@ void RuleItem::save(YAML::Emitter &out) const
out << YAML::Key << "waypoint" << YAML::Value << _waypoint;
out << YAML::Key << "invWidth" << YAML::Value << _invWidth;
out << YAML::Key << "invHeight" << YAML::Value << _invHeight;
+ out << YAML::Key << "painKiller" << YAML::Value << _painKiller;
+ out << YAML::Key << "heal" << YAML::Value << _heal;
+ out << YAML::Key << "stimulant" << YAML::Value << _stimulant;
+ out << YAML::Key << "healAmount" << YAML::Value << _healAmount;
+ out << YAML::Key << "healthAmount" << YAML::Value << _healthAmount;
+ out << YAML::Key << "stun" << YAML::Value << _stun;
+ out << YAML::Key << "energy" << YAML::Value << _energy;
+ out << YAML::Key << "tuMedikit" << YAML::Value << _tuMedikit;
out << YAML::EndMap;
}
View
6 src/Savegame/BattleItem.cpp
@@ -60,6 +60,9 @@ void BattleItem::load(const YAML::Node &node)
node["inventoryX"] >> _inventoryX;
node["inventoryY"] >> _inventoryY;
node["ammoqty"] >> _ammoQuantity;
+ node["painKiller"] >> _painKiller;
+ node["heal"] >> _heal;
+ node["stimulant"] >> _stimulant;
}
/**
@@ -109,6 +112,9 @@ void BattleItem::save(YAML::Emitter &out) const
out << YAML::Key << "ammoItem" << YAML::Value << -1;
}
+ out << YAML::Key << "painKiller" << YAML::Value << _painKiller;
+ out << YAML::Key << "heal" << YAML::Value << _heal;
+ out << YAML::Key << "stimulant" << YAML::Value << _stimulant;
out << YAML::EndMap;
}
Please sign in to comment.
Something went wrong with that request. Please try again.