From a1bdad0982a61039e7228d5860754f8d5d405004 Mon Sep 17 00:00:00 2001 From: Anton Simakov <67688115+GuardianDll@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:02:58 +0200 Subject: [PATCH] port hallucinations --- .../npc_eocs/hallucination_eocs.json | 53 ++++++++++++++++--- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/data/json/effects_on_condition/npc_eocs/hallucination_eocs.json b/data/json/effects_on_condition/npc_eocs/hallucination_eocs.json index 391efaa29b690..65388180bfba5 100644 --- a/data/json/effects_on_condition/npc_eocs/hallucination_eocs.json +++ b/data/json/effects_on_condition/npc_eocs/hallucination_eocs.json @@ -44,7 +44,7 @@ { "type": "effect_on_condition", "id": "bad_hallucinations", - "effect": [ { "weighted_list_eocs": [ [ "creature_hallucinations", 20 ], [ "visuals", 10 ] ] } ] + "effect": [ { "weighted_list_eocs": [ [ "creature_hallucinations", 20 ], [ "visuals", 10 ], [ "hallucination_swarm", 4 ] ] } ] }, { "type": "effect_on_condition", @@ -98,19 +98,19 @@ { "id": "injured_talk", "condition": { "math": [ "n_hp('ALL')", "<", "n_hp_max('bp_null')" ] }, - "effect": { "u_message": "Your weapon says \"\"" }, + "effect": { "u_message": "Your says \"\"" }, "false_effect": { "run_eocs": { "id": "you_injured_talk", "//": "Weapon will be concerned for you if you're significantly injured.", "condition": { "math": [ "(u_hp('ALL') * 1.4)", "<", "u_hp_max('bp_null')" ] }, - "effect": { "u_message": "Your weapon says \"\"" }, + "effect": { "u_message": "Your says \"\"" }, "false_effect": { "run_eocs": { "id": "monsters_nearby_talk", "condition": { "and": [ "u_can_see", { "math": [ "u_monsters_nearby('radius': 10)", ">=", "1" ] } ] }, - "effect": { "u_message": "Your weapon says \"\"" }, - "false_effect": { "run_eocs": { "id": "normal_talk", "effect": { "u_message": "Your weapon says \"\"" } } } + "effect": { "u_message": "Your says \"\"" }, + "false_effect": { "run_eocs": { "id": "normal_talk", "effect": { "u_message": "Your says \"\"" } } } } } } @@ -174,10 +174,33 @@ { "type": "effect_on_condition", "id": "creature_hallucinations", + "//TODO": "ideally checks is the tile visible, and then spawns hallu where player can't see it", + "//": "If monsters are nearby, 3/4 chance to spawn some hallucinations of random monsters nearby and run again half the time, 1/4 chance to spawn some of YOUR_FEARS. If not, spawns some of YOUR_FEARS", + "//2": "avatar check to prevent NPCs from spawning hallucinations, that player can see", + "condition": { "and": [ { "math": [ "rand(3)", "<", "3" ] }, { "math": [ "u_monsters_nearby()", ">", "0" ] }, "u_is_avatar" ] }, "effect": [ - { "u_message": "You can't trust everything you see…", "type": "bad" }, - { "u_add_effect": "hallu", "duration": [ "1 hour", "3 hours" ] } - ] + { + "u_spawn_monster": "", + "hallucination_count": { "math": [ "1 + rand(4)" ] }, + "target_range": 50, + "lifespan": [ "2 hours", "9 hours" ] + }, + { "weighted_list_eocs": [ [ "creature_hallucinations", 1 ], [ "EOC_NONE", 1 ] ] } + ], + "false_effect": { "run_eocs": "creature_hallucinations_fears" } + }, + { + "type": "effect_on_condition", + "id": "creature_hallucinations_fears", + "//TODO": "ideally checks is the tile visible, and then spawns hallu where player can't see it", + "condition": "u_is_avatar", + "effect": { + "u_spawn_monster": "GROUP_YOUR_FEARS", + "group": true, + "hallucination_count": { "math": [ "1 + rand(2)" ] }, + "max_radius": 40, + "lifespan": [ "1 hours", "4 hours" ] + } }, { "type": "effect_on_condition", @@ -186,5 +209,19 @@ { "u_message": "Your vision becomes very distorted…", "type": "bad" }, { "u_add_effect": "visuals", "duration": [ 15, 60 ] } ] + }, + { + "type": "effect_on_condition", + "id": "hallucination_swarm", + "condition": { "math": [ "u_monsters_nearby()", ">", "1" ] }, + "effect": [ + { + "u_spawn_monster": "", + "hallucination_count": [ 50, 100 ], + "target_range": 50, + "max_radius": 50, + "lifespan": [ "2 hours", "9 hours" ] + } + ] } ]