Skip to content

Commit

Permalink
Oojo (#35)
Browse files Browse the repository at this point in the history
* ppokp

* Update parrot.dm
  • Loading branch information
Ben10Omintrix authored Nov 15, 2023
1 parent a10d198 commit 2396609
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 16 deletions.
6 changes: 0 additions & 6 deletions code/datums/components/listen_and_repeat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@
RegisterSignal(parent, COMSIG_MOVABLE_PRE_HEAR, PROC_REF(on_hear))
RegisterSignal(parent, COMSIG_NEEDS_NEW_PHRASE, PROC_REF(set_new_blackboard_phrase))
RegisterSignal(parent, COMSIG_LIVING_WRITE_MEMORY, PROC_REF(on_write_memory))
RegisterSignal(parent, COMSIG_MOB_LOGIN, PROC_REF(on_login))

/// Called if a client logs in- don't want to be forced speaking while under their control (sadly)
/datum/component/listen_and_repeat/proc/on_login(datum/source)
SIGNAL_HANDLER
qdel(src)

/// Called when we hear something.
/datum/component/listen_and_repeat/proc/on_hear(datum/source, list/passed_arguments)
Expand Down
13 changes: 7 additions & 6 deletions code/datums/diseases/parrotpossession.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
bypasses_immunity = TRUE //2spook
///chance we speak
var/speak_chance = 5
///list of words we can use
var/list/speech_list = null
///controller we speak from
var/datum/ai_controller/basic_controller/parrot_controller


/datum/disease/parrot_possession/stage_act(seconds_per_tick, times_fired)
. = ..()

if(!.)
if(!. || isnull(parrot_controller))
return

if(LAZYLEN(speech_list) && SPT_PROB(speak_chance, seconds_per_tick)) // I'm not going to dive into polycode trying to adjust that probability. Enjoy doubled ghost parrot speach
affected_mob.say(pick(speech_list), forced = "parrot possession")
if(SPT_PROB(speak_chance, seconds_per_tick) && !isnull(parrot_controller.blackboard[BB_PARROT_REPEAT_STRING])) // I'm not going to dive into polycode trying to adjust that probability. Enjoy doubled ghost parrot speach
affected_mob.say(parrot_controller.blackboard[BB_PARROT_REPEAT_STRING], forced = "parrot possession")


/datum/disease/parrot_possession/cure()
Expand All @@ -35,10 +35,11 @@
UnregisterSignal(inside_parrot, list(COMSIG_PREQDELETED, COMSIG_MOVABLE_MOVED))
inside_parrot.forceMove(affected_mob.drop_location())
affected_mob.visible_message(span_danger("[inside_parrot] is violently driven out of [affected_mob]!"), span_userdanger("[inside_parrot] bursts out of your chest!"))
parrot_controller = null
return ..()

/datum/disease/parrot_possession/proc/set_parrot(mob/living/parrot)
speech_list = parrot.ai_controller?.blackboard[BB_EXPORTABLE_STRING_BUFFER_LIST]
parrot_controller = parrot.ai_controller
RegisterSignals(parrot, list(COMSIG_PREQDELETED, COMSIG_MOVABLE_MOVED), PROC_REF(on_parrot_exit))

/datum/disease/parrot_possession/proc/on_parrot_exit(datum/source)
Expand Down
7 changes: 7 additions & 0 deletions code/modules/mob/living/basic/pets/parrot/parrot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list(
RegisterSignal(src, COMSIG_MOB_CLICKON, PROC_REF(on_click))
RegisterSignal(src, COMSIG_ATOM_ATTACKBY, PROC_REF(on_attacked)) // this means we could have a peaceful interaction, like getting a cracker
RegisterSignal(src, COMSIG_ATOM_WAS_ATTACKED, PROC_REF(on_injured)) // this means we got hurt and it's go time
RegisterSignal(src, COMSIG_KB_MOB_DROPITEM_DOWN, PROC_REF(drop_item_on_signal))

/mob/living/basic/parrot/Destroy()
// should have cleaned these up on death, but let's be super safe in case that didn't happen
Expand Down Expand Up @@ -399,3 +400,9 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list(

/mob/living/basic/parrot/proc/tamed()
new /obj/effect/temp_visual/heart(drop_location())

/mob/living/basic/parrot/proc/drop_item_on_signal(mob/living/user)
SIGNAL_HANDLER

drop_held_item()
return COMSIG_KB_ACTIVATED
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
return ..()

///subtree to steal items
/datum/ai_planning_subtree/hoard_items
var/theft_chance = 5

/datum/ai_planning_subtree/hoard_items/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick)
var/mob/living/living_pawn = controller.pawn

Expand All @@ -45,8 +48,11 @@
controller.queue_behavior(/datum/ai_behavior/basic_melee_attack/interact_once, BB_HOARD_ITEM_TARGET, BB_TARGETING_STRATEGY)
return SUBTREE_RETURN_FINISH_PLANNING

if(!SPT_PROB(theft_chance, seconds_per_tick))
return
controller.queue_behavior(/datum/ai_behavior/find_and_set/hoard_item, BB_HOARD_ITEM_TARGET)

/datum/ai_behavior/find_and_set/hoard_location

/datum/ai_behavior/find_and_set/hoard_location/search_tactic(datum/ai_controller/controller, locate_path, search_range)
for(var/turf/open/candidate in oview(search_range, controller.pawn))
Expand Down Expand Up @@ -215,7 +221,7 @@
///subtree to possess humans
/datum/ai_planning_subtree/possess_humans
///chance we go possess humans
var/possess_chance = 2
var/possess_chance = 80

/datum/ai_planning_subtree/possess_humans/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick)
var/mob/living/living_pawn = controller.pawn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
operational_datums = list(/datum/component/listen_and_repeat)

/datum/ai_planning_subtree/parrot_as_in_repeat/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick)
if(!SPT_PROB(controller.blackboard[BB_PARROT_REPEAT_PROBABILITY], seconds_per_tick))
return

var/atom/speaking_pawn = controller.pawn

var/switch_up_probability = controller.blackboard[BB_PARROT_PHRASE_CHANGE_PROBABILITY]
if(SPT_PROB(switch_up_probability, seconds_per_tick) || isnull(controller.blackboard[BB_PARROT_REPEAT_STRING]))
if(SEND_SIGNAL(speaking_pawn, COMSIG_NEEDS_NEW_PHRASE) & NO_NEW_PHRASE_AVAILABLE)
return

if(!SPT_PROB(controller.blackboard[BB_PARROT_REPEAT_PROBABILITY], seconds_per_tick))
return

var/potential_string = controller.blackboard[BB_PARROT_REPEAT_STRING]
if(isnull(potential_string))
stack_trace("Parrot As In Repeat Subtree somehow is getting a null potential string while not getting `NO_NEW_PHRASE_AVAILABLE`!")
Expand Down
6 changes: 6 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79508.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
author: "Ben10Omintrix"
delete-after: True
changes:
- refactor: "gutlunches have been refactored into basic mobs. please report any bugs"
- rscadd: "ashwalkers have a small ranch they can manage"
- bugfix: "wall tearer compnent wont runtime when interacting with mineral walls"
6 changes: 6 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79521.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
author: "MTandi"
delete-after: True
changes:
- bugfix: "fixed pipe painter not applying pipe color properly"
- qol: "made spraycans work also as pipe painters"
- qol: "spraycans now have basic color presets for quick selection"
10 changes: 10 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79564.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
author: "larentoun"
delete-after: True
changes:
- qol: "Gunpoint: Examining the target will show who is holding them at gunpoint"
- qol: "Gunpoint: Examining the shooter will show who they are holding at gunpoint"
- balance: "Gunpoint: If the target tries to grab, they will trigger the shot"
- balance: "Gunpoint: If the target or the shooter are shoved, it will cancel the gunpoint"
- balance: "Gunpoint: If the target is pulled, it will cancel the gunpoint"
- balance: "Both the target and the shooter can't be bumped anymore to avoid cheesing charged shot or removing the gunpoint by just moving around"
- bugfix: "Clicking the alert button of the shooter will now correctly remove gunpoint"
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79592.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "SethLafuente"
delete-after: True
changes:
- bugfix: "fixes half-covering glassware protecting eyes from chemicals"
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79615.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "san7890"
delete-after: True
changes:
- bugfix: "Gorillas and Regal Rats will no longer show up in the ghost-control menu if they died without anyone ever taking control of them."
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79656.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "1393F"
delete-after: True
changes:
- bugfix: "The Sleeping Carp scroll no longer says deflect using throw mode."
5 changes: 5 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79665.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
author: "MTandi"
delete-after: True
changes:
- image: "Crates got new sprites"
- image: "Added more crate styles"
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79667.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "distributivgesetz"
delete-after: True
changes:
- code_imp: "Atoms no longer break again after they are hit when broken, making them hopefully more stable in the future."
5 changes: 5 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79677.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
author: "Danny Boy"
delete-after: True
changes:
- bugfix: "Fixed Signer eyebrow raising/lowering indicators and emotes"
- bugfix: "Fixed Signer RuneChat punctuation"
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79681.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "OrionTheFox"
delete-after: True
changes:
- image: "Resprites the Reactive Anomaly Armor"
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79685.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Danny Boy"
delete-after: True
changes:
- bugfix: "Signers no longer sign with their species' tongue"
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79689.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Majkl-J"
delete-after: True
changes:
- bugfix: "You can now eject blank IDs from modular computers"
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-79696.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Rhials"
delete-after: True
changes:
- bugfix: "The full mining lockers in the Lavaland Mafia map have been replaced with (empty) mining carts."

0 comments on commit 2396609

Please sign in to comment.