-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'PvE-CMSS13:master' into facehugger-funny
- Loading branch information
Showing
35 changed files
with
1,687 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
code/datums/components/xeno/ai_behavior_overrides/build_override_behavior.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
|
||
/datum/component/ai_behavior_override/build | ||
behavior_icon_state = "priority_move_order" | ||
|
||
max_assigned = 1 | ||
|
||
/datum/component/ai_behavior_override/build/Initialize(...) | ||
. = ..() | ||
|
||
if(istype(parent, /mob)) | ||
return COMPONENT_INCOMPATIBLE | ||
|
||
var/turf/open/location = get_turf(parent) | ||
if(location.is_weedable() != FULLY_WEEDABLE) | ||
return COMPONENT_INCOMPATIBLE | ||
|
||
/datum/component/ai_behavior_override/build/Destroy(force, silent, ...) | ||
var/turf/parent_turf = get_turf(parent) | ||
if(QDELETED(parent) && parent_turf != parent) | ||
parent_turf.AddComponent(/datum/component/ai_behavior_override/build) | ||
|
||
return ..() | ||
|
||
/datum/component/ai_behavior_override/build/check_behavior_validity(mob/living/carbon/xenomorph/checked_xeno, distance) | ||
. = ..() | ||
if(!.) | ||
return | ||
|
||
var/turf/open/location = get_turf(parent) | ||
if(!istype(location)) | ||
qdel(src) | ||
return FALSE | ||
|
||
if(locate(/obj/structure/mineral_door/resin) in location) | ||
qdel(src) | ||
return FALSE | ||
|
||
if(distance > 10) | ||
return FALSE | ||
|
||
if(checked_xeno.current_target) | ||
return FALSE | ||
|
||
if(!locate(/datum/action/xeno_action/activable/secrete_resin) in checked_xeno.actions) | ||
return FALSE | ||
|
||
if(checked_xeno.get_plasma_percentage() < PLASMA_RETREAT_PERCENTAGE) | ||
var/turf/xeno_loc = get_turf(checked_xeno) | ||
if(xeno_loc.weeds && !checked_xeno.resting) | ||
currently_assigned -= checked_xeno | ||
checked_xeno.lay_down() | ||
|
||
return FALSE | ||
|
||
return TRUE | ||
|
||
/datum/component/ai_behavior_override/build/process_override_behavior(mob/living/carbon/xenomorph/processing_xeno, delta_time) | ||
. = ..() | ||
if(!.) | ||
return | ||
|
||
processing_xeno.resting = FALSE | ||
|
||
var/turf/xeno_loc = get_turf(processing_xeno) | ||
if(xeno_loc.density) | ||
return FALSE // We shouldn't stand in a wall, let's act default | ||
|
||
var/turf/parent_turf = get_turf(parent) | ||
|
||
var/is_diagonal = (get_dir(processing_xeno, parent_turf) in diagonals) | ||
if(is_diagonal || get_dist(processing_xeno, parent) > 1) | ||
return processing_xeno.move_to_next_turf(parent_turf) | ||
|
||
for(var/obj/structure/blocker in parent_turf.contents) | ||
if(!blocker.unslashable && blocker.density || istype(blocker, /obj/structure/bed)) | ||
INVOKE_ASYNC(processing_xeno, TYPE_PROC_REF(/mob, do_click), blocker, "", list()) | ||
return TRUE | ||
|
||
if(!parent_turf.weeds) | ||
var/datum/action/xeno_action/onclick/plant_weeds/weeds_action = locate() in processing_xeno.actions | ||
INVOKE_ASYNC(weeds_action, TYPE_PROC_REF(/datum/action/xeno_action/onclick/plant_weeds, use_ability_wrapper)) | ||
return TRUE | ||
|
||
var/list/resin_types = processing_xeno.resin_build_order | ||
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_turf/wall) in resin_types | ||
|
||
var/wall_nearby | ||
var/blocked_turfs = 0 | ||
for(var/turf/blocked_turf in orange(1, parent_turf) - parent_turf.AdjacentTurfs()) | ||
if(get_dir(blocked_turf, parent_turf) in diagonals) | ||
continue | ||
|
||
if(blocked_turf.density) | ||
wall_nearby = TRUE | ||
|
||
blocked_turfs++ | ||
|
||
if(blocked_turfs) | ||
if(prob(XENO_DOOR_BUILDING_CHANCE) || (wall_nearby && blocked_turfs == 2)) | ||
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_obj/door) in resin_types | ||
|
||
var/datum/action/xeno_action/activable/secrete_resin/build_action = locate() in processing_xeno.actions | ||
INVOKE_ASYNC(build_action, TYPE_PROC_REF(/datum/action/xeno_action/activable/secrete_resin, use_ability_wrapper), parent_turf) | ||
return TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
code/modules/admin/game_master/extra_buttons/rappel_menu.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
GLOBAL_LIST_EMPTY(game_master_rappels) | ||
GLOBAL_DATUM_INIT(rappel_panel, /datum/rappel_menu, new) | ||
#define RAPPEL_CLICK_INTERCEPT_ACTION "rappel_click_intercept_action" | ||
|
||
/client/proc/toggle_rappel_menu() | ||
set name = "Rappel Menu" | ||
set category = "Game Master.Extras" | ||
if(!check_rights(R_ADMIN)) | ||
return | ||
|
||
GLOB.rappel_panel.tgui_interact(mob) | ||
|
||
/datum/rappel_menu | ||
var/rappel_click_intercept = FALSE | ||
|
||
/datum/rappel_menu/ui_data(mob/user) | ||
. = ..() | ||
|
||
var/list/data = list() | ||
|
||
data["game_master_rappels"] = length(GLOB.game_master_rappels) ? GLOB.game_master_rappels : "" | ||
data["rappel_click_intercept"] = rappel_click_intercept | ||
return data | ||
|
||
/datum/rappel_menu/proc/InterceptClickOn(mob/user, params, atom/object) | ||
var/list/modifiers = params2list(params) | ||
if(rappel_click_intercept) | ||
var/turf/object_turf = get_turf(object) | ||
if(LAZYACCESS(modifiers, MIDDLE_CLICK)) | ||
for(var/obj/effect/landmark/rappel/R in object_turf) | ||
GLOB.game_master_rappels -= R | ||
QDEL_NULL(R) | ||
return TRUE | ||
|
||
var/obj/effect/landmark/rappel/rappel = new(object_turf) | ||
var/rappel_ref = REF(rappel) | ||
GLOB.game_master_rappels += list(list( | ||
"rappel" = rappel, | ||
"rappel_name" = rappel.name, | ||
"rappel_ref" = rappel_ref, | ||
)) | ||
return TRUE | ||
|
||
/datum/rappel_menu/tgui_interact(mob/user, datum/tgui/ui) | ||
ui = SStgui.try_update_ui(user, src, ui) | ||
if(!ui) | ||
ui = new(user, src, "GameMasterRappelMenu", "Rappel Menu") | ||
ui.open() | ||
user.client?.click_intercept = src | ||
/datum/rappel_menu/ui_status(mob/user, datum/ui_state/state) | ||
return UI_INTERACTIVE | ||
|
||
|
||
/datum/rappel_menu/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) | ||
. = ..() | ||
|
||
switch(action) | ||
if("remove_rappel") | ||
if(!params["val"]) | ||
return | ||
|
||
var/list/rappel = params["val"] | ||
|
||
var/atom/rappel_atom = locate(rappel["rappel_ref"]) | ||
|
||
if(!rappel_atom) | ||
return TRUE | ||
|
||
if(tgui_alert(ui.user, "Do you want to remove [rappel_atom] ?", "Confirmation", list("Yes", "No")) != "Yes") | ||
return TRUE | ||
|
||
remove_rappel(rappel_atom) | ||
|
||
if("jump_to_rappel") | ||
if(!params["val"]) | ||
return | ||
|
||
var/list/rappel = params["val"] | ||
|
||
var/atom/rappel_atom = locate(rappel["rappel_ref"]) | ||
|
||
var/turf/rappel_turf = get_turf(rappel_atom) | ||
|
||
if(!rappel_turf) | ||
return TRUE | ||
|
||
var/client/jumping_client = ui.user.client | ||
jumping_client.jump_to_turf(rappel_turf) | ||
return TRUE | ||
|
||
if("toggle_click_rappel") | ||
rappel_click_intercept = !rappel_click_intercept | ||
return | ||
|
||
/datum/rappel_menu/ui_close(mob/user) | ||
var/client/user_client = user.client | ||
if(user_client?.click_intercept == src) | ||
user_client.click_intercept = null | ||
|
||
rappel_click_intercept = FALSE | ||
|
||
/datum/rappel_menu/proc/remove_rappel(obj/removing_datum) | ||
SIGNAL_HANDLER | ||
|
||
for(var/list/cycled_rappel in GLOB.game_master_rappels) | ||
if(cycled_rappel["rappel"] == removing_datum) | ||
GLOB.game_master_rappels.Remove(list(cycled_rappel)) | ||
QDEL_NULL(removing_datum) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.