-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: GOAI Urist port v2 #1414
base: baymerge-testing
Are you sure you want to change the base?
Changes from 17 commits
0b4b230
5fae411
b22e64a
c93692e
24e681b
da66baa
f2f4dcb
3ea1045
6272b57
683d25f
9786065
53be77a
b2676ca
cce8dbf
e6b8cb4
589deb0
95c75e4
c9916ec
048b598
a7fd634
8543191
c726fb5
a9d396c
707e899
9dde9df
8df4b58
02b770b
88799e6
be6d842
5423339
43899e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,10 +206,15 @@ | |
return TRUE | ||
|
||
/obj/structure/ladder/proc/climbLadder(mob/user, target_ladder, obj/item/I = null) | ||
to_world_log("[user] is climbing [target_ladder]") | ||
var/turf/T = get_turf(target_ladder) | ||
for(var/atom/A in T) | ||
if(A == user) | ||
continue | ||
|
||
if(!A.CanPass(user, user.loc, 1.5, 0)) | ||
to_chat(user, SPAN_NOTICE("\The [A] is blocking \the [src].")) | ||
to_world_log(SPAN_NOTICE("\The [A] is blocking \the [src].")) | ||
|
||
//We cannot use the ladder, but we probably can remove the obstruction | ||
var/atom/movable/M = A | ||
|
@@ -223,7 +228,9 @@ | |
|
||
playsound(src, pick(climbsounds), 50) | ||
playsound(target_ladder, pick(climbsounds), 50) | ||
return user.Move(T) | ||
var/result = user.Move(T) | ||
to_world_log("[user] has climbed [target_ladder] to [T] (Result: [result])") | ||
return result | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, dev changes, will revert |
||
|
||
/obj/structure/ladder/CanPass(obj/mover, turf/source, height, airflow) | ||
return airflow || !density | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# define GOAI_LIBRARY_FEATURES TRUE |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# define GOAI_SS13_SUPPORT TRUE | ||
|
||
// Where relevant, suppress SS13 native AI logic once GOAI is attached | ||
# define GOAI_DELETE_SS13_AI 1 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DEVJUNK: Feel free to ignore this. This is a port of SS13 code to the Dev repo. It's only here to make syncing between repos easier (can do copy/paste without unpicking individual files). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
# ifdef GOAI_LIBRARY_FEATURES | ||
// GOAI library copypasta, will be excluded at compile-time from SS13 code. | ||
|
||
#define PUBLIC_GAME_MODE SSticker.master_mode | ||
|
||
#define Clamp(value, low, high) (value <= low ? low : (value >= high ? high : value)) | ||
#define CLAMP01(x) (Clamp(x, 0, 1)) | ||
|
||
#define get_turf(A) get_step(A,0) | ||
|
||
#define get_x(A) (get_step(A, 0)?.x || 0) | ||
|
||
#define get_y(A) (get_step(A, 0)?.y || 0) | ||
|
||
#define get_z(A) (get_step(A, 0)?.z || 0) | ||
|
||
#define isAI(A) istype(A, /mob/living/silicon/ai) | ||
|
||
#define isalien(A) istype(A, /mob/living/carbon/alien) | ||
|
||
#define isanimal(A) istype(A, /mob/living/simple_animal) | ||
|
||
#define isairlock(A) istype(A, /obj/machinery/door/airlock) | ||
|
||
#define isatom(A) isloc(A) | ||
|
||
#define isbrain(A) istype(A, /mob/living/carbon/brain) | ||
|
||
#define iscarbon(A) istype(A, /mob/living/carbon) | ||
|
||
#define iscolorablegloves(A) (istype(A, /obj/item/clothing/gloves/color)||istype(A, /obj/item/clothing/gloves/insulated)||istype(A, /obj/item/clothing/gloves/thick)) | ||
|
||
#define isclient(A) istype(A, /client) | ||
|
||
#define iscorgi(A) istype(A, /mob/living/simple_animal/corgi) | ||
|
||
#define is_drone(A) istype(A, /mob/living/silicon/robot/drone) | ||
|
||
#define isEye(A) istype(A, /mob/observer/eye) | ||
|
||
#define ishuman(A) istype(A, /mob/living/carbon/human) | ||
|
||
#define isitem(A) istype(A, /obj/item) | ||
|
||
#define islist(A) istype(A, /list) | ||
|
||
#define isliving(A) istype(A, /mob/living) | ||
|
||
#define ismouse(A) istype(A, /mob/living/simple_animal/mouse) | ||
|
||
#define ismovable(A) istype(A, /atom/movable) | ||
|
||
#define isnewplayer(A) istype(A, /mob/new_player) | ||
|
||
#define isobj(A) istype(A, /obj) | ||
|
||
#define isghost(A) istype(A, /mob/observer/ghost) | ||
|
||
#define isobserver(A) istype(A, /mob/observer) | ||
|
||
#define isorgan(A) istype(A, /obj/item/organ/external) | ||
|
||
#define isstack(A) istype(A, /obj/item/stack) | ||
|
||
#define isspace(A) istype(A, /area/space) | ||
|
||
#define isplanet(A) istype(A, /area/planet) | ||
|
||
#define ispAI(A) istype(A, /mob/living/silicon/pai) | ||
|
||
#define isrobot(A) istype(A, /mob/living/silicon/robot) | ||
|
||
#define issilicon(A) istype(A, /mob/living/silicon) | ||
|
||
#define isslime(A) istype(A, /mob/living/carbon/slime) | ||
|
||
#define isunderwear(A) istype(A, /obj/item/underwear) | ||
|
||
#define isvirtualmob(A) istype(A, /mob/observer/virtual) | ||
|
||
#define isweakref(A) istype(A, /weakref) | ||
|
||
#define attack_animation(A) if(istype(A)) A.do_attack_animation(src) | ||
|
||
#define isopenspace(A) istype(A, /turf/simulated/open) | ||
|
||
#define isPlunger(A) istype(A, /obj/item/clothing/mask/plunger) || istype(A, /obj/item/device/plunger/robot) | ||
|
||
#define sequential_id(key) uniqueness_repository.Generate(/datum/uniqueness_generator/id_sequential, key) | ||
|
||
#define random_id(key,min_id,max_id) uniqueness_repository.Generate(/datum/uniqueness_generator/id_random, key, min_id, max_id) | ||
|
||
#define to_chat(target, message) target << (message) | ||
#define to_world(message) world << (message) | ||
#define to_world_log(message) world.log << (message) | ||
#define sound_to(target, sound) target << (sound) | ||
#define to_file(file_entry, source_var) file_entry << (source_var) | ||
#define from_file(file_entry, target_var) file_entry >> (target_var) | ||
#define show_browser(target, browser_content, browser_name) target << browse(browser_content, browser_name) | ||
#define close_browser(target, browser_name) target << browse(null, browser_name) | ||
#define show_image(target, image) target << (image) | ||
#define send_rsc(target, rsc_content, rsc_name) target << browse_rsc(rsc_content, rsc_name) | ||
#define open_link(target, url) target << link(url) | ||
|
||
#define MAP_IMAGE_PATH "nano/images/[using_map.path]/" | ||
|
||
#define map_image_file_name(z_level) "[using_map.path]-[z_level].png" | ||
|
||
#define RANDOM_BLOOD_TYPE pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") | ||
|
||
#define any2ref(x) "\ref[x]" | ||
|
||
#define CanInteract(user, state) (CanUseTopic(user, state) == STATUS_INTERACTIVE) | ||
|
||
#define CanDefaultInteract(user) (CanUseTopic(user, DefaultTopicState()) == STATUS_INTERACTIVE) | ||
|
||
#define CanInteractWith(user, target, state) (target.CanUseTopic(user, state) == STATUS_INTERACTIVE) | ||
|
||
#define CanPhysicallyInteract(user) CanInteract(user, physical_state) | ||
|
||
#define CanPhysicallyInteractWith(user, target) CanInteractWith(user, target, physical_state) | ||
|
||
#define QDEL_NULL_LIST(x) if(x) { for(var/y in x) { qdel(y) }}; if(x) {x.Cut(); x = null } // Second x check to handle items that LAZYREMOVE on qdel. | ||
|
||
#define QDEL_NULL(x) if(x) { qdel(x) ; x = null } | ||
|
||
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE) | ||
|
||
#define DROP_NULL(x) if(x) { x.dropInto(loc); x = null; } | ||
|
||
#define ARGS_DEBUG log_debug("[__FILE__] - [__LINE__]") ; for(var/arg in args) { log_debug("\t[log_info_line(arg)]") } | ||
|
||
// Helper macros to aid in optimizing lazy instantiation of lists. | ||
// All of these are null-safe, you can use them without knowing if the list var is initialized yet | ||
|
||
//Picks from the list, with some safeties, and returns the "default" arg if it fails | ||
#define DEFAULTPICK(L, default) ((istype(L, /list) && L:len) ? pick(L) : default) | ||
// Ensures L is initailized after this point | ||
#define LAZYINITLIST(L) if (!L) L = list() | ||
// Sets a L back to null iff it is empty | ||
#define UNSETEMPTY(L) if (L && !L.len) L = null | ||
// Removes I from list L, and sets I to null if it is now empty | ||
#define LAZYREMOVE(L, I) if(L) { L -= I; if(!length(L)) { L = null; } } | ||
// Adds I to L, initalizing L if necessary | ||
#define LAZYADD(L, I) if(!L) { L = list(); } L += I; | ||
// Insert I into L at position X, initalizing L if necessary | ||
#define LAZYINSERT(L, I, X) if(!L) { L = list(); } L.Insert(X, I); | ||
// Adds I to L, initalizing L if necessary, if I is not already in L | ||
#define LAZYDISTINCTADD(L, I) if(!L) { L = list(); } L |= I; | ||
// Sets L[A] to I, initalizing L if necessary | ||
#define LAZYSET(L, A, I) if(!L) { L = list(); } L[A] = I; | ||
// Reads I from L safely - Works with both associative and traditional lists. | ||
#define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= length(L) ? L[I] : null) : L[I]) : null) | ||
// Reads the length of L, returning 0 if null | ||
#define LAZYLEN(L) length(L) | ||
// Safely checks if I is in L | ||
#define LAZYISIN(L, I) (L ? (I in L) : FALSE) | ||
// Null-safe L.Cut() | ||
#define LAZYCLEARLIST(L) if(L) L.Cut() | ||
// Reads L or an empty list if L is not a list. Note: Does NOT assign, L may be an expression. | ||
#define SANITIZE_LIST(L) ( islist(L) ? L : list() ) | ||
|
||
// Insert an object A into a sorted list using cmp_proc (/code/_helpers/cmp.dm) for comparison. | ||
#define ADD_SORTED(list, A, cmp_proc) if(!list.len) {list.Add(A)} else {list.Insert(FindElementIndex(A, list, cmp_proc), A)} | ||
|
||
//Currently used in SDQL2 stuff | ||
#define send_output(target, msg, control) target << output(msg, control) | ||
#define send_link(target, url) target << link(url) | ||
|
||
// Spawns multiple objects of the same type | ||
#define cast_new(type, num, args...) if((num) == 1) { new type(args) } else { for(var/i=0;i<(num),i++) { new type(args) } } | ||
|
||
#define FLAGS_EQUALS(flag, flags) ((flag & (flags)) == (flags)) | ||
|
||
#define JOINTEXT(X) jointext(X, null) | ||
|
||
#define SPAN_NOTICE(X) "<span class='notice'>[X]</span>" | ||
|
||
#define SPAN_WARNING(X) "<span class='warning'>[X]</span>" | ||
|
||
#define SPAN_DANGER(X) "<span class='danger'>[X]</span>" | ||
|
||
# endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, dev changes, will revert