Autowalker now will grab healing when they need it and can grab it.

This commit is contained in:
Zed A. Shaw 2025-09-06 00:02:42 -04:00
parent 29ab9721af
commit ed33a36bca
3 changed files with 16 additions and 4 deletions

View file

@ -65,6 +65,18 @@
"no_more_items": true
}
},
{
"name": "find_healing",
"cost": 5,
"needs": {
"have_healing": false,
"in_combat": false,
"health_good": false
},
"effects": {
"health_good": true
}
},
{
"name": "use_healing",
"cost": 0,

View file

@ -22,7 +22,7 @@
{"_type": "Collision", "has": true},
{"_type": "Motion", "dx": 0, "dy": 0, "random": false},
{"_type": "EnemyConfig", "ai_script": "Enemy::actions", "ai_start_name": "Enemy::initial_state", "ai_goal_name": "Enemy::final_state"},
{"_type": "Personality", "hearing_distance": 5, "tough": false},
{"_type": "Personality", "hearing_distance": 5, "tough": true},
{"_type": "Animation", "easing": 1, "ease_rate": 0.2, "scale": 0.1, "simple": true, "frames": 10, "speed": 0.3, "stationary": false},
{"_type": "Sprite", "name": "gold_savior", "width": 256, "height": 256, "width": 256, "height": 256, "scale": 1.0},
{"_type": "Sound", "attack": "Sword_Hit_2", "death": "Humanoid_Death_1"}
@ -70,7 +70,7 @@
{"_type": "Collision", "has": true},
{"_type": "Motion", "dx": 0, "dy": 0, "random": false},
{"_type": "EnemyConfig", "ai_script": "Enemy::actions", "ai_start_name": "Enemy::initial_state", "ai_goal_name": "Enemy::final_state"},
{"_type": "Personality", "hearing_distance": 5, "tough": false},
{"_type": "Personality", "hearing_distance": 5, "tough": true},
{"_type": "Animation", "easing": 3, "ease_rate": 0.5, "scale": 0.1, "simple": true, "frames": 1, "speed": 1.0, "stationary": false},
{"_type": "Sprite", "name": "rat_with_sword", "width": 256, "height": 256, "scale": 1.0},
{"_type": "Sound", "attack": "Small_Rat", "death": "Creature_Death_1"}

View file

@ -209,8 +209,8 @@ void Autowalker::handle_player_walk(ai::State& start, ai::State& goal) {
} else if(action.name == "use_healing") {
status(L"USING HEALING");
player_use_healing();
} else if(action.name == "collect_items") {
status(L"COLLECTING ITEMS");
} else if(action.name == "collect_items" || action.name == "find_healing") {
status(action.name == "collection_items" ? L"COLLECTING ITEMS" : L"FIND HEALING");
auto paths = path_to_items();