M1d: creatures, hunting, weapons, food buffs and the hide cloak
- Rabbits, deer and boars with procedural meshes and animated legs, a state machine (idle/wander/flee/charge/dead) and heightmap steering that avoids water, cliffs, the world edge, trees and buildings - Spawner keeps a habitat-based budget around the player (6/4/3) - Melee needs a weapon or tool (club, spear, axe, pickaxe); box sweep hits - Wooden spear (thrust or throw) and crude bow with draw-scaled arrows; projectiles stick in the world as saved pickups - Carcasses: E to butcher for meat, hide and embedded arrows - Boars charge and gore when hit; hurt flash and a brief healing pause - Cooked meat gives Well fed (faster stamina and healing); buffs saved - Hide cloak: wear for warmth, saved, goes in the grave on death - Feathers as meadow pickups (appended, existing save ids unchanged) - New test_creatures_combat suite; run_all.sh gets a per-suite time limit
This commit is contained in:
@@ -21,6 +21,8 @@ var _chest_grid: GridContainer
|
||||
var _chest_title: Label
|
||||
var _recipe_list: VBoxContainer
|
||||
var _station_label: Label
|
||||
var _worn_label: Label
|
||||
var _worn_btn: Button
|
||||
var _cursor = null ## stack held on the mouse
|
||||
var _cursor_view: Control
|
||||
var _cursor_icon: TextureRect
|
||||
@@ -73,6 +75,19 @@ func bind(p: CharacterBody3D) -> void:
|
||||
pass
|
||||
pv.add_child(grid)
|
||||
pv.add_child(UITheme.label("Row 1 is your hotbar. Shift-click moves stacks to/from a chest.", 13, UITheme.TEXT_DIM))
|
||||
var wr := HBoxContainer.new()
|
||||
wr.add_theme_constant_override("separation", 10)
|
||||
_worn_label = UITheme.label("", 15)
|
||||
wr.add_child(_worn_label)
|
||||
_worn_btn = Button.new()
|
||||
_worn_btn.text = "Take off"
|
||||
_worn_btn.focus_mode = Control.FOCUS_NONE
|
||||
_worn_btn.pressed.connect(func():
|
||||
Actions.take_off(player)
|
||||
_refresh())
|
||||
wr.add_child(_worn_btn)
|
||||
pv.add_child(wr)
|
||||
player.worn_changed.connect(_refresh)
|
||||
pp.add_child(pv)
|
||||
row.add_child(pp)
|
||||
|
||||
@@ -203,6 +218,8 @@ func _refresh() -> void:
|
||||
if _cursor != null:
|
||||
_cursor_icon.texture = ItemDB.icon(_cursor.id)
|
||||
_cursor_count.text = str(_cursor.count) if _cursor.count > 1 else ""
|
||||
_worn_label.text = "Wearing: %s" % (ItemDB.item_name(player.worn) if not player.worn.is_empty() else "nothing")
|
||||
_worn_btn.visible = not player.worn.is_empty()
|
||||
_rebuild_recipes()
|
||||
|
||||
func _rebuild_recipes() -> void:
|
||||
|
||||
Reference in New Issue
Block a user