Skip to content

Commit

Permalink
pAI clothing (god is dead and i killed him) (#5719)
Browse files Browse the repository at this point in the history
## About The Pull Request
title

you can select clothing from a list using the verb, swaps your shell for
it
second verb undoes this

currently the prebuilt list is just a grey skirt and a maid outfit as i
couldn't really think of anything specific to add

using clothing on the pAI mob itself "uploads" the clothing
the pAI can imitate the last clothing uploaded to them, this imitation
just copies the sprite and has no real defense values or abilities

you cannot change your shell while being held, this saves a couple of
potential headaches
using the clothing in-hand will open the pAI card menu (by passing
attack_self to the stored pAI card)
changing your shell shares the same 2 second cooldown that folding and
unfolding does as a "special action"

**locally tested but i'd rather this be testmerged once the prior pr
#5700 is merged in-case anyone manages to break something i did not
foresee**

## Why It's Good For The Game
~~it's not~~

pretty harmless addition that makes carrying around your pAI more fun

## Changelog
:cl:
add: pAIs can now change their shell into clothing items
/:cl:
  • Loading branch information
timothyteakettle committed Jul 17, 2023
1 parent 062dd60 commit 6477339
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 10 deletions.
23 changes: 23 additions & 0 deletions code/modules/mob/living/silicon/pai/defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,29 @@
else if(istype(W, /obj/item/card/id) && idaccessible == 0)
to_chat(user, "<span class='notice'>[src] is not accepting access modifcations at this time.</span>")
return
else if(istype(W, /obj/item/clothing))
var/obj/item/clothing/C = W
if(C.slot_flags & SLOT_HEAD)
base_uploaded_path = /obj/item/clothing/head
if(C.slot_flags & SLOT_ICLOTHING)
base_uploaded_path = /obj/item/clothing/under
if(C.slot_flags & SLOT_EYES)
base_uploaded_path = /obj/item/clothing/glasses
if(C.slot_flags & SLOT_GLOVES)
base_uploaded_path = /obj/item/clothing/gloves
if(C.slot_flags & SLOT_MASK)
base_uploaded_path = /obj/item/clothing/mask
if(C.slot_flags & SLOT_FEET)
base_uploaded_path = /obj/item/clothing/shoes
if(C.slot_flags & SLOT_OCLOTHING)
base_uploaded_path = /obj/item/clothing/suit
last_uploaded_path = W.type

var/obj/item/clothing/under/U = C
if(istype(U))
uploaded_snowflake_worn_state = U.snowflake_worn_state

return
else
. = ..()

Expand Down
25 changes: 22 additions & 3 deletions code/modules/mob/living/silicon/pai/mobility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@
..()

/mob/living/silicon/pai/proc/close_up()
last_special = world.time + 20

// we can't close up if already inside our shell
if(src.loc == shell)
return

// we check mobility here to stop people folding up if they currently cannot move
if(!CHECK_MOBILITY(src, MOBILITY_CAN_MOVE))
return

if(!can_action())
return

last_special = world.time + 20

release_vore_contents()

stop_pulling()
Expand Down Expand Up @@ -101,9 +108,21 @@
// space movement (we get one ion burst every 3 seconds)
/mob/living/silicon/pai/Process_Spacemove(movement_dir = NONE)
. = ..()
if(!.)
if(!. && src.loc != shell)
if(world.time >= last_space_movement + 30)
last_space_movement = world.time
// place an effect for the movement
new /obj/effect/temp_visual/pai_ion_burst(get_turf(src))
return TRUE

/mob/living/silicon/pai/proc/can_change_shell()
if(istype(src.loc, /mob))
to_chat(src, "<span class='notice'>You're not able to change your shell while being held.</span>")
return FALSE
if(stat != CONSCIOUS)
return FALSE
if(!can_action())
return FALSE
if(!CHECK_MOBILITY(src, MOBILITY_CAN_MOVE))
return FALSE
return TRUE
40 changes: 33 additions & 7 deletions code/modules/mob/living/silicon/pai/pai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@
"Canine" = list("yaps","barks","woofs"),
)

// shell transformation
var/global/list/possible_clothing_options = list(
"Maid Costume" = /obj/item/clothing/under/dress/maid/sexy,
"Grey Pleated Skirt" = /obj/item/clothing/under/color/grey_skirt,
"Last Uploaded Clothing" = null,
)
var/obj/item/clothing/last_uploaded_path
var/obj/item/clothing/base_uploaded_path
var/uploaded_snowflake_worn_state

/// The cable we produce and use when door or camera jacking.
var/obj/item/pai_cable/cable

Expand Down Expand Up @@ -207,13 +217,7 @@
people_eaten = min(1, new_people_eaten)

// changing the shell
/mob/living/silicon/pai/proc/switch_shell(var/obj/item/new_shell)
// we're on cooldown or we are dead
if(!can_action())
return FALSE

last_special = world.time + 20

/mob/living/silicon/pai/proc/switch_shell(obj/item/new_shell)
// setup transform text
if(istype(new_shell, /obj/item/paicard))
transform_component.to_object_text = "neatly folds inwards, compacting down to a rectangular card"
Expand All @@ -235,3 +239,25 @@
set_resting(FALSE)
update_mobility()
remove_verb(src, /mob/living/silicon/pai/proc/pai_nom)

// pass attack self on to the card regardless of our shell
if(!istype(new_shell, /obj/item/paicard))
RegisterSignal(shell, COMSIG_ITEM_ATTACK_SELF, .proc/pass_attack_self_to_card)

// changing the shell into clothing
/mob/living/silicon/pai/proc/change_shell_by_path(object_path)
if(!can_change_shell())
return FALSE

last_special = world.time + 20

var/obj/item/new_object = new object_path
new_object.name = src.name
new_object.desc = src.desc
new_object.forceMove(src.loc)
switch_shell(new_object)
return TRUE

/mob/living/silicon/pai/proc/pass_attack_self_to_card()
if(istype(shell.loc, /mob/living/carbon))
card.attack_self(shell.loc)
41 changes: 41 additions & 0 deletions code/modules/mob/living/silicon/pai/verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,44 @@
if (stat != CONSCIOUS)
return
return feed_grabbed_to_self(src,T)

/mob/living/silicon/pai/verb/change_shell_clothing()
set name = "pAI Clothing"
set category = "pAI Commands"
set desc = "Allows you to transform your shell into clothing."

if(!can_change_shell())
return

var/clothing_entry = input(usr, "What clothing would you like to change your shell to?") as null|anything in possible_clothing_options
if(clothing_entry)
if(clothing_entry != "Last Uploaded Clothing")
change_shell_by_path(possible_clothing_options[clothing_entry])
else
if(last_uploaded_path && can_change_shell())
last_special = world.time + 20
var/state = initial(last_uploaded_path.icon_state)
var/icon = initial(last_uploaded_path.icon)
var/obj/item/clothing/new_clothing = new base_uploaded_path
new_clothing.forceMove(src.loc)
new_clothing.name = src.name
new_clothing.desc = src.desc
new_clothing.icon = icon
new_clothing.icon_state = state

var/obj/item/clothing/under/U = new_clothing
if(istype(U))
U.snowflake_worn_state = uploaded_snowflake_worn_state

switch_shell(new_clothing)

/mob/living/silicon/pai/verb/revert_shell_to_card()
set name = "Reset Shell"
set category = "pAI Commands"
set desc = "Reverts your shell back to card form."

if(!can_change_shell())
return
if(!card || card.loc != src || card == shell)
return
switch_shell(card)

0 comments on commit 6477339

Please sign in to comment.