--SR4_5_city Lua file
-- Gameplay Choice IDs -
-- these should match values from level_scripts.cpp
MISSION_06_CHOICE = 0
MISSION_22_CHOICE = 1
MISSION_21_CHOICE = 2
M06_CHOICE_BLOWN_TOWER = true;
M06_CHOICE_BRANDED_TOWER = false;
M22_CHOICE_KILLBANE_KILL = true;
M22_CHOICE_KILLBANE_ESCAPE = false;
M21_CHOICE_KILLBANE_UNMASKED = true;
M21_CHOICE_KILLBANE_NOT_UNMASKED = false;
QOC_ASHA = 0
QOC_BEN_KING = 1
QOC_CID = 2
QOC_JOHNNY_GAT = 3
QOC_KINZIE = 4
QOC_MATT_MILLER = 5
QOC_PIERCE = 6
QOC_VP = 7
QOC_SHAUNDI = 8
QOC_SR2_SHAUNDI = 9
QOC_VLAD = 10
QOC_BLACKBEARD = 11
QOC_DANE = 12
QOC_VIOLA = 13
QOC_SHAKESPEARE = 14
sr4_5_city_CONTACTS = {
{ type = QOC_ASHA, npc = "Asha_01", trigger = "asha_trigger" },
{ type = QOC_BEN_KING, npc = "Ben_King_01", trigger = "ben_king_trigger" },
{ type = QOC_CID, npc = "CID_01", trigger = "cid_trigger" },
{ type = QOC_JOHNNY_GAT, npc = "Johnny_Gat_01", trigger = "johnny_gat_trigger" },
{ type = QOC_KINZIE, npc = "Kinzie_01", trigger = "kinzie_trigger" },
{ type = QOC_MATT_MILLER, npc = "Matt_Miller_01", trigger = "matt_miller_trigger" },
{ type = QOC_PIERCE, npc = "Pierce_01", trigger = "pierce_trigger" },
{ type = QOC_SHAUNDI, npc = "Shaundi_01", trigger = "shaundi_trigger" },
{ type = QOC_VP, npc = "VP_01", trigger = "vp_trigger" },
{ type = QOC_VLAD, trigger = "Vlad_trigger" },
{ type = QOC_BLACKBEARD, trigger = "Blackbeard_trigger" },
{ type = QOC_DANE, npc = "Dane_01", trigger = "dane_trigger" },
{ type = QOC_VIOLA, trigger = "Kiki_trigger" },
{ type = QOC_SHAKESPEARE, trigger = "Shake_trigger" },
{ type = QOC_SR2_SHAUNDI, trigger = "shaduni_sr2_trigger" },
}
function sr4_5_city_init()
--group_create( "sr3_weapons", false) -- Is this still needed?
quest_log_configure_contact_triggers( sr4_5_city_CONTACTS )
end
function sr4_5_city_main()
ember_on()
--hotspot_set_waypoint( "MG_Entertainment" )
end
function sr4_5_city_init_client()
quest_log_configure_contact_triggers( sr4_5_city_CONTACTS )
end
function sr4_5_city_main_client()
end
function mm_1_2_coop_skip( from_gamesave )
player_unlock_super_power(6) -- Jump
player_unlock_super_power(5) -- Sprint
end
function mm_1_3_coop_skip( from_gamesave )
player_unlock_super_power(3) -- Blast
unlockable_unlock("ragdoll_recovery") -- Air Recovery
end
function m05_coop_skip( from_gamesave )
player_unlock_super_power(0) -- Telekinesis
end
function mm_4_1_coop_skip( from_gamesave )
player_unlock_super_power(1) -- Stomp
end
function m14_coop_skip( from_gamesave )
player_unlock_super_power(2) -- Buff
end
function m15_3_coop_skip( from_gamesave )
player_unlock_super_power(4) -- Shield
player_unlock_super_power(7) -- DFA
end
function mm_1_3_setup()
-- NZ: Reset hotspot in case player abandons mission
hotspot_reset("Hotspot_NW")
end
--===========================GLOBALS====================================
-- tables of 'line played' flags for each homie dialogue line
--======================================================================
sr4_5_city_globals = {
-- the max number of times you'll get a modal dialogue scene with someone within the same ship visit
num_talks_allowed = 3,
--ship dialogue flags; table of flags for each line situation
said_asha_line = {
benking = false,
cid = false,
keithdavid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_cid_line = {
asha = false,
benking = false,
keithdavid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_johnny_line = {
asha = false,
benking = false,
cid = false,
keithdavid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = false,
gat = true,
},
said_king_line = {
asha = false,
cid = false,
keithdavid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_kinzie_line = {
asha = false,
benking = false,
cid = false,
keithdavid = false,
kinzie = true,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_matt_line = {
asha = false,
benking = false,
cid = false,
keithdavid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = true,
gat = false,
},
said_pierce_line = {
asha = false,
benking = false,
cid = false,
keithdavid = false,
kinzie = false,
shaundi = false,
matt = false,
gat = false,
},
said_shaundi_line = {
asha = false,
benking = false,
cid = false,
keithdavid = false,
kinzie = false,
pierce = false,
matt = false,
gat = false,
},
said_shaundi_sr2_line = {
asha = false,
benking = false,
cid = false,
keithdavid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_vp_line = {
asha = false,
benking = false,
cid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_earth_line = {
asha = false,
benking = false,
cid = false,
keithdavid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_key_line = {
asha = false,
benking = false,
cid = false,
keithdavid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_kinzie_kidnapped_line = {
asha = false,
benking = false,
cid = false,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_kinzie_rescued_line = {
asha = false,
benking = false,
cid = false,
keithdavid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_loyalty_complete_line = {
asha = false,
benking = false,
keithdavid = false,
kinzie = false,
matt = false,
pierce = false,
shaundi = false,
cid = true,
gat = true,
},
said_mech_line = {
asha = false,
benking = false,
cid = false,
keithdavid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_ship_name_line = {
asha = false,
benking = false,
cid = false,
keithdavid = false,
kinzie = false,
pierce = false,
shaundi = false,
matt = false,
gat = false,
},
said_working_on_mech_line = {
kinzie = false,
asha = true,
benking = true,
cid = true,
keithdavid = true,
pierce = true,
shaundi = true,
matt = true,
gat = false,
},
}
sr4_5_city_CRIBSHIP_num_talks = {
-- number of times you talked to an NPC (in a modal sequence) on a given ship visit
num_benking_talks = 0,
num_cid_talks = 0,
num_keithdavid_talks = 0,
num_kinzie_talks = 0,
num_pierce_talks = 0,
num_shaundi_talks = 0,
num_matt_talks = 0,
num_gat_talks = 0,
num_asha_talks = 0,
}
sr4_5_city_CRIBSHIP_sex_flags = {
-- sex flags
flag_benking_sex = false,
flag_cid_sex = false,
flag_keithdavid_sex = false,
flag_kinzie_sex = false,
flag_pierce_sex = false,
flag_shaundi_sex = false,
flag_matt_sex = false,
flag_gat_sex = false,
flag_asha_sex = false,
}
--===========================TRIGGERS===================================
--
--======================================================================
sr4_5_city_trigger = {
--= {
-- name = "johnnygat_con_trig_lean",
-- hit = false,
-- (optional)callback = "sr4_5_city_function_name_cb"
--(optional)marker = TRIGGER_LOCATION or TRIGGER_USE or custom or don't include for no marker
-- (optional)waypoint = true,
-- (optional)teleport_to = {
-- host = "host_nav",
-- client = "client_nav"
--},
--(optional)conversation = M_RAIL_convo.convo_name -- play a conversation
--},
talk_to_gat_lean = {
name = "johnnygat_con_trig_lean",
hit = false,
callback = "sr4_5_city_talk_to_gat",
},
talk_to_gat_crates = {
name = "johnnygat_con_trig_crates",
hit = false,
callback = "sr4_5_city_talk_to_gat",
},
talk_to_gat_chair = {
name = "johnnygat_con_trig_purplechair",
hit = false,
callback = "sr4_5_city_talk_to_gat",
},
talk_to_shaundi_stand = {
name = "shaundi_con_trig_stand",
hit = false,
callback = "sr4_5_city_talk_to_shaundi",
},
talk_to_shaundi_catwalk = {
name = "shaundi_con_trig_catwalk",
hit = false,
callback = "sr4_5_city_talk_to_shaundi",
},
talk_to_shaundi_ctrl = {
name = "shaundi_con_trig_controlroom",
hit = false,
callback = "sr4_5_city_talk_to_shaundi",
},
talk_to_shaundi_sit = {
name = "shaundi_con_trig_sit",
hit = false,
callback = "sr4_5_city_talk_to_shaundi",
},
talk_to_kinzie_bag = {
name = "kinzie_con_trig_beanbag",
hit = false,
callback = "sr4_5_city_talk_to_kinzie",
},
talk_to_kinzie_control = {
name = "kinzie_con_trig_controlroom",
hit = false,
callback = "sr4_5_city_talk_to_kinzie",
},
talk_to_kinzie_mech = {
name = "kinzie_con_trig_mech",
hit = false,
callback = "sr4_5_city_talk_to_kinzie",
},
talk_to_asha_bag = {
name = "asha_con_trig_gymbag",
hit = false,
callback = "sr4_5_city_talk_to_asha",
},
talk_to_asha_bench = {
name = "asha_con_trig_benchpress",
hit = false,
callback = "sr4_5_city_talk_to_asha",
},
talk_to_asha_stretch = {
name = "asha_con_trig_stretching",
hit = false,
callback = "sr4_5_city_talk_to_asha",
},
talk_to_ben_lean = {
name = "benking_con_trig_lean",
hit = false,
callback = "sr4_5_city_talk_to_benking",
},
talk_to_ben_chair = {
name = "benking_con_trig_chair",
hit = false,
callback = "sr4_5_city_talk_to_benking",
},
talk_to_ben_toilet = {
name = "benking_con_trig_toilet",
hit = false,
callback = "sr4_5_city_talk_to_benking",
},
talk_to_cid = {
name = "cid_con_trig_sexroom",
hit = false,
callback = "sr4_5_city_talk_to_cid",
},
talk_to_matt_couch = {
name = "mattmiller_con_trig_couch",
hit = false,
callback = "sr4_5_city_talk_to_matt",
},
talk_to_matt_tv = {
name = "mattmiller_con_trig_tv",
hit = false,
callback = "sr4_5_city_talk_to_matt",
},
talk_to_matt_crates = {
name = "mattmiller_con_trig_crates",
hit = false,
callback = "sr4_5_city_talk_to_matt",
},
talk_to_matt_dep = {
name = "mattmiller_con_trig_depressed",
hit = false,
callback = "sr4_5_city_talk_to_matt",
},
talk_to_pierce = {
name = "pierce_con_trig_couch",
hit = false,
callback = "sr4_5_city_talk_to_pierce",
},
talk_to_pierce_egg = {
name = "pierce_con_trig_eggchair",
hit = false,
callback = "sr4_5_city_talk_to_pierce",
},
talk_to_pierce_pool = {
name = "pierce_con_trig_pooltable",
hit = false,
callback = "sr4_5_city_talk_to_pierce",
},
talk_to_vp_vport = {
name = "vp_con_trig_stand",
hit = false,
callback = "sr4_5_city_talk_to_vp",
},
talk_to_vp_cat = {
name = "vp_con_trig_catwalk",
hit = false,
callback = "sr4_5_city_talk_to_vp",
},
talk_to_vp_chair = {
name = "vp_con_trig_chair",
hit = false,
callback = "sr4_5_city_talk_to_vp",
},
--sex triggers
asha_sex = {
name = "asha_sex_trigger",
hit = false,
callback = "sr4_5_city_asha_sex",
},
ben_king_sex = {
name = "ben_king_sex_trigger",
hit = false,
callback = "sr4_5_city_benking_sex",
},
cid_sex = {
name = "cid_sex_trigger",
hit = false,
callback = "sr4_5_city_cid_sex",
},
gat_sex = {
name = "johnny_gat_sex_trigger",
hit = false,
callback = "sr4_5_city_gat_sex",
},
kinzie_sex = {
name = "kinzie_sex_trigger",
hit = false,
callback = "sr4_5_city_kinzie_sex",
},
matt_sex = {
name = "matt_miller_sex_trigger",
hit = false,
callback = "sr4_5_city_matt_sex",
},
pierce_sex = {
name = "pierce_sex_trigger",
hit = false,
callback = "sr4_5_city_pierce_sex",
},
shaundi_sex = {
name = "shaundi_sex_trigger",
hit = false,
callback = "sr4_5_city_shaundi_sex",
},
vp_sex = {
name = "vp_sex_trigger",
hit = false,
callback = "sr4_5_city_vp_sex",
},
--[[ hack_cargo = {
name = "hack_sim1_trig",
hit = false,
use_nav = "hack_sim1_nav",
use_anim = "m24 computer hack",
callback = "sr4_5_city_do_hack",
},
]]
-- txt adventure computer
start_txt_adventure = {
name = "Text_Adventure_Trigger",
hit = false,
use_nav = "txt_adventure_nav",
use_anim = "m24 computer hack",
callback = "ship_start_text_adventure_cb",
--conversation = sr4_5_city_convo.Matt_Talk_01
},
}
sr4_5_city_ship_action_nodes = {
asha = {
{
-- bag lean
name = "asha_baglean", -- "asha_baglean"
talk_trig = "asha_con_trig_gymbag",
sex_trig = "asha_sex_trigger",
contact_trig = "asha_trigger",
sex_nav = "asha_sex_nav",
},
{
-- bench press
name = "asha_benchsit", -- "asha_benchsit" "asha_bench_shp"
talk_trig = "asha_con_trig_benchpress", -- "asha_con_trig_benchpress"
sex_trig = "asha_sex_trigger",
contact_trig = "asha_trigger",
sex_nav = "asha_sex_nav",
},
{
-- on floor stretching
name = "asha_shp_stretch", -- "asha_shp_stretch" "asha_stretch_ship" "Situps_Asha"
talk_trig = "asha_con_trig_stretching", -- "asha_con_trig_stretching"
sex_trig = "asha_sex_trigger",
contact_trig = "asha_trigger",
sex_nav = "asha_sex_nav",
},
},
benking = {
{
-- leaning on table
name = "King_leaning", -- "King_leaning"
talk_trig = "benking_con_trig_lean",
sex_trig = "ben_king_sex_trigger",
contact_trig = "ben_king_trigger",
sex_nav = "ben_king_sex_nav",
},
{
-- sitting in purple chair
name = "King_ship_pchair", -- "King_ship_pchair"
talk_trig = "benking_con_trig_chair",
sex_trig = "ben_king_sex_trigger",
contact_trig = "ben_king_trigger",
sex_nav = "ben_king_sex_nav",
},
{
-- space toilet
name = "pierce_shp_toilet", -- "pierce_shp_toilet"
talk_trig = "benking_con_trig_toilet",
sex_trig = "ben_king_sex_trigger",
contact_trig = "ben_king_trigger",
sex_nav = "benking_sex_nav_toilet",
},
},
cid = {
{
-- sex room
name = "Ship_Cid_Float",
talk_trig = "cid_con_trig_sexroom",
sex_trig = "cid_sex_trigger",
contact_trig = "cid_trigger",
sex_nav = "cid_sex_nav",
},
},
gat = {
{
-- leaning on locker w/knife
name = "Ship_Gat_Locker", -- "Ship_Gat_Locker"
talk_trig = "johnnygat_con_trig_lean", -- "johnnygat_con_trig_lean"
sex_trig = "johnny_gat_sex_trigger",
contact_trig = "johnny_gat_trigger",
sex_nav = "johnny_gat_sex_nav",
},
{
-- sitting on crate cleaning gun
name = "gat ship gunclean", -- "gat ship gunclean"
talk_trig = "johnnygat_con_trig_crates", -- johnnygat_con_trig_crates
sex_trig = "johnny_gat_sex_trigger",
contact_trig = "johnny_gat_trigger",
sex_nav = "johnny_gat_sex_nav",
},
{
-- sitting in purple chair
name = "Ship_Gat_sit", -- "Ship_Gat_sit"
talk_trig = "johnnygat_con_trig_purplechair", -- johnnygat_con_trig_purplechair
sex_trig = "johnny_gat_sex_trigger",
contact_trig = "johnny_gat_trigger",
sex_nav = "johnny_gat_sex_nav",
},
},
kinzie = {
{
-- working on mech
name = "shp_kinz_mchbox", -- "shp_kinz_mchbox"
talk_trig = "kinzie_con_trig_mech", -- "kinzie_con_trig_mech",
sex_trig = "kinzie_sex_trigger",
contact_trig = "kinzie_trigger",
sex_nav = "kinzie_sex_nav_mech", -- "kinzie_sex_nav_mech",
},
{
-- nemo chair
name = "kinzie_nemo", -- "kinzie_nemo"
talk_trig = nil,
sex_trig = nil,
contact_trig = nil,
sex_nav = nil,
},
{
-- control room
name = "Kinz_shp_computer", -- "Kinz_shp_computer"
talk_trig = "kinzie_con_trig_controlroom", -- "kinzie_con_trig_controlroom"
sex_trig = "kinzie_sex_trigger",
contact_trig = "kinzie_trigger",
sex_nav = "kinzie_sex_nav_controlroom", -- "kinzie_sex_nav_controlroom"
},
{
-- typing in beanbag chair
name = "kinzie_typing", -- "kinzie_typing"
talk_trig = "kinzie_con_trig_beanbag", -- "kinzie_con_trig_beanbag",
sex_trig = "kinzie_sex_trigger",
contact_trig = "kinzie_trigger",
sex_nav = "kinzie_sex_nav", -- "kinzie_sex_nav"
},
{
-- tube
name = "shp_kinzie_tiptoe", -- "shp_kinzie_tiptoe"
talk_trig = "kinzie_con_trig_beanbag", -- "kinzie_con_trig_beanbag",
sex_trig = "kinzie_sex_trigger",
contact_trig = "kinzie_trigger",
sex_nav = "kinzie_sex_nav", -- "kinzie_sex_nav"
},
},
matt = {
{
-- depressed sitting at computer
name = "shp_matt_computer", -- "shp_matt_computer"
talk_trig = "mattmiller_con_trig_depressed", -- "mattmiller_con_trig_depressed",
sex_trig = "matt_miller_sex_trigger",
contact_trig = "matt_miller_trigger",
sex_nav = "mattmiller_sex_nav_depressed", -- "mattmiller_sex_nav_depressed",
},
{
-- couch w/game
name = "Matt_ship_couch", -- "Matt_ship_couch"
talk_trig = "mattmiller_con_trig_couch", -- mattmiller_con_trig_couch
sex_trig = "matt_miller_sex_trigger",
contact_trig = "matt_miller_trigger",
sex_nav = "matt_miller_sex_nav", -- matt_miller_sex_nav
},
{
-- standing at tv
name = "Matt_tv", --"Matt_tv"
talk_trig = "mattmiller_con_trig_tv", -- "mattmiller_con_trig_tv"
sex_trig = "matt_miller_sex_trigger",
contact_trig = "matt_miller_trigger",
sex_nav = "matt_miller_sex_nav", -- matt_miller_sex_nav
},
{
-- sitting on crates fixing electronics
name = "Matt_shp_crates", --"Matt_shp_crates"
talk_trig = "mattmiller_con_trig_crates", -- mattmiller_con_trig_crates
sex_trig = "matt_miller_sex_trigger",
contact_trig = "matt_miller_trigger",
sex_nav = "mattmiller_sex_nav_crates", -- mattmiller_sex_nav_crates
},
},
pierce = {
{
-- laying on couch
name = "Pierce_couch", -- "Pierce_couch"
talk_trig = "pierce_con_trig_couch", -- pierce_con_trig_couch
sex_trig = "pierce_sex_trigger",
contact_trig = "pierce_trigger",
sex_nav = "pierce_sex_nav",
},
{
-- pool table
name = "Pirc_ship_pltable", -- "Pirc_ship_pltable"
talk_trig = "pierce_con_trig_pooltable", -- pierce_con_trig_pooltable
sex_trig = "pierce_sex_trigger",
contact_trig = "pierce_trigger",
sex_nav = "pierce_sex_nav",
},
{
-- egg chair
name = "Peirce_reading", -- "Peirce_reading"
talk_trig = "pierce_con_trig_eggchair", -- pierce_con_trig_eggchair
sex_trig = "pierce_sex_trigger",
contact_trig = "pierce_trigger",
sex_nav = "pierce_sex_nav",
},
},
shaundi = {
{
-- control room
name = "Shp_shndi_pTble", -- "Shp_shndi_pTble"
talk_trig = "shaundi_con_trig_controlroom", -- "shaundi_con_trig_controlroom",
sex_trig = "shaundi_sex_trigger",
contact_trig = "shaundi_trigger",
sex_nav = "shaundi_sex_nav_controlroom", -- "shaundi_sex_nav_controlroom",
},
{
-- depressed sitting on catwalk
name = "Shndi_railsit", -- "Shndi_railsit"
talk_trig = "shaundi_con_trig_catwalk", -- "shaundi_con_trig_catwalk",
sex_trig = "shaundi_sex_trigger",
contact_trig = "shaundi_trigger",
sex_nav = "shaundi_sex_nav_catwalk", -- "shaundi_sex_nav_catwalk",
},
{
-- standing on bridge
name = "shaundi_shp_stnd", -- "shaundi_shp_stnd"
talk_trig = "shaundi_con_trig_stand", -- shaundi_con_trig_stand
sex_trig = "shaundi_sex_trigger",
contact_trig = "shaundi_trigger",
sex_nav = "shaundi_sex_nav",
},
{
-- in/near chair on bridge
name = "Shandi_bridge_sit", -- "Shandi_bridge_sit"
talk_trig = "shaundi_con_trig_sit", -- shaundi_con_trig_sit
sex_trig = "shaundi_sex_trigger",
contact_trig = "shaundi_trigger",
sex_nav = "shaundi_sex_nav",
},
},
vp = {
{
-- standing on catwalk
name = "kiethD_shp_catwlk", -- "kiethD_shp_catwlk"
talk_trig = "vp_con_trig_catwalk", -- "vp_con_trig_catwalk"
sex_trig = "vp_sex_trigger",
contact_trig = "vp_trigger",
sex_nav = nil,
},
{
-- sitting in chair on bridge
name = "Keith_cmpter_shp", -- "Keith_cmpter_shp"
talk_trig = "vp_con_trig_chair", -- vp_con_trig_chair
sex_trig = "vp_sex_trigger",
contact_trig = "vp_trigger",
sex_nav = nil,
},
{
-- standing in bridge looking thru viewfinder
name = "shp_keith_vport", -- "shp_keith_vport"
talk_trig = "vp_con_trig_stand", -- vp_con_trig_stand
sex_trig = "vp_sex_trigger",
contact_trig = "vp_trigger",
sex_nav = nil,
},
},
}
--========================CONVERSATIONS=================================
-- have around 200 lines, all of which play outside a mission context and mostly in modal sequences, so no convo table currently
-- lines play as individual persona lines
-- however if we find we need a convo table added let me (alvan) know
--
--======================================================================
sr4_5_city_convo = {}
--called from do_dialogue; decides what line to play based on player progression and returns string for that line situation
function get_line_situation( npc )
if ( ( npc == "asha" and mission_is_complete( "mol_jb_01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or
( npc == "benking" and mission_is_complete( "mol_bk_01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or
( npc == "gat" and mission_is_complete( "mol_jg_01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or
( npc == "kinzie" and mission_is_complete( "mol_kz_01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or
( npc == "matt" and mission_is_complete( "mol_mm_01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or
( npc == "pierce" and mission_is_complete( "mol_p01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or
( npc == "shaundi" and mission_is_complete( "mol_sh01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) ) then
sr4_5_city_globals.said_loyalty_complete_line[npc] = true
return "ship_loyalty_complete"
elseif mission_is_complete( "m19" ) and not mission_is_complete( "m22-1" ) and (sr4_5_city_globals.said_key_line[npc] == false) then
--message("key line", 2.0, false)
sr4_5_city_globals.said_key_line[npc] = true
return "ship_getting_key_ready"
elseif mission_is_complete( "m19" ) and (sr4_5_city_globals.said_kinzie_rescued_line[npc] == false) then
--message("kinzie rescued line", 2.0, false)
sr4_5_city_globals.said_kinzie_rescued_line[npc] = true
return "ship_kinzie_rescued"
elseif mission_is_complete( "m16" ) and not mission_is_complete( "m19" ) and (sr4_5_city_globals.said_kinzie_kidnapped_line[npc] == false) then
--message("kinzie kidnapped line", 2.0, false)
sr4_5_city_globals.said_kinzie_kidnapped_line[npc] = true
return "ship_kinzie_kidnapped"
elseif mission_is_complete( "m15_3" ) and (sr4_5_city_globals.said_johnny_line[npc] == false) then
--message("johnny line", 2.0, false)
sr4_5_city_globals.said_johnny_line[npc] = true
return "ship_comment_on_johnny"
elseif mission_is_complete( "m11" ) and (sr4_5_city_globals.said_asha_line[npc] == false) then
--message("asha line", 2.0, false)
sr4_5_city_globals.said_asha_line[npc] = true
return "ship_comment_on_asha"
elseif mission_is_complete( "m10" ) and (sr4_5_city_globals.said_king_line[npc] == false) then
--message("king line", 2.0, false)
sr4_5_city_globals.said_king_line[npc] = true
return "ship_comment_on_king"
elseif mission_is_complete( "m09" ) and (sr4_5_city_globals.said_pierce_line[npc] == false) then
--message("pierce line", 2.0, false)
sr4_5_city_globals.said_pierce_line[npc] = true
return "ship_comment_on_pierce"
elseif mission_is_complete( "m08" ) and (sr4_5_city_globals.said_shaundi_line[npc] == false) then
--message("shaundi line", 2.0, false)
sr4_5_city_globals.said_shaundi_line[npc] = true
return "ship_comment_on_shaundi"
elseif mission_is_complete( "m08" ) and (sr4_5_city_globals.said_shaundi_sr2_line[npc] == false) then
--message("shaundi sr2 line", 2.0, false)
sr4_5_city_globals.said_shaundi_sr2_line[npc] = true
return "ship_comment_on_shaundi_sr2"
elseif mission_is_complete( "m08" ) and (sr4_5_city_globals.said_cid_line[npc] == false) then
--message("cid line", 2.0, false)
sr4_5_city_globals.said_cid_line[npc] = true
return "ship_comment_on_cid"
elseif mission_is_complete( "m07" ) and (sr4_5_city_globals.said_mech_line[npc] == false) then
--message("mech line", 2.0, false)
sr4_5_city_globals.said_mech_line[npc] = true
return "ship_mech_comment"
elseif mission_is_complete( "m03" ) and (sr4_5_city_globals.said_earth_line[npc] == false) then
--message("earth line", 2.0, false)
sr4_5_city_globals.said_earth_line[npc] = true
return "ship_earth_blew_up"
elseif mission_is_complete( "m03" ) and (sr4_5_city_globals.said_vp_line[npc] == false) then
--message("vp line", 2.0, false)
sr4_5_city_globals.said_vp_line[npc] = true
return "ship_comment_on_vp"
elseif mission_is_complete( "m03" ) and (sr4_5_city_globals.said_kinzie_line[npc] == false) then
--message("kinzie line", 2.0, false)
sr4_5_city_globals.said_kinzie_line[npc] = true
return "ship_comment_on_kinzie"
else
--message("generic line", 2.0, false)
return "ship_generic_comment"
end
end
--do modal dialogue sequence w/camera cut; selects line to play, sets camera, plays line etc.
function do_dialogue( npc_flag, npc_name )
local count = 0
local situation
--figure out which line to play
situation = get_line_situation( npc_flag )
--setup, play
player_controls_disable( LOCAL_PLAYER )
camera_set_target( npc_name, true, SYNC_LOCAL )
audio_play_persona_line( npc_name, situation )
--wait till line is done playing or 20 seconds have passed
while ( audio_persona_line_playing( npc_name ) and count <= 80 ) do
delay(0.25)
count = count + 1
end
--cleanup
player_controls_enable( LOCAL_PLAYER )
camera_revert_target( true, SYNC_LOCAL )
end
--dialogue wrapper function
function do_dialogue_wrapper( talk_trig, sex_trig, num_talks, npc_flag, npc_name )
local count = 0
sr4_5_city_CRIBSHIP_num_talks[num_talks] = sr4_5_city_CRIBSHIP_num_talks[num_talks] + 1
trigger_enable( talk_trig, false )
trigger_enable( sex_trig, false )
if ( sr4_5_city_CRIBSHIP_num_talks[num_talks] <= sr4_5_city_globals.num_talks_allowed) then
--do modal dialogue sequence
character_hide( LOCAL_PLAYER )
do_dialogue( npc_flag, npc_name )
character_show( LOCAL_PLAYER )
else
--do non-modal busy line
audio_play_persona_line( npc_name, "ship_generic_comment" )
--audio_play_persona_line( npc_name, "ship_busy" )
while ( audio_persona_line_playing( npc_name ) and count <= 50 ) do
delay(0.25)
count = count + 1
end
end
trigger_enable( talk_trig, true )
trigger_enable( sex_trig, true )
end
--dialogue trigger callbacks
function sr4_5_city_talk_to_kinzie( human, talk_trig )
do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.kinzie_sex.name, "num_kinzie_talks", "kinzie", "Kinzie_01" )
--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_kinzie.name, sr4_5_city_trigger.kinzie_sex.name, "num_kinzie_talks", "kinzie", "Kinzie_01", "kinzie_dlg_aft_player01", "kinzie_dlg_aft_cam02a", "kinzie_dlg_aft_cam02b")
end
function sr4_5_city_talk_to_pierce( human, talk_trig )
do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.pierce_sex.name, "num_pierce_talks", "pierce", "Pierce_01" )
--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_pierce.name, sr4_5_city_trigger.pierce_sex.name, "num_pierce_talks", "pierce", "Pierce_01", "pierce_dlg_pool_player01", "pierce_dlg_pool_cam01a", "pierce_dlg_pool_cam01b")
end
function sr4_5_city_talk_to_shaundi( human, talk_trig )
do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.shaundi_sex.name, "num_shaundi_talks", "shaundi", "Shaundi_01" )
--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_shaundi.name, sr4_5_city_trigger.shaundi_sex.name, "num_shaundi_talks", "shaundi", "Shaundi_01", "shaundi_dlg_brdg_player01", "shaundi_dlg_brdg_cam02a", "shaundi_dlg_brdg_cam02b")
end
function sr4_5_city_talk_to_asha( human, talk_trig )
do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.asha_sex.name, "num_asha_talks", "asha", "Asha_01" )
--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_asha.name, sr4_5_city_trigger.asha_sex.name, "num_asha_talks", "asha", "Asha_01", "asha_dlg_bag_player01", "asha_dlg_bag_cam01a", "asha_dlg_bag_cam01b")
end
function sr4_5_city_talk_to_benking( human, talk_trig )
do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.ben_king_sex.name, "num_benking_talks", "benking", "Ben_King_01" )
--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_ben.name, sr4_5_city_trigger.ben_king_sex.name, "num_benking_talks", "benking", "Ben_King_01", "benking_dlg_messhall_player01", "benking_dlg_messhall_cam01a", "benking_dlg_messhall_cam01b")
end
function sr4_5_city_talk_to_cid( human, talk_trig )
do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.cid_sex.name, "num_cid_talks", "cid", "CID_01" )
--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_cid.name, sr4_5_city_trigger.cid_sex.name, "num_cid_talks", "cid", "CID_01", "cid_dlg_storage_player01", "cid_dlg_storage_cam01a", "cid_dlg_storage_cam01b")
end
function sr4_5_city_talk_to_vp( human, talk_trig )
do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.vp_sex.name, "num_keithdavid_talks", "keithdavid", "VP_01" )
--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_vp.name, sr4_5_city_trigger.vp_sex.name, "num_keithdavid_talks", "keithdavid", "VP_01", "vp_dlg_brdg_player01", "vp_dlg_brdg_cam01a", "vp_dlg_brdg_cam01b")
end
function sr4_5_city_talk_to_matt( human, talk_trig )
do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.matt_sex.name, "num_matt_talks", "matt", "Matt_Miller_01" )
--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_matt.name, sr4_5_city_trigger.matt_sex.name, "num_matt_talks", "matt", "Matt_Miller_01", "matt_dlg_storage_player", "matt_dlg_storage_cam01a", "matt_dlg_storage_cam01b")
end
function sr4_5_city_talk_to_gat( human, talk_trig )
do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.gat_sex.name, "num_gat_talks", "gat", "Johnny_Gat_01" )
--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_gat.name, sr4_5_city_trigger.gat_sex.name, "num_gat_talks", "gat", "Johnny_Gat_01", "gat_dlg_deck_player01", "gat_dlg_deck_cam01a", "gat_dlg_deck_cam01b")
end
--====================SEX CALLBACKS AND DO_SEX FUNCTION====================
--
--
--
--=========================================================================
--do modal sex sequence OR play no sex line
function do_sex( node_table, msn_trig, npc, npc_flag, anim, length )
local msn_trig_was_active = false
local active_node = nil
local active_talk_trig = nil
local active_sex_trig = nil
local sex_nav = nil
local count = 0
-- figure out which action node is active
for i = 1, #node_table do
if ( node_table[i].talk_trig ~= nil and trigger_is_enabled( node_table[i].talk_trig ) ) then
active_node = node_table[i].name
active_talk_trig = node_table[i].talk_trig
active_sex_trig = node_table[i].sex_trig
sex_nav = node_table[i].sex_nav
break
end
end
-- disable triggers
if ( active_sex_trig ~= nil ) then
trigger_enable( active_sex_trig, false )
end
if ( active_talk_trig ~= nil ) then
trigger_enable( active_talk_trig, false )
end
if ( trigger_is_enabled( msn_trig ) == true ) then
msn_trig_was_active = true
trigger_enable( msn_trig, false )
end
if ( npc == "VP_01" ) then
-- vp
audio_play_persona_line( npc, "ship_no_sex_ever" )
-- wait until line finishes, or 20 seconds have passed (whichever comes first)
while ( audio_persona_line_playing( "VP_01" ) and count <= 80 ) do
delay(0.25)
count = count + 1
end
delay(0.25)
else
-- all other homies
if ( sr4_5_city_CRIBSHIP_sex_flags[npc_flag] == false ) then
--start modal sex sequence
sr4_5_city_CRIBSHIP_sex_flags[npc_flag] = true
fade_out(0.5, SFX_FADE_ALPHA_FADE, SYNC_LOCAL)
delay(0.5)
--teleport to sex nav
if ( sex_nav ~= nil ) then
teleport( npc, sex_nav )
end
player_controls_disable( LOCAL_PLAYER )
action_play_synced_non_blocking( LOCAL_PLAYER, npc, anim, sex_nav, SYNC_LOCAL )
if (npc == "Shaundi_01") then
character_hide( "VP_01" )
end
delay(0.75)
fade_in(0.5, SFX_FADE_ALPHA_FADE, SYNC_LOCAL, {0,0,0} )
delay( length )
fade_out(0.75, SFX_FADE_ALPHA_FADE, SYNC_LOCAL)
delay(6)
if (active_node ~= nil) then
npc_use_closest_action_node_of_type(npc, active_node, 200, true )
end
delay(0.5)
player_controls_enable( LOCAL_PLAYER )
if (npc == "Shaundi_01") then
character_show( "VP_01" )
end
fade_in(0.75, SFX_FADE_ALPHA_FADE, SYNC_LOCAL, {0,0,0} )
else
--play no sex line
audio_play_persona_line( npc, "ship_no_sex_right_now" )
-- wait until line finishes, or 20 seconds have passed (whichever comes first)
while ( audio_persona_line_playing( npc ) and count <= 80 ) do
delay(0.25)
count = count + 1
end
delay(0.25)
end
end
-- reactivate triggers if necessary
if ( active_sex_trig ~= nil ) then
trigger_enable( active_sex_trig, true )
end
if ( active_talk_trig ~= nil ) then
trigger_enable( active_talk_trig, true )
end
if ( msn_trig_was_active == true ) then
trigger_enable( msn_trig, true )
end
end
--sex trigger callbacks
function sr4_5_city_asha_sex()
local node_table = sr4_5_city_ship_action_nodes.asha
local contact_trig = "asha_trigger"
local npc = "Asha_01"
local flag = "flag_asha_sex"
local anim = "FuckBuddy Asha"
local anim_duration = 13.5
gds_sex("Asha_01", "fb - asha")
do_sex( node_table, contact_trig, npc, flag, anim, anim_duration )
stat_increment("fb - asha")
--do_sex( "asha_sex_nav", false, sr4_5_city_trigger.asha_sex.name, sr4_5_city_trigger.talk_to_asha.name, "", "", "", "", 14.0, "asha_baglean", true )
end
function sr4_5_city_benking_sex()
local node_table = sr4_5_city_ship_action_nodes.benking
local contact_trig = "ben_king_trigger"
local npc = "Ben_King_01"
local flag = "flag_benking_sex"
local anim = "FuckBuddy King"
local anim_duration = 32.5
gds_sex("Ben_King_01", "fb - ben")
do_sex( node_table, contact_trig, npc, flag, anim, anim_duration )
stat_increment("fb - ben")
--do_sex( "ben_king_sex_nav", true, sr4_5_city_trigger.ben_king_sex.name, sr4_5_city_trigger.talk_to_ben.name, "ben_king_trigger", "Ben_King_01", "flag_benking_sex", "FuckBuddy King", 32.5, "King_leaning", true )
end
function sr4_5_city_cid_sex()
local node_table = sr4_5_city_ship_action_nodes.cid
local contact_trig = "cid_trigger"
local npc = "CID_01"
local flag = "flag_cid_sex"
local anim = "FuckBuddy Cid"
local anim_duration = 10.25
gds_sex("CID_01", "fb - cid")
do_sex( node_table, contact_trig, npc, flag, anim, anim_duration )
stat_increment("fb - cid")
--do_sex( "cid_sex_nav", false, sr4_5_city_trigger.cid_sex.name, sr4_5_city_trigger.talk_to_cid.name, "cid_trigger", "CID_01", "flag_cid_sex", "FuckBuddy Cid", 10.25, nil, nil )
end
function sr4_5_city_gat_sex()
local node_table = sr4_5_city_ship_action_nodes.gat
local contact_trig = "johnny_gat_trigger"
local npc = "Johnny_Gat_01"
local flag = "flag_gat_sex"
local anim = "FuckBuddy Gat"
local anim_duration = 32.0
gds_sex("Johnny_Gat_01", "fb - gat")
do_sex( node_table, contact_trig, npc, flag, anim, anim_duration )
stat_increment("fb - gat")
--do_sex( "johnny_gat_sex_nav", true, sr4_5_city_trigger.gat_sex.name, sr4_5_city_trigger.talk_to_gat.name, "johnny_gat_trigger", "Johnny_Gat_01", "flag_gat_sex", "FuckBuddy Gat", 33.0, "Ship_Gat_Locker", true )
end
function sr4_5_city_kinzie_sex()
local node_table = sr4_5_city_ship_action_nodes.kinzie
local contact_trig = "kinzie_trigger"
local npc = "Kinzie_01"
local flag = "flag_kinzie_sex"
local anim = "FuckBuddy Kinzie"
local anim_duration = 5.5
gds_sex("Kinzie_01", "fb - kinzie")
do_sex( node_table, contact_trig, npc, flag, anim, anim_duration )
stat_increment("fb - kinzie")
--do_sex( "kinzie_sex_nav", false, sr4_5_city_trigger.kinzie_sex.name, sr4_5_city_trigger.talk_to_kinzie.name, "kinzie_trigger", "Kinzie_01", "flag_kinzie_sex", "FuckBuddy Kinzie", 5.5, "kinzie_typing", true )
end
function sr4_5_city_matt_sex()
local node_table = sr4_5_city_ship_action_nodes.matt
local contact_trig = "matt_miller_trigger"
local npc = "Matt_Miller_01"
local flag = "flag_matt_sex"
local anim = "FuckBuddy Matt"
local anim_duration = 20.5
gds_sex("Matt_Miller_01", "fb - matt")
do_sex( node_table, contact_trig, npc, flag, anim, anim_duration )
stat_increment("fb - matt")
--do_sex( "matt_miller_sex_nav", false, sr4_5_city_trigger.matt_sex.name, sr4_5_city_trigger.talk_to_matt.name, "matt_miller_trigger", "Matt_Miller_01", "flag_matt_sex", "FuckBuddy Matt", 20.5, "Matt_ship_couch", true )
end
function sr4_5_city_pierce_sex()
local node_table = sr4_5_city_ship_action_nodes.pierce
local contact_trig = "pierce_trigger"
local npc = "Pierce_01"
local flag = "flag_pierce_sex"
local anim = "FuckBuddy Pierce"
local anim_duration = 13.25
gds_sex("Pierce_01", "fb - pierce")
do_sex( node_table, contact_trig, npc, flag, anim, anim_duration )
stat_increment("fb - pierce")
--do_sex( "pierce_sex_nav", false, sr4_5_city_trigger.pierce_sex.name, sr4_5_city_trigger.talk_to_pierce.name, "pierce_trigger", "Pierce_01", "flag_pierce_sex", "FuckBuddy Pierce", 13.75, "Pierce_couch", true )
end
function sr4_5_city_shaundi_sex()
local node_table = sr4_5_city_ship_action_nodes.shaundi
local contact_trig = "shaundi_trigger"
local npc = "Shaundi_01"
local flag = "flag_shaundi_sex"
local anim = "FuckBuddy Shaundi"
local anim_duration = 32.0
gds_sex("Shaundi_01", "fb - shaundi")
do_sex( node_table, contact_trig, npc, flag, anim, anim_duration )
stat_increment("fb - shaundi")
--do_sex( "shaundi_sex_nav", false, sr4_5_city_trigger.shaundi_sex.name, sr4_5_city_trigger.talk_to_shaundi.name, "shaundi_trigger", "Shaundi_01", "flag_shaundi_sex", "FuckBuddy Shaundi", 32.0, nil, nil )
end
function sr4_5_city_vp_sex()
local node_table = sr4_5_city_ship_action_nodes.vp
local contact_trig = "vp_trigger"
local npc = "VP_01"
local flag = nil
local anim = nil
local anim_duration = nil
gds_sex("VP_01", "fb - veep")
do_sex( node_table, contact_trig, npc, flag, anim, anim_duration )
end
--[[ If you re-enable this, you'll need to re-enable the trigger...the definition above is commented out
-- hacking test
function sr4_5_city_do_hack( human, trigger )
local table_entry = crib_ship_trigger_get_table( trigger )
local hack_attempt = rand_int( 1, 100 )
action_play( human, table_entry.use_anim, table_entry.use_anim, false, 0.7, true, true, table_entry.use_nav )
message( "CRIB_SHIP_HACK_BEGIN", 2 )
delay( 2.5 )
if ( hack_attempt >= 1 and hack_attempt <= 30 ) then
message( "CRIB_SHIP_HACK_FAIL", 1.0 )
elseif ( hack_attempt > 30 and hack_attempt <= 75 ) then
message( "CRIB_SHIP_HACK_SUCCESS", 1.0 )
delay(1)
cash_add( 25, LOCAL_PLAYER )
elseif ( hack_attempt > 75 and hack_attempt <= 95 ) then
message( "CRIB_SHIP_HACK_SUCCESS", 1.0 )
delay(1)
cash_add( 50, LOCAL_PLAYER )
elseif ( hack_attempt > 95 and hack_attempt <= 100 ) then
message( "CRIB_SHIP_HACK_SUCCESS", 1.0 )
delay(1)
cash_add( 1000, LOCAL_PLAYER )
end
trigger_enable( trigger, false )
end
]]
-- text adventure completion variable
Ship_UI_completion = {}
-- get the trigger table from the trigger name
--
-- trigger: (string) trigger name
--
function crib_ship_trigger_get_table(trigger)
local trigger_table
for i,trig in pairs(sr4_5_city_trigger) do
if trig.name == trigger then
trigger_table = trig
end
end
return trigger_table
end
function crib_ship_trigger_cb( human, trigger )
-- This may be called multiple times in the same frame. Never create groups in a trigger callback. Use show group instead.
-- find this trigger
local table_entry = crib_ship_trigger_get_table( trigger )
if table_entry ~= nil then
if table_entry.hit == true then
return
end
table_entry.hit = true
table_entry.last_hit_by = human
on_trigger( "", table_entry.name )
trigger_enable( table_entry.name, false )
-- Conversation system link
if table_entry.conversation ~= nil and table_entry.conversation ~= "" then
convo_start(table_entry.conversation)
end
end
end
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++)
function hub_loaded( )
convo_startup(sr4_5_city_convo)
for i, trig in pairs(sr4_5_city_trigger) do
if trig.callback == nil or trig.callback == "" then
on_trigger( "crib_ship_trigger_cb", trig.name )
else
on_trigger( trig.callback, trig.name )
end
trig.hit = false
trig.last_hit_by = nil
end
trigger_enable (sr4_5_city_trigger.start_txt_adventure.name, true)
--trigger_enable (sr4_5_city_trigger.hack_cargo.name, true)
-- reset global vars needed for each crib ship visit
for i, num_talks in pairs(sr4_5_city_CRIBSHIP_num_talks) do
sr4_5_city_CRIBSHIP_num_talks[i] = 0
end
for i, sex_flag in pairs(sr4_5_city_CRIBSHIP_sex_flags) do
sr4_5_city_CRIBSHIP_sex_flags[i] = false
end
sr4_5_city_homie_setup_wrapper()
end
--set up homies wrapper function; decide which action nodes to use
function sr4_5_city_homie_setup_wrapper()
------ KINZIE ------
local kinzie_node = nil
if mission_is_complete( "m05" ) and not mission_is_complete( "m07" ) then
-- working on mech node
kinzie_node = sr4_5_city_ship_action_nodes.kinzie[1]
elseif mission_is_complete( "m07" ) and not mission_is_complete( "m10" ) then
-- beanbag, tube, or control room
local kinzie_idx = rand_int( 3, #sr4_5_city_ship_action_nodes.kinzie )
kinzie_node = sr4_5_city_ship_action_nodes.kinzie[kinzie_idx]
elseif mission_is_complete( "m17" ) and not mission_is_complete( "m19" ) then
-- nemo chair node
kinzie_node = sr4_5_city_ship_action_nodes.kinzie[2]
--mesh_mover_update_control( "nemo_rig_kinzie", "is nemo open", true )
--mesh_mover_update_control( "nemo_rig_kinzie", "closed restart", true )
else
-- beanbag or tube (NOT control room)
local kinzie_idx = rand_int( 4, #sr4_5_city_ship_action_nodes.kinzie )
kinzie_node = sr4_5_city_ship_action_nodes.kinzie[kinzie_idx]
end
sr4_5_city_homie_setup( "Kinzie_Group_001", "Kinzie_01", kinzie_node.talk_trig, kinzie_node.sex_trig, kinzie_node.contact_trig, kinzie_node.name, true )
------ VP ------
local vp_idx = nil
local vp_node = nil
if not mission_is_complete ( "m08" ) then
-- catwalk, bridge seat, or bridge stand
vp_idx = rand_int( 1 , #sr4_5_city_ship_action_nodes.vp )
vp_node = sr4_5_city_ship_action_nodes.vp[vp_idx]
sr4_5_city_homie_setup( "VP_Group_001", "VP_01", vp_node.talk_trig, vp_node.sex_trig, vp_node.contact_trig, vp_node.name, true )
elseif not mission_is_complete ( "m17" ) or mission_is_complete ( "m18" ) then
-- bridge seat or bridge stand (NOT catwalk)
vp_idx = rand_int( 2 , #sr4_5_city_ship_action_nodes.vp )
vp_node = sr4_5_city_ship_action_nodes.vp[vp_idx]
sr4_5_city_homie_setup( "VP_Group_001", "VP_01", vp_node.talk_trig, vp_node.sex_trig, vp_node.contact_trig, vp_node.name, true )
end
------ CID ------
if mission_is_complete( "m05" ) then
local cid_node = sr4_5_city_ship_action_nodes.cid[1]
sr4_5_city_homie_setup( "CID_Group_001", "CID_01", cid_node.talk_trig, cid_node.sex_trig, cid_node.contact_trig, cid_node.name, true )
end
------ MATT MILLER ------
if mission_is_complete( "m07" ) then
local matt_node = nil
local matt_idx = nil
if not mission_is_complete( "m18" ) or mission_is_complete( "m19" ) then
-- anywhere EXCEPT control room
matt_idx = rand_int( 2, #sr4_5_city_ship_action_nodes.matt )
matt_node = sr4_5_city_ship_action_nodes.matt[matt_idx]
else
-- m18 complete, m19 not complete - control room
matt_node = sr4_5_city_ship_action_nodes.matt[1]
end
sr4_5_city_homie_setup( "Matt_Miller_Group_001", "Matt_Miller_01", matt_node.talk_trig, matt_node.sex_trig, matt_node.contact_trig, matt_node.name, true )
end
------ SHAUNDI ------
if mission_is_complete( "m08" ) then
local shaundi_idx = nil
local shaundi_node = nil
if not mission_is_complete( "m10" ) then
-- catwalk
shaundi_node = sr4_5_city_ship_action_nodes.shaundi[2]
elseif mission_is_complete( "m10" ) and not mission_is_complete( "m14" ) then
-- control room
shaundi_node = sr4_5_city_ship_action_nodes.shaundi[1]
elseif mission_is_complete( "m14" ) and not mission_is_complete( "m19" ) then
-- any on bridge
shaundi_idx = rand_int( 3 , #sr4_5_city_ship_action_nodes.shaundi )
shaundi_node = sr4_5_city_ship_action_nodes.shaundi[shaundi_idx]
elseif mission_is_complete( "m19" ) then
-- control room
shaundi_node = sr4_5_city_ship_action_nodes.shaundi[1]
end
sr4_5_city_homie_setup( "Shaundi_Group_001", "Shaundi_01", shaundi_node.talk_trig, shaundi_node.sex_trig, shaundi_node.contact_trig, shaundi_node.name, true )
end
------ PIERCE ------
if mission_is_complete( "m09" ) then
local pierce_idx = rand_int( 1 , #sr4_5_city_ship_action_nodes.pierce )
local pierce_node = sr4_5_city_ship_action_nodes.pierce[pierce_idx]
sr4_5_city_homie_setup( "Pierce_Group_001", "Pierce_01", pierce_node.talk_trig, pierce_node.sex_trig, pierce_node.contact_trig, pierce_node.name, true )
end
------ BEN KING ------
if mission_is_complete( "m10" ) then
local benking_idx = rand_int( 1 , #sr4_5_city_ship_action_nodes.benking )
local benking_node = sr4_5_city_ship_action_nodes.benking[benking_idx]
sr4_5_city_homie_setup( "Ben_King_Group_001", "Ben_King_01", benking_node.talk_trig, benking_node.sex_trig, benking_node.contact_trig, benking_node.name, true )
end
------ ASHA ------
if mission_is_complete( "m11" ) then
local asha_idx = rand_int( 1 , #sr4_5_city_ship_action_nodes.asha )
local asha_node = sr4_5_city_ship_action_nodes.asha[asha_idx]
sr4_5_city_homie_setup( "Asha_Group_001", "Asha_01", asha_node.talk_trig, asha_node.sex_trig, asha_node.contact_trig, asha_node.name, true )
end
------ GAT ------
if mission_is_complete( "m15_3" ) then
local gat_idx = rand_int( 1 , #sr4_5_city_ship_action_nodes.gat )
local gat_node = sr4_5_city_ship_action_nodes.gat[gat_idx]
sr4_5_city_homie_setup( "Johnny_Gat_Group_001", "Johnny_Gat_01", gat_node.talk_trig, gat_node.sex_trig, gat_node.contact_trig, gat_node.name, true )
end
end
--set up homies for crib ship -- group, triggers, action node
function sr4_5_city_homie_setup( group, npc, talk_trig, sex_trig, contact_trig, action_node, teleport_bool )
if not group_is_loaded(group) then
group_create( group )
end
if (talk_trig ~= nil) then
trigger_enable( talk_trig, true )
end
if (sex_trig ~= nil) then
trigger_enable( sex_trig, true )
trigger_copy_pos_from( sex_trig, talk_trig ) -- move sex trigger to same position as talk trigger
end
if (action_node ~= nil) then
npc_use_closest_action_node_of_type( npc, action_node, 200, teleport_bool )
end
if (contact_trig ~= nil) then
trigger_copy_pos_from( contact_trig, talk_trig ) -- move contact trigger to same position as talk trigger
end
end
-- ALL FOLLOWING COOP SKIP FUNCTIONS CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++)
-- Teleport players to a mission start node
--
-- mission_name: (string) name of the mission start node (should be same as mission name)
-- skip_teleport: (boolean) true to basically skip this whole function, nil or not true will run it
--
function sr3_teleport_mission_start(mission_name, skip_teleport)
if skip_teleport == nil or skip_teleport ~= true then
-- send them to the mission start
local vehicle_exit = true
local offset_x = 0.5
teleport_to_object(LOCAL_PLAYER, mission_name, vehicle_exit, nil, offset_x)
-- remote player not on top of player
offset_x = -0.5
teleport_to_object(REMOTE_PLAYER, mission_name, vehicle_exit, nil, offset_x)
end
end
function ship_use_trigger_cb(human, trigger)
-- do default trigger behavior
-- trigger_cb(human, trigger)
local trigger_table = trigger_get_table(trigger)
if trigger_table.use_anim ~= nil and trigger_table.use_anim ~= "" then
local anim_name = trigger_table.use_anim
local morph_name = anim_name
local force_play = false
local percentage = 0.8
local stand_still = true
local zero_movement = true
action_play(human, anim_name, morph_name, force_play, percentage, stand_still, zero_movement, trigger_table.use_nav)
end
end
-- start the text adventure
--
-- human: (string) name of human that tripped the trigger
-- trigger: (string) name of the trigger
--
function ship_start_text_adventure_cb(human, trigger)
-- find this trigger
local table_entry = crib_ship_trigger_get_table( trigger )
if table_entry ~= nil then
if table_entry.hit == true then
return
end
table_entry.hit = true
table_entry.last_hit_by = LOCAL_PLAYER
on_trigger( "", table_entry.name )
trigger_enable( table_entry.name, false )
-- play anim
action_play( LOCAL_PLAYER, table_entry.use_anim, table_entry.use_anim, false, 0.9, true, true, table_entry.use_nav )
-- start the text adventure and hook up a callback to know when they're done
Ship_UI_completion[ LOCAL_PLAYER ] = false
hud_push_screen( "col_main", SYNC_LOCAL )
--on_hud_screen_exit( "ship_UI_text_complete_cb", "col_main" )
player_controls_disable(LOCAL_PLAYER)
-- wait until player exits screen
while hud_is_screen_on_stack( "col_main" ) do
thread_yield()
end
--[[
while not Ship_UI_completion[ LOCAL_PLAYER ] do
thread_yield()
end
]]
-- re-enable trigger
table_entry.hit = false
on_trigger( "ship_start_text_adventure_cb", table_entry.name )
trigger_enable( table_entry.name, true )
player_controls_enable( LOCAL_PLAYER )
Ship_UI_completion[ LOCAL_PLAYER ] = true
end
end
--[[
-- callback to handle text adventure being completed
--
-- screen_name: (string) screen completed
-- player_name: (string) player using the screen
--
function ship_UI_text_complete_cb( screen_name, player_name )
if (screen_name ~= "col_main") then
return
end
player_controls_enable( player_name )
-- flag the player as completed
Ship_UI_completion[ player_name ] = true
end
]]