Expand bandage treatment effects
This commit is contained in:
@@ -652,7 +652,10 @@ Target deliverable: A small group can join a server, spawn into one biome, gathe
|
||||
- [x] Add cold exposure damage.
|
||||
- [x] Add starvation damage.
|
||||
- [x] Add dehydration damage.
|
||||
- [ ] Add treatment item.
|
||||
- [x] Add treatment item. The existing craftable `bandage` medicine item is
|
||||
now the MVP treatment item: item use reduces injury, bleeding, and sprain
|
||||
severity with a small health bump, using the existing server-authoritative
|
||||
`AgrarianUseItem` path.
|
||||
- [ ] Add death state.
|
||||
- [ ] Add respawn rules for MVP.
|
||||
- [ ] Add corpse/backpack placeholder if needed.
|
||||
|
||||
@@ -144,10 +144,11 @@ MVP item use is available through `AgrarianUseItem ItemId Quantity`. The command
|
||||
routes to the server, extracts the requested stack quantity, applies a
|
||||
whitelisted item effect, and restores the stack if the item is not usable yet.
|
||||
For the first survival loop, `food` restores hunger, `meat` restores more hunger
|
||||
but adds sickness risk because it is raw, and `bandage` reduces injury severity
|
||||
with a small health bump. This gives UI item-use work a concrete authority path
|
||||
while leaving tools, structures, and future complex consumables blocked until
|
||||
they have explicit gameplay rules.
|
||||
but adds sickness risk because it is raw, and `bandage` is the MVP treatment
|
||||
item: it reduces injury, bleeding, and sprain severity with a small health bump.
|
||||
This gives UI item-use work a concrete authority path while leaving tools,
|
||||
structures, and future complex consumables blocked until they have explicit
|
||||
gameplay rules.
|
||||
|
||||
Dedicated equipment slots are intentionally deferred for the 0.1.E MVP. The
|
||||
current `basic_tool` item can remain an inventory item until an implemented
|
||||
|
||||
@@ -33,6 +33,8 @@ EXPECTED = {
|
||||
"SurvivalComponent->AddSickness(3.0f * Quantity);",
|
||||
"ItemId == TEXT(\"bandage\")",
|
||||
"SurvivalComponent->ReduceInjury(18.0f * Quantity);",
|
||||
"SurvivalComponent->ReduceBleeding(28.0f * Quantity);",
|
||||
"SurvivalComponent->ReduceSprain(10.0f * Quantity);",
|
||||
"void AAgrarianGamePlayerController::AgrarianUseItem(FName ItemId, int32 Quantity)",
|
||||
"Usage: AgrarianUseItem <ItemId> <Quantity>",
|
||||
"void AAgrarianGamePlayerController::ServerAgrarianUseItem_Implementation",
|
||||
@@ -45,7 +47,8 @@ EXPECTED = {
|
||||
"`food` restores hunger",
|
||||
"`meat` restores more hunger",
|
||||
"adds sickness risk",
|
||||
"`bandage` reduces injury severity",
|
||||
"MVP treatment",
|
||||
"reduces injury, bleeding, and sprain severity",
|
||||
"restores the stack if the item is not usable yet",
|
||||
],
|
||||
"InventoryDataModel.md": [
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def require(path: Path, snippet: str) -> None:
|
||||
text = path.read_text(encoding="utf-8")
|
||||
if snippet not in text:
|
||||
raise SystemExit(f"{path.relative_to(ROOT)} missing {snippet!r}")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
controller = ROOT / "Source" / "AgrarianGame" / "AgrarianGamePlayerController.cpp"
|
||||
item_setup = ROOT / "Scripts" / "setup_item_definitions.py"
|
||||
item_verify = ROOT / "Scripts" / "verify_item_definitions.py"
|
||||
item_use_verify = ROOT / "Scripts" / "verify_item_use.py"
|
||||
tech_doc = ROOT / "Docs" / "TechnicalDesignDocument.md"
|
||||
roadmap = ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md"
|
||||
|
||||
require(item_setup, '"item_id": "bandage"')
|
||||
require(item_setup, "unreal.AgrarianItemType.MEDICINE")
|
||||
require(item_verify, '"DA_Item_Bandage": ("bandage", unreal.AgrarianItemType.MEDICINE)')
|
||||
require(controller, 'ItemId == TEXT("bandage")')
|
||||
require(controller, "SurvivalComponent->ReduceInjury(18.0f * Quantity);")
|
||||
require(controller, "SurvivalComponent->ReduceBleeding(28.0f * Quantity);")
|
||||
require(controller, "SurvivalComponent->ReduceSprain(10.0f * Quantity);")
|
||||
require(controller, "SurvivalComponent->RestoreHealth(4.0f * Quantity);")
|
||||
require(item_use_verify, "SurvivalComponent->ReduceBleeding(28.0f * Quantity);")
|
||||
require(item_use_verify, "SurvivalComponent->ReduceSprain(10.0f * Quantity);")
|
||||
require(tech_doc, "MVP treatment")
|
||||
require(tech_doc, "reduces injury, bleeding, and sprain severity")
|
||||
require(roadmap, "[x] Add treatment item.")
|
||||
|
||||
print("PASS: MVP treatment item is present.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -48,8 +48,10 @@ namespace
|
||||
if (ItemId == TEXT("bandage"))
|
||||
{
|
||||
SurvivalComponent->ReduceInjury(18.0f * Quantity);
|
||||
SurvivalComponent->ReduceBleeding(28.0f * Quantity);
|
||||
SurvivalComponent->ReduceSprain(10.0f * Quantity);
|
||||
SurvivalComponent->RestoreHealth(4.0f * Quantity);
|
||||
OutEffectSummary = FString::Printf(TEXT("treated %.0f injury severity"), 18.0f * Quantity);
|
||||
OutEffectSummary = FString::Printf(TEXT("treated %.0f injury, %.0f bleeding, and %.0f sprain severity"), 18.0f * Quantity, 28.0f * Quantity, 10.0f * Quantity);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user