Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
multi-z npc paths, inflatable wall range check, knpcs in poi list, first attempt at fixing pathing firedoors
  • Loading branch information
Bokkiewokkie committed Oct 11, 2024
1 parent ef53889 commit e3e60c1
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 19 deletions.
4 changes: 2 additions & 2 deletions code/__HELPERS/path.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@
if(!start || !end)
stack_trace("Invalid A* start or destination")
return
if(start.z != end.z || start == end ) //no pathfinding between z levels
return
// if(start.z != end.z || start == end ) //no pathfinding between z levels
// return //NSV13 we DO want pathfinding between z levels.
if(max_distance && (max_distance < get_dist(start, end))) //if start turf is farther than max_distance from end turf, no need to do anything
return

Expand Down
16 changes: 6 additions & 10 deletions code/game/machinery/doors/firedoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@
opacity = FALSE
var/ini_dir


/obj/machinery/door/firedoor/border_only/Initialize(mapload, loc, set_dir)
. = ..()
if(set_dir)
Expand Down Expand Up @@ -528,23 +529,18 @@
leaving.Bump(src)
return COMPONENT_ATOM_BLOCK_EXIT

//NSV13 - knpcs can into firelock
/obj/machinery/door/firedoor/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
if(istype(caller) && (caller.pass_flags & pass_flags_self))
return TRUE
if(!density)
return TRUE
if(welded)
//NSV13 - npcs can into firelock
/obj/machinery/door/firedoor/border_only/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
if((welded || (machine_stat & NOPOWER)) && (dir == to_dir))
message_admins("[src]([ADMIN_FLW(src)]) returned false astarpass with dir [dir], weld [welded] and machine stat [machine_state]")
return FALSE
if(!hasPower())
return isknpc(caller)
return TRUE

/obj/machinery/door/firedoor/border_only/CanAtmosPass(turf/T)
if(get_dir(loc, T) == dir)
return !density
else
return 1
return TRUE
//NSV13 end

/obj/machinery/door/firedoor/heavy
Expand Down
2 changes: 1 addition & 1 deletion code/game/points_of_interest.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
var/list/pois = list()
for(var/mob/M in mobs)
if(skip_mindless && (!M.mind && !M.ckey))
if(!isbot(M) && !iscameramob(M) && !ismegafauna(M))
if(!isbot(M) && !iscameramob(M) && !ismegafauna(M) && !isknpc(M)) //NSV13 add KNPCs
continue
if(M.client && M.client.holder && M.client.holder.fakekey) //stealthmins
continue
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@
if(InCritical())
msg += "[t_He] [t_is] barely conscious.\n"
if(getorgan(/obj/item/organ/brain))
if(ai_controller?.ai_status == AI_STATUS_ON)
if(ai_controller?.ai_status == AI_STATUS_ON || isknpc(src)) //NSV13 added KNPCs
msg += "<span class='deadsay'>[t_He] do[t_es]n't appear to be [t_him]self.</span>\n"
if(!key)
else if(!key)
msg += "<span class='deadsay'>[t_He] [t_is] totally catatonic. The stresses of life in deep-space must have been too much for [t_him]. Any recovery is unlikely.</span>\n"
else if(!client)
msg += "[t_He] [t_has] a blank, absent-minded stare and appears completely unresponsive to anything. [t_He] may snap out of it soon.\n"
Expand Down
12 changes: 9 additions & 3 deletions nsv13/code/modules/overmap/knpc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ GLOBAL_LIST_EMPTY(knpcs)

/mob/living/carbon/human/ai_boarder
faction = list("Neutral")
var/move_delay = 4 //How quickly do the boys travel?
var/action_delay = 6 //How long we delay between actions
var/move_delay = 6 //How quickly do the boys travel?
var/action_delay = 10 //How long we delay between actions
var/knpc_traits = KNPC_IS_DODGER | KNPC_IS_MERCIFUL | KNPC_IS_AREA_SPECIFIC
var/difficulty_override = FALSE //Whether to ignore overmap difficulty or not
var/list/outfit = list (
Expand Down Expand Up @@ -158,7 +158,7 @@ GLOBAL_LIST_EMPTY(knpcs)
break //If at least one firedoor in our way is welded shut, welp!
blocking_firelock.open() //Open one firelock per tile per try.
break
for(var/obj/machinery/door/firedoor/blocking_firelock in this_turf)
for(var/obj/machinery/door/firedoor/blocking_firelock as() in this_turf)
if(!((blocking_firelock.flags_1 & ON_BORDER_1) && (blocking_firelock.dir in dir_to_cardinal_dirs(get_dir(this_turf, next_turf))))) //Here, only firelocks on the border matter since fulltile firelocks let you exit.
continue
if(!blocking_firelock.density || blocking_firelock.operating)
Expand All @@ -172,7 +172,12 @@ GLOBAL_LIST_EMPTY(knpcs)
continue
H.forceMove(next_turf)
H.visible_message("<span class='warning'>[H] climbs onto [possible_barrier]!</span>")
var/obj/item/dropped_it
if(H.get_active_held_item())
dropped_it = H.get_active_held_item()
H.Stun(2 SECONDS) //Table.
if(dropped_it) //Don't forget to pick up your stuff
H.put_in_hands(dropped_it, forced=TRUE)
if(get_turf(H) == path[1])
increment_path()
return TRUE
Expand Down Expand Up @@ -255,6 +260,7 @@ GLOBAL_LIST_EMPTY(knpcs)
if(length(path))
next_path_step()
else //They should always be pathing somewhere...
next_path_step()
dest = null
tries = 0
path = list()
Expand Down
2 changes: 2 additions & 0 deletions nsv13/code/modules/overmap/shieldgen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@
var/obj/structure/cable/cable = null //Connected cable
var/mutable_appearance/c_screen

/obj/machinery/shield_generator/update_icon()
cut_overlays()

/obj/machinery/shield_generator/proc/absorb_hit(obj/item/projectile/proj)
var/damage = proj.damage
Expand Down
3 changes: 2 additions & 1 deletion nsv13/code/modules/squads/squad_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@
. = ..()
if(torn)
return
inflate(get_turf(target), user)
if(in_range(target, user))
inflate(get_turf(target), user)

/obj/item/inflatable/proc/inflate(turf/target, mob/user)
playsound(loc, 'sound/items/zip.ogg', 75, 1)
Expand Down

0 comments on commit e3e60c1

Please sign in to comment.