Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/shiptest-ss13/Shiptest in…
Browse files Browse the repository at this point in the history
…to mission
  • Loading branch information
FalloutFalcon committed Jan 20, 2025
2 parents c3d4dfd + d0d8997 commit 9850bb0
Show file tree
Hide file tree
Showing 147 changed files with 2,919 additions and 940 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/DNA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
#define TR_KEEPORGANS (1<<8)
#define TR_KEEPSTUNS (1<<9)
#define TR_KEEPREAGENTS (1<<10)
#define TR_KEEPAI (1<<11)

//species traits for mutantraces
#define MUTCOLORS 1
Expand Down
81 changes: 81 additions & 0 deletions code/__DEFINES/ai/ai.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#define GET_AI_BEHAVIOR(behavior_type) SSai_behaviors.ai_behaviors[behavior_type]
#define HAS_AI_CONTROLLER_TYPE(thing, type) istype(thing?.ai_controller, type)

#define AI_STATUS_ON 1
#define AI_STATUS_OFF 2


///Monkey checks
#define SHOULD_RESIST(source) (source.on_fire || source.buckled || HAS_TRAIT(source, TRAIT_RESTRAINED) || (source.pulledby && source.pulledby.grab_state > GRAB_PASSIVE))
#define IS_DEAD_OR_INCAP(source) (HAS_TRAIT(source, TRAIT_INCAPACITATED) || HAS_TRAIT(source, TRAIT_HANDS_BLOCKED) || IS_IN_STASIS(source))

///For JPS pathing, the maximum length of a path we'll try to generate. Should be modularized depending on what we're doing later on
#define AI_MAX_PATH_LENGTH 30 // 30 is possibly overkill since by default we lose interest after 14 tiles of distance, but this gives wiggle room for weaving around obstacles

///Cooldown on planning if planning failed last time
#define AI_FAILED_PLANNING_COOLDOWN 1.5 SECONDS

///Flags for ai_behavior new()
#define AI_CONTROLLER_INCOMPATIBLE (1<<0)

///Does this task require movement from the AI before it can be performed?
#define AI_BEHAVIOR_REQUIRE_MOVEMENT (1<<0)
///Does this task let you perform the action while you move closer? (Things like moving and shooting)
#define AI_BEHAVIOR_MOVE_AND_PERFORM (1<<1)

///Subtree defines

///This subtree should cancel any further planning, (Including from other subtrees)
#define SUBTREE_RETURN_FINISH_PLANNING 1

///Monkey AI controller blackboard keys

#define BB_MONKEY_AGRESSIVE "BB_monkey_agressive"
#define BB_MONKEY_GUN_NEURONS_ACTIVATED "BB_monkey_gun_aware"
#define BB_MONKEY_GUN_WORKED "BB_monkey_gun_worked"
#define BB_MONKEY_BEST_FORCE_FOUND "BB_monkey_bestforcefound"
#define BB_MONKEY_ENEMIES "BB_monkey_enemies"
#define BB_MONKEY_BLACKLISTITEMS "BB_monkey_blacklistitems"
#define BB_MONKEY_PICKUPTARGET "BB_monkey_pickuptarget"
#define BB_MONKEY_PICKPOCKETING "BB_monkey_pickpocketing"
#define BB_MONKEY_CURRENT_ATTACK_TARGET "BB_monkey_current_attack_target"
#define BB_MONKEY_TARGET_DISPOSAL "BB_monkey_target_disposal"
#define BB_MONKEY_DISPOSING "BB_monkey_disposing"
#define BB_MONKEY_RECRUIT_COOLDOWN "BB_monkey_recruit_cooldown"
#define BB_MONKEY_NEXT_HUNGRY "BB_monkey_next_hungry"

///Dog AI controller blackboard keys

#define BB_SIMPLE_CARRY_ITEM "BB_SIMPLE_CARRY_ITEM"
#define BB_FETCH_TARGET "BB_FETCH_TARGET"
#define BB_FETCH_IGNORE_LIST "BB_FETCH_IGNORE_LISTlist"
#define BB_FETCH_DELIVER_TO "BB_FETCH_DELIVER_TO"
#define BB_DOG_FRIENDS "BB_DOG_FRIENDS"
#define BB_DOG_ORDER_MODE "BB_DOG_ORDER_MODE"
#define BB_DOG_PLAYING_DEAD "BB_DOG_PLAYING_DEAD"
#define BB_DOG_HARASS_TARGET "BB_DOG_HARASS_TARGET"

/// Basically, what is our vision/hearing range for picking up on things to fetch/
#define AI_DOG_VISION_RANGE 10
/// What are the odds someone petting us will become our friend?
#define AI_DOG_PET_FRIEND_PROB 15
/// After this long without having fetched something, we clear our ignore list
#define AI_FETCH_IGNORE_DURATION 30 SECONDS
/// After being ordered to heel, we spend this long chilling out
#define AI_DOG_HEEL_DURATION 20 SECONDS
/// After either being given a verbal order or a pointing order, ignore further of each for this duration
#define AI_DOG_COMMAND_COOLDOWN 2 SECONDS

// dog command modes (what pointing at something/someone does depending on the last order the dog heard)
/// Don't do anything (will still react to stuff around them though)
#define DOG_COMMAND_NONE 0
/// Will try to pick up and bring back whatever you point to
#define DOG_COMMAND_FETCH 1
/// Will get within a few tiles of whatever you point at and continually growl/bark. If the target is a living mob who gets too close, the dog will attack them with bites
#define DOG_COMMAND_ATTACK 2

//enumerators for parsing dog command speech
#define COMMAND_HEEL "Heel"
#define COMMAND_FETCH "Fetch"
#define COMMAND_ATTACK "Attack"
#define COMMAND_DIE "Play Dead"
6 changes: 5 additions & 1 deletion code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@
/// Used for debug messages to the server
#define debug2_world_log(msg) if (GLOB.Debug2) log_world("DEBUG: [msg]")
/// Adds a generic box around whatever message you're sending in chat. Really makes things stand out.
#define examine_block(str) ("<div class='examine_block'>" + str + "</div>")
#define boxed_message(str) ("<div class='boxed_message'>" + str + "</div>")
/// Adds a box around whatever message you're sending in chat. Can apply color and/or additional classes. Available colors: red, green, blue, purple. Use it like red_box
#define custom_boxed_message(classes, str) ("<div class='boxed_message " + classes + "'>" + str + "</div>")
/// Makes a fieldset with a neaty styled name. Can apply additional classes.
#define fieldset_block(title, content, classes) ("<fieldset class='fieldset " + classes + "'><legend class='fieldset_legend'>" + title + "</legend>" + content + "</fieldset>")
12 changes: 12 additions & 0 deletions code/__DEFINES/dcs/signals/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#define COMSIG_GLOB_BUTTON_PRESSED "!button_pressed"
/// a client (re)connected, after all /client/New() checks have passed : (client/connected_client)
#define COMSIG_GLOB_CLIENT_CONNECT "!client_connect"
/// a person somewhere has thrown something : (mob/living/carbon/carbon_thrower, target)
#define COMSIG_GLOB_CARBON_THROW_THING "!throw_thing"

// signals from globally accessible objects
/// from SSsun when the sun changes position : (azimuth)
Expand Down Expand Up @@ -215,6 +217,9 @@
///from base of atom/set_opacity(): (new_opacity)
#define COMSIG_ATOM_SET_OPACITY "atom_set_opacity"

///from base of atom/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
#define COMSIG_ATOM_HITBY "atom_hitby"

/// from base of /atom/movable/proc/on_virtual_z_change(): (new_virtual_z, old_virtual_z)
#define COMSIG_ATOM_VIRTUAL_Z_CHANGE "atom_virtual_z_change"

Expand Down Expand Up @@ -261,6 +266,7 @@
#define COMSIG_CLICK_CTRL "ctrl_click"
//from base of atom/AltClick(): (/mob)
#define COMSIG_CLICK_ALT "alt_click"
#define COMPONENT_CANCEL_CLICK_ALT (1<<0)
//from base of atom/CtrlShiftClick(/mob)
#define COMSIG_CLICK_CTRL_SHIFT "ctrl_shift_click"
///from base of atom/CtrlShiftRightClick(/mob)
Expand Down Expand Up @@ -320,6 +326,8 @@
#define COMPONENT_CANCEL_THROW (1<<0)
///from base of atom/movable/throw_at(): (datum/thrownthing, spin)
#define COMSIG_MOVABLE_POST_THROW "movable_post_throw"
///from base of datum/thrownthing/finalize(): (obj/thrown_object, datum/thrownthing) used for when a throw is finished
#define COMSIG_MOVABLE_THROW_LANDED "movable_throw_landed"
///from base of atom/movable/onTransitZ(): (old_z, new_z)
#define COMSIG_MOVABLE_Z_CHANGED "movable_ztransit"
///called when the movable is placed in an unaccessible area, used for shiploving: ()
Expand Down Expand Up @@ -425,6 +433,8 @@
#define COMSIG_MOB_ITEM_ATTACK_QDELETED "mob_item_attack_qdeleted"
///from base of mob/RangedAttack(): (atom/A, params)
#define COMSIG_MOB_ATTACK_RANGED "mob_attack_ranged"
///From base of mob/update_movespeed():area
#define COMSIG_MOB_MOVESPEED_UPDATED "mob_update_movespeed"
///from base of /mob/throw_item(): (atom/target)
#define COMSIG_MOB_THROW "mob_throw"
///from base of /mob/verb/examinate(): (atom/target)
Expand Down Expand Up @@ -487,6 +497,8 @@
#define COMSIG_LIVING_DROP_LIMB "living_drop_limb"
///from base of mob/living/set_buckled(): (new_buckled)
#define COMSIG_LIVING_SET_BUCKLED "living_set_buckled"
///From post-can inject check of syringe after attack (mob/user)
#define COMSIG_LIVING_TRY_SYRINGE "living_try_syringe"

///sent from borg recharge stations: (amount, repairs)
#define COMSIG_PROCESS_BORGCHARGER_OCCUPANT "living_charge"
Expand Down
64 changes: 34 additions & 30 deletions code/__DEFINES/monkeys.dm
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
//Monkey defines, placed here so they can be read by other things!

//Mode defines
#define MONKEY_IDLE 0 // idle
#define MONKEY_HUNT 1 // found target, hunting
#define MONKEY_FLEE 2 // free from enemies
#define MONKEY_DISPOSE 3 // dump body in disposals

#define MONKEY_FLEE_HEALTH 50 // below this health value the monkey starts to flee from enemies
#define MONKEY_ENEMY_VISION 9 // how close an enemy must be to trigger aggression
#define MONKEY_FLEE_VISION 4 // how close an enemy must be before it triggers flee
#define MONKEY_ITEM_SNATCH_DELAY 25 // How long does it take the item to be taken from a mobs hand
#define MONKEY_CUFF_RETALIATION_PROB 20 // Probability monkey will aggro when cuffed
#define MONKEY_SYRINGE_RETALIATION_PROB 20 // Probability monkey will aggro when syringed
/// below this health value the monkey starts to flee from enemies
#define MONKEY_FLEE_HEALTH 50
/// how close an enemy must be to trigger aggression
#define MONKEY_ENEMY_VISION 9
/// how close an enemy must be before it triggers flee
#define MONKEY_FLEE_VISION 4
/// How long does it take the item to be taken from a mobs hand
#define MONKEY_ITEM_SNATCH_DELAY 25
/// Probability monkey will aggro when cuffed
#define MONKEY_CUFF_RETALIATION_PROB 20
/// Probability monkey will aggro when syringed
#define MONKEY_SYRINGE_RETALIATION_PROB 20

// Probability per Life tick that the monkey will:
#define MONKEY_RESIST_PROB 50 // resist out of restraints
// when the monkey is idle
#define MONKEY_PULL_AGGRO_PROB 5 // aggro against the mob pulling it
#define MONKEY_SHENANIGAN_PROB 5 // chance of getting into mischief, i.e. finding/stealing items
// when the monkey is hunting
#define MONKEY_ATTACK_DISARM_PROB 50 // disarm an armed attacker
#define MONKEY_WEAPON_PROB 20 // if not currently getting an item, search for a weapon around it
#define MONKEY_RECRUIT_PROB 25 // recruit a monkey near it
#define MONKEY_SWITCH_TARGET_PROB 25 // switch targets if it sees another enemy

#define MONKEY_RETALIATE_HARM_PROB 95 // probability for the monkey to aggro when attacked with harm intent
#define MONKEY_RETALIATE_DISARM_PROB 20 // probability for the monkey to aggro when attacked with disarm intent
/// probability that monkey resist out of restraints
#define MONKEY_RESIST_PROB 50
/// probability that monkey aggro against the mob pulling it
#define MONKEY_PULL_AGGRO_PROB 5
/// probability that monkey will get into mischief, i.e. finding/stealing items
#define MONKEY_SHENANIGAN_PROB 20
/// probability that monkey will disarm an armed attacker
#define MONKEY_ATTACK_DISARM_PROB 50
/// probability that monkey will get recruited when friend is attacked
#define MONKEY_RECRUIT_PROB 25

#define MONKEY_HATRED_AMOUNT 4 // amount of aggro to add to an enemy when they attack user
#define MONKEY_HATRED_REDUCTION_PROB 25 // probability of reducing aggro by one when the monkey attacks
/// probability for the monkey to aggro when attacked with harm intent
#define MONKEY_RETALIATE_HARM_PROB 95
/// probability for the monkey to aggro when attacked with disarm intent
#define MONKEY_RETALIATE_DISARM_PROB 20

// how many Life ticks the monkey will fail to:
#define MONKEY_HUNT_FRUSTRATION_LIMIT 8 // Chase after an enemy before giving up
#define MONKEY_DISPOSE_FRUSTRATION_LIMIT 16 // Dispose of a body before giving up
/// amount of aggro to add to an enemy when they attack user
#define MONKEY_HATRED_AMOUNT 4
/// amount of aggro to add to an enemy when a monkey is recruited
#define MONKEY_RECRUIT_HATED_AMOUNT 2
/// probability of reducing aggro by one when the monkey attacks
#define MONKEY_HATRED_REDUCTION_PROB 20

#define MONKEY_AGGRESSIVE_MVM_PROB 0 // If you mass edit monkies to be aggressive. there is a small chance of in-fighting
///Monkey recruit cooldown
#define MONKEY_RECRUIT_COOLDOWN 1 MINUTES
4 changes: 4 additions & 0 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@
#define INIT_ORDER_EVENTS 70
#define INIT_ORDER_JOBS 65
#define INIT_ORDER_QUIRKS 60
#define INIT_ORDER_AI_MOVEMENT 57 //We need the movement setup
#define INIT_ORDER_AI_CONTROLLERS 56 //So the controller can get the ref
#define INIT_ORDER_TICKER 55
#define INIT_ORDER_FACTION 53
#define INIT_ORDER_MAPPING 50
Expand Down Expand Up @@ -164,6 +166,8 @@
#define FIRE_PRIORITY_WET_FLOORS 20
#define FIRE_PRIORITY_AIR 20
#define FIRE_PRIORITY_NPC 20
#define FIRE_PRIORITY_NPC_MOVEMENT 21
#define FIRE_PRIORITY_NPC_ACTIONS 22
#define FIRE_PRIORITY_PROCESS 25
#define FIRE_PRIORITY_THROWING 25
#define FIRE_PRIORITY_SPACEDRIFT 30
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_PACIFISM "pacifism"
#define TRAIT_IGNORESLOWDOWN "ignoreslow"
#define TRAIT_IGNOREDAMAGESLOWDOWN "ignoredamageslowdown"
/// Makes it so the mob can use guns regardless of tool user status
#define TRAIT_GUN_NATURAL "gunnatural"
#define TRAIT_DEATHCOMA "deathcoma" //Causes death-like unconsciousness
#define TRAIT_FAKEDEATH "fakedeath" //Makes the owner appear as dead to most forms of medical examination
#define TRAIT_DISFIGURED "disfigured"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/vv.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define VV_BITFIELD "Bitfield"
#define VV_TEXT_LOCATE "Custom Reference Locate"
#define VV_PROCCALL_RETVAL "Return Value of Proccall"
#define VV_HK_ADD_AI "add_ai"

#define VV_MSG_MARKED "<br><font size='1' color='red'><b>Marked Object</b></font>"
#define VV_MSG_EDITED "<br><font size='1' color='red'><b>Var Edited</b></font>"
Expand Down
Loading

0 comments on commit 9850bb0

Please sign in to comment.