From 145934868a1f27270c7fc1c265f8301c7d37a7a3 Mon Sep 17 00:00:00 2001 From: dwasint <82520990+dwasint@users.noreply.github.com> Date: Sat, 23 Sep 2023 03:40:53 -0400 Subject: [PATCH] more fixes --- .../code/game/objects/items/choice_beacon.dm | 26 +++++++++++++++++-- .../donator/code/item/choice_beacon.dm | 2 +- .../code/modules/donator/code/mob/pets.dm | 4 +-- .../ghost_players/arena/arena_cleanser.dm | 2 +- .../ghost_players/arena/fight_button.dm | 18 +++++++++++++ 5 files changed, 46 insertions(+), 6 deletions(-) diff --git a/monkestation/code/game/objects/items/choice_beacon.dm b/monkestation/code/game/objects/items/choice_beacon.dm index bc97dab0ce48..3fd143d547c2 100644 --- a/monkestation/code/game/objects/items/choice_beacon.dm +++ b/monkestation/code/game/objects/items/choice_beacon.dm @@ -6,6 +6,14 @@ company_message = span_bold("Pet request received. Your friend is on the way.") var/default_name = "Stinko" + var/static/list/pet_commands = list( + /datum/pet_command/idle, + /datum/pet_command/free, + /datum/pet_command/follow, + /datum/pet_command/point_targetting/fetch, + /datum/pet_command/play_dead, + ) + /obj/item/choice_beacon/pet/generate_display_names() var/static/list/pet_list if(!pet_list) @@ -20,8 +28,8 @@ /mob/living/simple_animal/parrot, /mob/living/basic/butterfly, /mob/living/basic/bee/friendly, - /mob/living/simple_animal/crab, - /mob/living/simple_animal/crab/spycrab, + /mob/living/basic/crab, + /mob/living/basic/crab/spycrab, /mob/living/basic/pet/penguin/baby, /mob/living/basic/pet/fox, /mob/living/simple_animal/pet/cat, @@ -63,6 +71,20 @@ your_pet.name = name your_pet.real_name = name + if(isbasicmob(your_pet)) + var/mob/living/basic/pet = your_pet + pet.befriend(user) + var/datum/component/obeys_commands/checking = pet.GetComponent(/datum/component/obeys_commands) + if(!checking) + pet.AddComponent(/datum/component/obeys_commands, pet_commands) + + var/list/new_planning_subtree = list() + new_planning_subtree |= /datum/ai_planning_subtree/pet_planning + + for(var/datum/ai_planning_subtree/listed_tree as anything in pet.ai_controller.planning_subtrees) + new_planning_subtree |= listed_tree.type + pet.ai_controller.replace_planning_subtrees(new_planning_subtree) + new /obj/effect/pod_landingzone(get_turf(src), pod) uses-- diff --git a/monkestation/code/modules/donator/code/item/choice_beacon.dm b/monkestation/code/modules/donator/code/item/choice_beacon.dm index 1db42a11514b..2cb436d538f2 100644 --- a/monkestation/code/modules/donator/code/item/choice_beacon.dm +++ b/monkestation/code/modules/donator/code/item/choice_beacon.dm @@ -27,7 +27,7 @@ default_name = "Spy Crab" company_source = "Mann Co." company_message = "Prepare for infiltrator deployment." - donator_pet = /mob/living/simple_animal/crab/spycrab + donator_pet = /mob/living/basic/crab/spycrab /obj/item/choice_beacon/pet/donator/void_mothroach name = "Secret Beacon of the Stars" diff --git a/monkestation/code/modules/donator/code/mob/pets.dm b/monkestation/code/modules/donator/code/mob/pets.dm index 7773898f6426..19d2ad1c9188 100644 --- a/monkestation/code/modules/donator/code/mob/pets.dm +++ b/monkestation/code/modules/donator/code/mob/pets.dm @@ -11,7 +11,7 @@ head_icon = 'monkestation/code/modules/donator/icons/mob/pets_held.dmi' gold_core_spawnable = NO_SPAWN -/mob/living/simple_animal/crab/spycrab +/mob/living/basic/crab/spycrab name = "spy crab" desc = "hon hon hon" icon = 'monkestation/code/modules/donator/icons/mob/pets.dmi' @@ -20,7 +20,7 @@ icon_dead = "crab_dead" gold_core_spawnable = NO_SPAWN -/mob/living/simple_animal/crab/spycrab/Initialize(mapload) +/mob/living/basic/crab/spycrab/Initialize(mapload) . = ..() var/random_icon = pick("crab_red","crab_blue") icon_state = random_icon diff --git a/monkestation/code/modules/ghost_players/arena/arena_cleanser.dm b/monkestation/code/modules/ghost_players/arena/arena_cleanser.dm index 2ed4e905caf7..cff675b03693 100644 --- a/monkestation/code/modules/ghost_players/arena/arena_cleanser.dm +++ b/monkestation/code/modules/ghost_players/arena/arena_cleanser.dm @@ -23,7 +23,7 @@ var/room_width = 17 var/room_height = 10 -/obj/effect/spawner/random_bar/New() +/obj/effect/spawner/random_arena_spawner/New() if(!isnull(SSmapping.random_arena_spawners)) SSmapping.random_arena_spawners += src diff --git a/monkestation/code/modules/ghost_players/arena/fight_button.dm b/monkestation/code/modules/ghost_players/arena/fight_button.dm index 74b8752b3671..04260ce5a3d7 100644 --- a/monkestation/code/modules/ghost_players/arena/fight_button.dm +++ b/monkestation/code/modules/ghost_players/arena/fight_button.dm @@ -30,6 +30,13 @@ /obj/structure/fight_button/Initialize(mapload) . = ..() update_maptext() + register_context() + +/obj/structure/fight_button/add_context(atom/source, list/context, obj/item/held_item, mob/user) + . = ..() + context[SCREENTIP_CONTEXT_LMB] = "Join Duel" + context[SCREENTIP_CONTEXT_RMB] = "Leave Duel" + return CONTEXTUAL_SCREENTIP_SET /obj/structure/fight_button/proc/update_maptext() var/string = "Player One:[player_one ? "[player_one.real_name]" : "No One"] \n Player Two:[player_two ? "[player_two.real_name]" : "No One"] \n Weapon of Choice: [initial(weapon_of_choice.name)]\n Wager: [payout]" @@ -67,6 +74,17 @@ update_maptext() addtimer(CALLBACK(src, PROC_REF(prep_round)), 5 SECONDS) + +/obj/structure/fight_button/attack_hand_secondary(mob/user, list/modifiers) + . = ..() + if(user == player_one) + break_off_game() + player_one = null + + else if(user == player_two) + player_two.linked_button = null + player_two = null + /obj/structure/fight_button/proc/remove_user(mob/living/carbon/human/ghost/vanisher) if(player_one == vanisher) break_off_game()