mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 05:27:01 +01:00
Verb cleanup (#22224)
* Verb cleanup * rest of the object verbs * little more object cleanup * more changes * last of it * this too * tgui * code review * time to go
This commit is contained in:
@@ -241,8 +241,7 @@
|
||||
//for more info on why this is not atom/pull, see examinate() in mob.dm
|
||||
/mob/living/verb/pulled(atom/movable/AM as mob|obj in oview(1))
|
||||
set name = "Pull"
|
||||
set category = "Object"
|
||||
|
||||
set category = null
|
||||
if(istype(AM) && Adjacent(AM))
|
||||
start_pulling(AM, show_message = TRUE)
|
||||
else
|
||||
|
||||
@@ -75,12 +75,17 @@
|
||||
var/current_pda_messaging = null
|
||||
var/custom_sprite = FALSE
|
||||
var/slowdown = 0
|
||||
var/speech_state = "Robotic" // Needed for TGUI shit
|
||||
|
||||
/mob/living/silicon/pai/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
if(istype(loc, /obj/item/paicard))
|
||||
card = loc
|
||||
else
|
||||
card = new(get_turf(src))
|
||||
forceMove(card)
|
||||
card.setPersonality(src)
|
||||
|
||||
if(card)
|
||||
faction = card.faction.Copy()
|
||||
@@ -98,9 +103,8 @@
|
||||
add_language("Gutter")
|
||||
add_language("Trinary")
|
||||
|
||||
//Verbs for pAI mobile form, chassis and Say flavor text
|
||||
verbs += /mob/living/silicon/pai/proc/choose_chassis
|
||||
verbs += /mob/living/silicon/pai/proc/choose_verbs
|
||||
AddSpell(new /obj/effect/proc_holder/spell/access_software_pai)
|
||||
AddSpell(new /obj/effect/proc_holder/spell/unfold_chassis_pai)
|
||||
|
||||
//PDA
|
||||
pda = new(src)
|
||||
@@ -233,27 +237,27 @@
|
||||
// mobile pai mob. This also includes handling some of the general shit that can occur
|
||||
// to it. Really this deserves its own file, but for the moment it can sit here. ~ Z
|
||||
|
||||
/mob/living/silicon/pai/verb/fold_out()
|
||||
set category = "pAI Commands"
|
||||
set name = "Unfold Chassis"
|
||||
/obj/effect/proc_holder/spell/unfold_chassis_pai
|
||||
name = "Unfold/Fold Chassis"
|
||||
desc = "Allows you to fold in/out of your mobile form."
|
||||
clothes_req = FALSE
|
||||
base_cooldown = 20 SECONDS
|
||||
action_icon_state = "repairbot"
|
||||
action_background_icon_state = "bg_tech_blue"
|
||||
|
||||
if(stat || IsSleeping() || IsParalyzed() || IsWeakened())
|
||||
return
|
||||
/obj/effect/proc_holder/spell/unfold_chassis_pai/create_new_targeting()
|
||||
return new /datum/spell_targeting/self
|
||||
|
||||
if(loc != card)
|
||||
to_chat(src, "<span class='warning'>You are already in your mobile form!</span>")
|
||||
return
|
||||
/obj/effect/proc_holder/spell/unfold_chassis_pai/cast(list/targets, mob/living/user = usr)
|
||||
var/mob/living/silicon/pai/pai_user = user
|
||||
|
||||
if(world.time <= last_special)
|
||||
to_chat(src, "<span class='warning'>You must wait before folding your chassis out again!</span>")
|
||||
return
|
||||
if(pai_user.loc != pai_user.card)
|
||||
pai_user.close_up()
|
||||
return TRUE
|
||||
pai_user.force_fold_out()
|
||||
|
||||
last_special = world.time + 200
|
||||
|
||||
//I'm not sure how much of this is necessary, but I would rather avoid issues.
|
||||
force_fold_out()
|
||||
|
||||
visible_message("<span class='notice'>[src] folds outwards, expanding into a mobile form.</span>", "<span class='notice'>You fold outwards, expanding into a mobile form.</span>")
|
||||
pai_user.visible_message("<span class='notice'>[pai_user] folds outwards, expanding into a mobile form.</span>", "<span class='notice'>You fold outwards, expanding into a mobile form.</span>")
|
||||
return TRUE
|
||||
|
||||
/mob/living/silicon/pai/proc/force_fold_out()
|
||||
if(ismob(card.loc))
|
||||
@@ -268,73 +272,6 @@
|
||||
card.forceMove(src)
|
||||
card.screen_loc = null
|
||||
|
||||
/mob/living/silicon/pai/verb/fold_up()
|
||||
set category = "pAI Commands"
|
||||
set name = "Collapse Chassis"
|
||||
|
||||
if(stat || IsSleeping() || IsParalyzed() || IsWeakened())
|
||||
return
|
||||
|
||||
if(loc == card)
|
||||
to_chat(src, "<span class='warning'>You are already in your card form!</span>")
|
||||
return
|
||||
|
||||
if(world.time <= last_special)
|
||||
to_chat(src, "<span class='warning'>You must wait before returning to your card form!</span>")
|
||||
return
|
||||
|
||||
close_up()
|
||||
|
||||
/mob/living/silicon/pai/proc/choose_chassis()
|
||||
set category = "pAI Commands"
|
||||
set name = "Choose Chassis"
|
||||
|
||||
var/list/my_choices = list()
|
||||
var/choice
|
||||
var/finalized = "No"
|
||||
|
||||
//check for custom_sprite
|
||||
if(!custom_sprite)
|
||||
if(ckey in GLOB.configuration.custom_sprites.pai_holoform_ckeys)
|
||||
custom_sprite = TRUE
|
||||
my_choices["Custom"] = "[ckey]-pai"
|
||||
|
||||
my_choices = possible_chassis.Copy()
|
||||
if(custom_sprite)
|
||||
my_choices["Custom"] = "[ckey]-pai"
|
||||
|
||||
if(loc == card) //don't let them continue in card form, since they won't be able to actually see their new mobile form sprite.
|
||||
to_chat(src, "<span class='warning'>You must be in your mobile form to reconfigure your chassis.</span>")
|
||||
return
|
||||
|
||||
while(finalized == "No" && client)
|
||||
choice = input(usr,"What would you like to use for your mobile chassis icon? This decision can only be made once.") as null|anything in my_choices
|
||||
if(!choice) return
|
||||
if(choice == "Custom")
|
||||
icon = 'icons/mob/custom_synthetic/custom-synthetic.dmi'
|
||||
else
|
||||
icon = 'icons/mob/pai.dmi'
|
||||
icon_state = my_choices[choice]
|
||||
finalized = alert("Look at your sprite. Is this what you wish to use?",,"No","Yes")
|
||||
|
||||
chassis = my_choices[choice]
|
||||
verbs -= /mob/living/silicon/pai/proc/choose_chassis
|
||||
|
||||
/mob/living/silicon/pai/proc/choose_verbs()
|
||||
set category = "pAI Commands"
|
||||
set name = "Choose Speech Verbs"
|
||||
|
||||
var/choice = input(usr,"What theme would you like to use for your speech verbs? This decision can only be made once.") as null|anything in possible_say_verbs
|
||||
if(!choice) return
|
||||
|
||||
var/list/sayverbs = possible_say_verbs[choice]
|
||||
speak_statement = sayverbs[1]
|
||||
speak_exclamation = sayverbs[(sayverbs.len>1 ? 2 : sayverbs.len)]
|
||||
speak_query = sayverbs[(sayverbs.len>2 ? 3 : sayverbs.len)]
|
||||
|
||||
verbs -= /mob/living/silicon/pai/proc/choose_verbs
|
||||
|
||||
|
||||
/mob/living/silicon/pai/rest()
|
||||
set name = "Rest"
|
||||
set category = "IC"
|
||||
@@ -390,8 +327,6 @@
|
||||
|
||||
//I'm not sure how much of this is necessary, but I would rather avoid issues.
|
||||
/mob/living/silicon/pai/proc/close_up()
|
||||
|
||||
last_special = world.time + 200
|
||||
stand_up()
|
||||
if(loc == card)
|
||||
return
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
/mob/living/silicon/pai/Login()
|
||||
..()
|
||||
if(!custom_sprite)
|
||||
if(ckey in GLOB.configuration.custom_sprites.pai_holoform_ckeys)
|
||||
custom_sprite = TRUE
|
||||
@@ -12,11 +12,21 @@ GLOBAL_LIST_INIT(pai_emotions, list(
|
||||
|
||||
GLOBAL_LIST_EMPTY(pai_software_by_key)
|
||||
|
||||
/mob/living/silicon/pai/verb/paiInterface()
|
||||
set category = "pAI Commands"
|
||||
set name = "Software Interface"
|
||||
/obj/effect/proc_holder/spell/access_software_pai
|
||||
name = "Software interface"
|
||||
desc = "Allows you to access your downloaded software."
|
||||
clothes_req = FALSE
|
||||
base_cooldown = 1 SECONDS
|
||||
action_icon_state = "choose_module"
|
||||
action_background_icon_state = "bg_tech_blue"
|
||||
|
||||
ui_interact(src)
|
||||
/obj/effect/proc_holder/spell/access_software_pai/create_new_targeting()
|
||||
return new /datum/spell_targeting/self
|
||||
|
||||
/obj/effect/proc_holder/spell/access_software_pai/cast(list/targets, mob/living/user = usr)
|
||||
var/mob/living/silicon/pai/pai_user = user
|
||||
|
||||
pai_user.ui_interact(pai_user)
|
||||
|
||||
/mob/living/silicon/pai/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.self_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
|
||||
@@ -21,6 +21,32 @@
|
||||
data["emotions"] = emotions
|
||||
data["current_emotion"] = user.card.current_emotion
|
||||
|
||||
var/list/speech_types = list()
|
||||
for(var/name in user.possible_say_verbs)
|
||||
var/list/speech = list()
|
||||
speech["name"] = name
|
||||
speech["id"] = length(speech_types)
|
||||
speech_types[++speech_types.len] = speech
|
||||
|
||||
data["current_speech_verb"] = user.speech_state
|
||||
data["speech_verbs"] = speech_types
|
||||
|
||||
var/list/chassis_choices = list()
|
||||
var/list/chassises_to_add = list()
|
||||
|
||||
chassis_choices = user.possible_chassis.Copy()
|
||||
if(user.custom_sprite)
|
||||
chassis_choices["Custom"] = "[user.ckey]-pai"
|
||||
for(var/name in chassis_choices)
|
||||
var/list/chassis_to_update_with = list()
|
||||
chassis_to_update_with["name"] = name
|
||||
chassis_to_update_with["icon"] = chassis_choices[name]
|
||||
chassis_to_update_with["id"] = length(chassis_to_update_with)
|
||||
chassises_to_add[++chassises_to_add.len] = chassis_to_update_with
|
||||
|
||||
data["available_chassises"] = chassises_to_add
|
||||
data["current_chassis"] = user.chassis
|
||||
|
||||
var/list/available_s = list()
|
||||
for(var/s in GLOB.pai_software_by_key)
|
||||
var/datum/pai_software/PS = GLOB.pai_software_by_key[s]
|
||||
@@ -64,6 +90,20 @@
|
||||
var/toggle_key = params["toggle_key"]
|
||||
if(pai_holder.installed_software[toggle_key])
|
||||
pai_holder.installed_software[toggle_key].toggle(pai_holder)
|
||||
if("setSpeechStyle")
|
||||
pai_holder.speech_state = params["speech_state"]
|
||||
var/list/sayverbs = pai_holder.possible_say_verbs[pai_holder.speech_state]
|
||||
pai_holder.speak_statement = sayverbs[1]
|
||||
pai_holder.speak_exclamation = sayverbs[length(sayverbs) > 1 ? 2 : length(sayverbs)]
|
||||
pai_holder.speak_query = sayverbs[length(sayverbs) > 2 ? 3 : length(sayverbs)]
|
||||
if("setChassis")
|
||||
pai_holder.chassis = params["chassis_to_change"]
|
||||
pai_holder.icon_state = pai_holder.chassis
|
||||
if(pai_holder.icon_state == "[pai_holder.ckey]-pai")
|
||||
pai_holder.icon = 'icons/mob/custom_synthetic/custom-synthetic.dmi'
|
||||
else
|
||||
pai_holder.icon = 'icons/mob/pai.dmi'
|
||||
|
||||
|
||||
// Directives //
|
||||
/datum/pai_software/directives
|
||||
|
||||
@@ -1294,8 +1294,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
if(W)
|
||||
W.attack_self(src)
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/proc/SetLockdown(state = 1)
|
||||
// They stay locked down if their wire is cut.
|
||||
if(wires.is_cut(WIRE_BORG_LOCKED))
|
||||
|
||||
@@ -20,10 +20,7 @@
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/slime/verb/Feed()
|
||||
set category = "Slime"
|
||||
set desc = "This will let you feed on any valid creature in the surrounding area. This should also be used to halt the feeding process."
|
||||
|
||||
/mob/living/simple_animal/slime/proc/Feed()
|
||||
if(stat)
|
||||
return 0
|
||||
|
||||
@@ -123,10 +120,7 @@
|
||||
layer = initial(layer)
|
||||
buckled.unbuckle_mob(src,force=TRUE)
|
||||
|
||||
/mob/living/simple_animal/slime/verb/Evolve()
|
||||
set category = "Slime"
|
||||
set desc = "This will let you evolve from baby to adult slime."
|
||||
|
||||
/mob/living/simple_animal/slime/proc/Evolve()
|
||||
if(stat)
|
||||
to_chat(src, "<i>I must be conscious to do this...</i>")
|
||||
return
|
||||
@@ -156,10 +150,7 @@
|
||||
var/datum/action/innate/slime/reproduce/A = new
|
||||
A.Grant(S)
|
||||
|
||||
/mob/living/simple_animal/slime/verb/Reproduce()
|
||||
set category = "Slime"
|
||||
set desc = "This will make you split into four Slimes."
|
||||
|
||||
/mob/living/simple_animal/slime/proc/Reproduce()
|
||||
if(stat)
|
||||
to_chat(src, "<i>I must be conscious to do this...</i>")
|
||||
return
|
||||
|
||||
@@ -781,6 +781,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
|
||||
/mob/proc/is_dead()
|
||||
return stat == DEAD
|
||||
|
||||
// Nobody in their right mind will have this enabled on the production server, uncomment if you want this for some reason
|
||||
/*
|
||||
/mob/verb/abandon_mob()
|
||||
set name = "Respawn"
|
||||
set category = "OOC"
|
||||
@@ -816,6 +818,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
|
||||
M.key = key
|
||||
return
|
||||
|
||||
*/
|
||||
/mob/verb/observe()
|
||||
set name = "Observe"
|
||||
set category = "OOC"
|
||||
|
||||
Reference in New Issue
Block a user