Skip to content

Commit

Permalink
talking npcs proof of concept
Browse files Browse the repository at this point in the history
  • Loading branch information
silencer-pl committed Sep 6, 2024
1 parent 1d01590 commit 0b28d58
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 1 deletion.
2 changes: 2 additions & 0 deletions code/__DEFINES/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#define JOB_UER_MARINE_POINT "UER Marine Point"
#define JOB_UER_MARINE_LEAD "UER Marine Team Lead"

#define JOB_UER_PO "UER Dropship Pilot"

var/global/list/job_squad_roles = JOB_SQUAD_ROLES_LIST

#define JOB_COLONIST "Colonist"
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@

#define GOLDEN_ARROW_LZ "golden arrow lz"

#define ARROWHEAD_LZ "arrowhead lz"

#define DROPSHIP_FLYBY_ID "special_flight"
#define DROPSHIP_LZ1 "dropship-lz1"
#define DROPSHIP_LZ2 "dropship-lz2"
Expand Down
43 changes: 43 additions & 0 deletions code/game/objects/effects/landmarks/landmarks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -516,3 +516,46 @@
/// In landmarks.dm and not unit_test.dm so it is always active in the mapping tools.
/obj/effect/landmark/unit_test_top_right
name = "unit test zone top right"


/obj/effect/landmark/npc_spawner
name = "NPC spawner"
icon_state = "x2"
var/equipment_path = /datum/equipment_preset/pve/pilot_npc
var/npc_name = "John Doe"
var/npc_chat_color = "#ffffff"
var/gender_to_set = MALE

/obj/effect/landmark/npc_spawner/Initialize()
. = ..()
INVOKE_ASYNC(src, PROC_REF(spawn_npc))
return INITIALIZE_HINT_QDEL

/obj/effect/landmark/npc_spawner/Destroy()
equipment_path = null
return ..()

/obj/effect/landmark/npc_spawner/proc/spawn_npc()
var/mob/living/carbon/human/H = new(loc)
H.setDir(dir)
if(!H.hud_used)
H.create_hud()
arm_equipment(H, equipment_path, FALSE, FALSE)
H.name = npc_name
H.langchat_color = npc_chat_color
H.gender = gender_to_set
for(var/obj/structure/bed/chair/dropship/pilot/chair in get_area(H))
if(chair != null)
if(get_turf(chair) == get_turf(H))
chair.do_buckle(H,H)
break

/obj/effect/landmark/npc_spawner/pilot_left
npc_name = "Isabel 'Shrike' Vasquez"
npc_chat_color = "#e40f3d"
gender_to_set = FEMALE

/obj/effect/landmark/npc_spawner/pilot_right

npc_name = "James 'Jim' Biggs"
npc_chat_color = "#59eec9"
33 changes: 33 additions & 0 deletions code/modules/gear_presets/xenosurge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,36 @@
/obj/effect/landmark/start/marine/pve/lead/squad2
icon_state = "leader_spawn_delta"
squad = SQUAD_MARINE_4

/datum/job/marine/pve/pilot_npc
title = JOB_UER_PO
total_positions = 0
spawn_positions = 0
supervisors = "Mission Control"
gear_preset = /datum/equipment_preset/pve/pilot_npc
entry_message_body = "haha"

/datum/equipment_preset/pve/pilot_npc
name = "UER Marine Lead"
flags = EQUIPMENT_PRESET_EXTRA|EQUIPMENT_PRESET_MARINE

access = list(ACCESS_MARINE_PREP)
assignment = JOB_UER_PO
rank = JOB_UER_PO
faction = FACTION_MARINE
paygrade = "NO3"
role_comm_title = "PO"
skills = /datum/skills/pve/standard

/datum/equipment_preset/pve/pilot_npc/load_gear(mob/living/carbon/human/new_human)

new_human.equip_to_slot_or_del(new /obj/item/device/radio/headset/almayer/po(new_human), WEAR_L_EAR)
new_human.equip_to_slot_or_del(new /obj/item/storage/backpack/marine(new_human), WEAR_BACK)
new_human.equip_to_slot_or_del(new /obj/item/clothing/under/marine/officer/pilot(new_human), WEAR_BODY)
new_human.equip_to_slot_or_del(new /obj/item/clothing/shoes/marine/knife(new_human), WEAR_FEET)
new_human.equip_to_slot_or_del(new /obj/item/clothing/gloves/yellow(new_human), WEAR_HANDS)
new_human.equip_to_slot_or_del(new /obj/item/storage/belt/gun/m4a3/mod88(new_human), WEAR_WAIST)
new_human.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/bomber(new_human), WEAR_JACKET)
new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/general/large(new_human), WEAR_R_STORE)
new_human.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/marine/pilot(new_human), WEAR_HEAD)
new_human.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(new_human), WEAR_EYES)
31 changes: 31 additions & 0 deletions code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,34 @@
to_chat(usr, "Removed [rem_organ] from [src].")
qdel(rem_organ)

/mob/living/carbon/human/proc/talkas(str, delay, radio) //Talk as. Delay in BYOND ticks (about 1/10 of a second per tick) If not provided, delay calculated automatically depending in message length.
if (!str) return
var/list/heard = get_mobs_in_view(world_view_size, src)
src.langchat_speech(str, heard, GLOB.all_languages, skip_language_check = TRUE)
src.visible_message("<b>[src]</b> says, \"[str]\"")
var/talkdelay = delay
if (!talkdelay)
if ((length("[str]")) <= 64)
talkdelay = 40
if ((length("[str]")) > 64)
talkdelay = 60
if(radio)
to_chat(world, "<span class='big'><span class='radio'><span class='name'>[src]<b>[icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BUAS Arrowhead\u0028[src.job]\u0029\u005D </b></span><span class='message'>, says \"[str]\"</span></span></span>", type = MESSAGE_TYPE_RADIO)
sleep(talkdelay)
return

/mob/living/carbon/human/proc/emoteas(str, delay, radio) //Emote as. Delay in BYOND ticks (about 1/10 of a second per tick) If not provided, delay calculated automatically depending in message length.
if (!str) return
var/list/heard = get_mobs_in_view(world_view_size, src)
src.langchat_speech(str, heard, GLOB.all_languages, skip_language_check = TRUE, animation_style = LANGCHAT_FAST_POP, additional_styles = list("langchat_small", "emote"))
src.visible_message("<b>[src]</b> [str]")
var/talkdelay = delay
if (!talkdelay)
if ((length("[str]")) <= 64)
talkdelay = 40
if ((length("[str]")) > 64)
talkdelay = 60
if(radio)
to_chat(world, "<span class='big'><span class='radio'><span class='name'>[src]<b>[icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BUAS Arrowhead\u0028[usr.job]\u0029\u005D </b></span><span class='message'>[str]</span></span></span>", type = MESSAGE_TYPE_RADIO)
sleep(talkdelay)
return
2 changes: 1 addition & 1 deletion code/modules/shuttle/shuttles/dropship.dm
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@

/obj/docking_port/stationary/marine_dropship/arrowhead_hangar
name = "Wraith Launch Bay"
id = GOLDEN_ARROW_LZ
id = ARROWHEAD_LZ
auto_open = TRUE
roundstart_template = /datum/map_template/shuttle/wraith

Expand Down
2 changes: 2 additions & 0 deletions maps/shuttles/dropship_wraith.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
/obj/structure/bed/chair/dropship/pilot{
dir = 1
},
/obj/effect/landmark/npc_spawner/pilot_left,
/turf/open/shuttle/dropship{
icon_state = "rasputin15"
},
Expand Down Expand Up @@ -136,6 +137,7 @@
/obj/structure/bed/chair/dropship/pilot{
dir = 1
},
/obj/effect/landmark/npc_spawner/pilot_right,
/turf/open/shuttle/dropship{
icon_state = "rasputin15"
},
Expand Down

0 comments on commit 0b28d58

Please sign in to comment.