Skip to content

Commit

Permalink
Merge pull request #20 from NebulaSS13/dev
Browse files Browse the repository at this point in the history
Update from Neb dev.
  • Loading branch information
MistakeNot4892 authored Jul 10, 2024
2 parents 67c89c0 + 8106884 commit 53964bb
Show file tree
Hide file tree
Showing 249 changed files with 4,740 additions and 4,182 deletions.
22 changes: 22 additions & 0 deletions code/__defines/ai.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// TODO: FSM/decl based stances
#define STANCE_NONE /decl/mob_controller_stance/none
#define STANCE_IDLE /decl/mob_controller_stance/idle
#define STANCE_ALERT /decl/mob_controller_stance/alert
#define STANCE_ATTACK /decl/mob_controller_stance/attack
#define STANCE_ATTACKING /decl/mob_controller_stance/attacking
#define STANCE_TIRED /decl/mob_controller_stance/tired
#define STANCE_CONTAINED /decl/mob_controller_stance/contained
//basically 'do nothing'
#define STANCE_COMMANDED_STOP /decl/mob_controller_stance/commanded/stop
//follows a target
#define STANCE_COMMANDED_FOLLOW /decl/mob_controller_stance/commanded/follow
//catch all state for misc commands that need one.
#define STANCE_COMMANDED_MISC /decl/mob_controller_stance/commanded/misc
//we got healing powers yo
#define STANCE_COMMANDED_HEAL /decl/mob_controller_stance/commanded/heal
#define STANCE_COMMANDED_HEALING /decl/mob_controller_stance/commanded/healing

#define AI_ACTIVITY_IDLE 0
#define AI_ACTIVITY_MOVING_TO_TARGET 1
#define AI_ACTIVITY_BUILDING 2
#define AI_ACTIVITY_REPRODUCING 3
7 changes: 0 additions & 7 deletions code/__defines/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@
#define BORGXRAY BITFLAG(2)
#define BORGMATERIAL BITFLAG(3)

#define HOSTILE_STANCE_IDLE 1
#define HOSTILE_STANCE_ALERT 2
#define HOSTILE_STANCE_ATTACK 3
#define HOSTILE_STANCE_ATTACKING 4
#define HOSTILE_STANCE_TIRED 5
#define HOSTILE_STANCE_INSIDE 6

#define LEFT BITFLAG(0)
#define RIGHT BITFLAG(1)
#define UNDER BITFLAG(2)
Expand Down
2 changes: 1 addition & 1 deletion code/__defines/reactions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#define REACTION_TYPE_ALLOYING 2
#define REACTION_TYPE_COMPOUND 3
#define REACTION_TYPE_SYNTHESIS 4
#define REACTION_TYPE_RECIPE 5
#define REACTION_TYPE_RECIPE 5
12 changes: 10 additions & 2 deletions code/_helpers/auxtools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ var/global/auxtools_debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
/proc/enable_debugging(mode, port)
CRASH("auxtools not loaded")

/hook/startup/proc/auxtools_init()
/world/New()
auxtools_init()
return ..()

/world/proc/auxtools_init()
if (global.auxtools_debug_server)
call_ext(global.auxtools_debug_server, "auxtools_init")()
enable_debugging()
return TRUE

/hook/shutdown/proc/auxtools_shutdown()
/world/Del()
auxtools_shutdown()
return ..()

/world/proc/auxtools_shutdown()
if (global.auxtools_debug_server)
call_ext(global.auxtools_debug_server, "auxtools_shutdown")()
return TRUE
3 changes: 2 additions & 1 deletion code/_helpers/turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@
if(ignore_background && (source.turf_flags & TURF_FLAG_BACKGROUND))
continue
var/old_turf = source.prev_type || base_turf || get_base_turf_by_area(source)
source.ChangeTurf(old_turf, keep_air = !translate_air)
var/turf/changed = source.ChangeTurf(old_turf, keep_air = !translate_air)
changed.prev_type = null

//Transports a turf from a source turf to a target turf, moving all of the turf's contents and making the target a copy of the source.
//If ignore_background is set to true, turfs with TURF_FLAG_BACKGROUND set will only translate anchored contents.
Expand Down
1 change: 1 addition & 0 deletions code/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
#define SPAN_PINK(X) SPAN_CLASS("font_pink", X)
#define SPAN_PALEPINK(X) SPAN_CLASS("font_palepink", X)
#define SPAN_SINISTER(X) SPAN_CLASS("sinister", X)
#define SPAN_MODERATE(X) SPAN_CLASS("moderate", X)
// placeholders
#define SPAN_GOOD(X) SPAN_GREEN(X)
#define SPAN_NEUTRAL(X) SPAN_BLUE(X)
Expand Down
3 changes: 1 addition & 2 deletions code/_onclick/drag_drop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
// Receive a mouse drop.
// Returns false if the atom is valid for dropping further up the chain, true if the drop has been handled.
/atom/proc/receive_mouse_drop(atom/dropping, mob/user, params)
var/mob/living/H = user
if(istype(H) && !H.anchored && can_climb(H) && dropping == user)
if(isliving(user) && !user.anchored && can_climb(user) && dropping == user)
do_climb(dropping)
return TRUE
return FALSE
5 changes: 4 additions & 1 deletion code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ avoid code duplication. This includes items that may sometimes act as a standard
return TRUE
if(try_butcher_in_place(user, used_item))
return TRUE
return used_item.use_on_mob(src, user)
var/oldhealth = current_health
. = used_item.use_on_mob(src, user)
if(used_item.force && istype(ai) && current_health < oldhealth)
ai.retaliate(user)

/mob/living/human/attackby(obj/item/I, mob/user)

Expand Down
8 changes: 5 additions & 3 deletions code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,19 @@
if(!do_after(src, attack_delay, A) || !Adjacent(A))
visible_message(SPAN_NOTICE("\The [src] misses [G.his] attack on \the [A]!"))
animate(src, pixel_x = default_pixel_x, pixel_y = default_pixel_y, time = 2) // reset wherever the attack animation got us to.
MoveToTarget(TRUE) // Restart hostile mob tracking.
ai?.move_to_target(TRUE) // Restart hostile mob tracking.
return TRUE
MoveToTarget(TRUE) // Restart hostile mob tracking.
ai?.move_to_target(TRUE) // Restart hostile mob tracking.

if(ismob(A)) // Clientless mobs are too dum to move away, so they can be missed.
var/mob/mob = A
if(!mob.ckey && !prob(get_melee_accuracy()))
visible_message(SPAN_NOTICE("\The [src] misses [G.his] attack on \the [A]!"))
return TRUE

return A.attackby(attacking_with, src)
. = A.attackby(attacking_with, src)
if(isliving(A))
apply_attack_effects(A)

// Attack hand but for simple animals
/atom/proc/attack_animal(mob/user)
Expand Down
77 changes: 0 additions & 77 deletions code/controllers/hooks-defs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,80 +33,3 @@
* Called in world.dm prior to the parent call in world/Reboot.
*/
/hook/reboot

/**
* Death hook.
* Called in death.dm when someone dies.
* Parameters: var/mob/living/human, var/gibbed
*/
/hook/death

/**
* Cloning hook.
* Called in cloning.dm when someone is brought back by the wonders of modern science.
* Parameters: var/mob/living/human
*/
/hook/clone

/**
* Debrained hook.
* Called in brain_item.dm when someone gets debrained.
* Parameters: var/obj/item/organ/internal/brain
*/
/hook/debrain

/**
* Borged hook.
* Called in robot_parts.dm when someone gets turned into a cyborg.
* Parameters: var/mob/living/silicon/robot
*/
/hook/borgify

/**
* Payroll revoked hook.
* Called in Accounts_DB.dm when someone's payroll is stolen at the Accounts terminal.
* Parameters: var/datum/money_account
*/
/hook/revoke_payroll

/**
* Account suspension hook.
* Called in Accounts_DB.dm when someone's account is suspended or unsuspended at the Accounts terminal.
* Parameters: var/datum/money_account
*/
/hook/change_account_status

/**
* Employee reassignment hook.
* Called in card.dm when someone's card is reassigned at the HoP's desk.
* Parameters: var/obj/item/card/id
*/
/hook/reassign_employee

/**
* Employee terminated hook.
* Called in card.dm when someone's card is terminated at the HoP's desk.
* Parameters: var/obj/item/card/id
*/
/hook/terminate_employee

/**
* Crate sold hook.
* Called in supplyshuttle.dm when a crate is sold on the shuttle.
* Parameters: var/obj/structure/closet/crate/sold, var/area/shuttle
*/
/hook/sell_crate

/**
* Player latejoin hook.
* Called in new_player.dm when a player joins the round after it has started.
* Parameters: var/datum/job/job, var/mob/living/character
*/
/hook/player_latejoin

/**
* Submap join hook.
* Called in submap_join.dm when a player joins a submap.
* Parameters: var/datum/submap/submap, var/datum/job/job, var/mob/living/character
*/
/hook/submap_join
4 changes: 2 additions & 2 deletions code/controllers/subsystems/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ SUBSYSTEM_DEF(supply)
for(var/atom/movable/AM in subarea)
if(AM.anchored)
continue
if(istype(AM, /obj/structure/closet/crate/))
if(istype(AM, /obj/structure/closet/crate))
var/obj/structure/closet/crate/CR = AM
callHook("sell_crate", list(CR, subarea))
RAISE_EVENT(/decl/observ/crate_sold, subarea, CR)
add_points_from_source(CR.get_single_monetary_worth() * crate_return_rebate * 0.1, "crate")
var/find_slip = 1

Expand Down
Loading

0 comments on commit 53964bb

Please sign in to comment.