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 cold exposure damage.
|
||||||
- [x] Add starvation damage.
|
- [x] Add starvation damage.
|
||||||
- [x] Add dehydration 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 death state.
|
||||||
- [ ] Add respawn rules for MVP.
|
- [ ] Add respawn rules for MVP.
|
||||||
- [ ] Add corpse/backpack placeholder if needed.
|
- [ ] 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
|
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.
|
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
|
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
|
but adds sickness risk because it is raw, and `bandage` is the MVP treatment
|
||||||
with a small health bump. This gives UI item-use work a concrete authority path
|
item: it reduces injury, bleeding, and sprain severity with a small health bump.
|
||||||
while leaving tools, structures, and future complex consumables blocked until
|
This gives UI item-use work a concrete authority path while leaving tools,
|
||||||
they have explicit gameplay rules.
|
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
|
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
|
current `basic_tool` item can remain an inventory item until an implemented
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ EXPECTED = {
|
|||||||
"SurvivalComponent->AddSickness(3.0f * Quantity);",
|
"SurvivalComponent->AddSickness(3.0f * Quantity);",
|
||||||
"ItemId == TEXT(\"bandage\")",
|
"ItemId == TEXT(\"bandage\")",
|
||||||
"SurvivalComponent->ReduceInjury(18.0f * Quantity);",
|
"SurvivalComponent->ReduceInjury(18.0f * Quantity);",
|
||||||
|
"SurvivalComponent->ReduceBleeding(28.0f * Quantity);",
|
||||||
|
"SurvivalComponent->ReduceSprain(10.0f * Quantity);",
|
||||||
"void AAgrarianGamePlayerController::AgrarianUseItem(FName ItemId, int32 Quantity)",
|
"void AAgrarianGamePlayerController::AgrarianUseItem(FName ItemId, int32 Quantity)",
|
||||||
"Usage: AgrarianUseItem <ItemId> <Quantity>",
|
"Usage: AgrarianUseItem <ItemId> <Quantity>",
|
||||||
"void AAgrarianGamePlayerController::ServerAgrarianUseItem_Implementation",
|
"void AAgrarianGamePlayerController::ServerAgrarianUseItem_Implementation",
|
||||||
@@ -45,7 +47,8 @@ EXPECTED = {
|
|||||||
"`food` restores hunger",
|
"`food` restores hunger",
|
||||||
"`meat` restores more hunger",
|
"`meat` restores more hunger",
|
||||||
"adds sickness risk",
|
"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",
|
"restores the stack if the item is not usable yet",
|
||||||
],
|
],
|
||||||
"InventoryDataModel.md": [
|
"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"))
|
if (ItemId == TEXT("bandage"))
|
||||||
{
|
{
|
||||||
SurvivalComponent->ReduceInjury(18.0f * Quantity);
|
SurvivalComponent->ReduceInjury(18.0f * Quantity);
|
||||||
|
SurvivalComponent->ReduceBleeding(28.0f * Quantity);
|
||||||
|
SurvivalComponent->ReduceSprain(10.0f * Quantity);
|
||||||
SurvivalComponent->RestoreHealth(4.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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user