Skip to content

Commit

Permalink
Batch of Fixes (1/? ?) (#2726)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaFire15 authored Dec 27, 2024
1 parent fdee16e commit 5437b72
Show file tree
Hide file tree
Showing 32 changed files with 433 additions and 103 deletions.
2 changes: 1 addition & 1 deletion _maps/map_files/Atlas/atlas.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/Eclipse/Eclipse1.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions _maps/map_files/Galactica/Galactica2.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions _maps/map_files/Gladius/Gladius2.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions _maps/map_files/Instanced/map_files/Babylon2.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/Instanced/map_files/Hammurabi2.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/Snake/snake_lower.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions _maps/map_files/Testship/testship.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/Tycoon/Tycoon2.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/Vago/vagodeck2.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/templates/boarding/syndicate/destroyer.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions code/game/mecha/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,13 @@
. = ..()
if(.)
events.fireEvent("onMove",get_turf(src))
//NSV13 - hacky AI fixes
if(silicon_pilot)
var/mob/living/silicon/ai/aipilot = occupant //qed
if(isAI(aipilot)) //safety
aipilot?.eyeobj?.setLoc(get_turf(src), FALSE, null, TRUE) //Ok so basically we NEED our eyeobj to move so our camera chunks update or the mech pilot has a bad time.
aipilot?.update_camera_location() //Ok so basically we NEED to update the AI core camera here because it doesn't get "moved" normally due to contents.
//NSV13 end.
if (internal_tank?.disconnect()) // Something moved us and broke connection
occupant_message("<span class='warning'>Air port connection teared off!</span>")
log_message("Lost connection to gas port.", LOG_MECHA)
Expand Down Expand Up @@ -809,6 +816,7 @@
to_chat(user, "<span class='boldnotice'>Transfer successful</span>: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.")
card.AI = null
ai_enter_mech(AI, interaction)
card.update_icon() //NSV13 - make card look empty.

//Hack and From Card interactions share some code, so leave that here for both to use.
/obj/mecha/proc/ai_enter_mech(mob/living/silicon/ai/AI, interaction)
Expand All @@ -833,6 +841,10 @@
GrantActions(AI, FALSE) //No eject/return to core action for AI uploaded by card
else
GrantActions(AI, !AI.can_dominate_mechs)
//NSV13 - immediately update camera info on connect.
AI.eyeobj?.setLoc(get_turf(src), FALSE, null, TRUE)
AI.update_camera_location()
//NSV13 end.


//An actual AI (simple_animal mecha pilot) entering the mech
Expand Down Expand Up @@ -1098,6 +1110,12 @@
icon_state = initial(icon_state)+"-open"
setDir(dir_in)

//NSV13 - immediately update core camera with old core location.
if(isAI(mob_container))
var/mob/living/silicon/ai/leaving_ai = mob_container
leaving_ai.update_camera_location(src)
//NSV13 end.

if(L?.client)
L.update_mouse_pointer()
L.client.view_size.resetToDefault()
Expand Down
19 changes: 17 additions & 2 deletions code/game/mecha/mecha_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,24 @@
/obj/mecha/obj_destruction()
if(wreckage)
var/mob/living/silicon/ai/AI
//NSV13 - AI disconnects from the mech if it dies, if not shunted. Causes damage equal to 33% of maximum integrity.
if(isAI(occupant))
AI = occupant
occupant = null
var/mob/living/silicon/ai/ai_ref = occupant
var/kill_ai = FALSE
if(eject_action in occupant.actions) //This AI did not one-way.
go_out() //Release direct control.
if(occupant) //Didn't work!
kill_ai = TRUE
else
to_chat(ai_ref, "<span class='userdanger'>Interface protocols flash-severed. Feedback damage detected.</span>")
var/feedback_damage = CEILING((ai_ref.maxHealth + 100) / 3, 1) // 1/3rd of maximum health as damage, rounded up.
ai_ref.apply_damage(feedback_damage, BURN)
else
kill_ai = TRUE //Sorry Harbinger.
if(kill_ai)
AI = occupant
occupant = null
//NSV13 end.
var/obj/structure/mecha_wreckage/WR = new wreckage(loc, AI)
for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
if(E.salvageable && prob(30))
Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/effects/effect_system/effects_foam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
/turf/open/chasm,
/turf/open/lava))
var/slippery_foam = TRUE
///Creation time of the foam tile, used for diminishing returns on foam-time prolonging reactions.
var/creation_time //NSV13

/obj/effect/particle_effect/foam/firefighting
name = "firefighting foam"
Expand Down Expand Up @@ -91,6 +93,7 @@

/obj/effect/particle_effect/foam/Initialize(mapload)
. = ..()
creation_time = world.time //NSV13
create_reagents(1000) //limited by the size of the reagent holder anyway.
START_PROCESSING(SSfastprocess, src)
playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/ai/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
//NSV13 - don't let AI control hostile ship equipment
var/obj/structure/overmap/otherOM = A.get_overmap()
var/obj/structure/overmap/aiOM = get_overmap()
if(!otherOM || !aiOM || otherOM.faction != aiOM.faction)
if(otherOM && (!aiOM || (otherOM.faction != aiOM.faction)))
return FALSE
//end NSV13

Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/silicon/ai/freelook/eye.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
// Use this when setting the ai_eye's location.
// It will also stream the chunk that the new loc is in.

/mob/camera/ai_eye/proc/setLoc(destination, force_update = FALSE, dir) //NSV13 - AI Custom Holographic Form
/mob/camera/ai_eye/proc/setLoc(destination, force_update = FALSE, dir, ai_mecha_override) //NSV13 - AI Custom Holographic Form || also AI mecha fixes - basically we need the fourth arg to ONLY allow the mecha AI movement and lock normal actions.
if(ai)
if(!isturf(ai.loc))
if(!isturf(ai.loc) && (!ismecha(ai.loc) || !ai_mecha_override)) //NSV13 - hacky ancient bugfixes (eye needs moving even if core is mech'd to update cam chunks).
return
destination = get_turf(destination)
if(!force_update && (destination == get_turf(src)) )
Expand Down
7 changes: 6 additions & 1 deletion code/modules/pool/pool.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ Place a pool filter somewhere in the pool if you want people to be able to modif
if(!istype(get_step(src,NORTH), /turf/open/indestructible/sound/pool)) //Ladders only face up, and no stacking!
balloon_alert(user, "You start installing a pool ladder...")
if(do_after(user, 5 SECONDS, target=src))
W.use(10)
//NSV13 - yeah I know 50 ladders are funny but lets not.
if(locate(/obj/structure/pool_ladder) in src)
return
if(!W.use(10))
return
///NSV13 end.
new /obj/structure/pool_ladder(src)
return TRUE

Expand Down
4 changes: 2 additions & 2 deletions code/modules/reagents/chemistry/reagents/food_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@
"<span class='userdanger'>You're covered in boiling oil!</span>")
M.emote("scream")
playsound(M, 'sound/machines/fryer/deep_fryer_emerge.ogg', 25, TRUE)
var/oil_damage = (holder.chem_temp / fry_temperature) * 0.33 //Damage taken per unit
M.adjustFireLoss(min(35, oil_damage * reac_volume)) //Damage caps at 35
var/oil_damage = min(1, (holder.chem_temp / fry_temperature) * 0.33) //Damage taken per unit //NSV13 - per unit damage also caps at 1 to counteract microdosing.
M.adjustFireLoss(min(30, oil_damage * reac_volume)) //NSV13 - total damage caps at 30.
else
..()
return TRUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,11 @@
if(!F)
F = new(T)
else if(istype(F))
F.lifetime = initial(F.lifetime) //reduce object churn a little bit when using smoke by keeping existing foam alive a bit longer
//NSV13 - diminishing returns on foam lifetime.
var/newtime = (initial(F.lifetime) * (1 - ((world.time - F.creation_time) / (20 SECONDS))))
if(newtime > 0 && newtime > F.lifetime)
F.lifetime = initial(F.lifetime) //reduce object churn a little bit when using smoke by keeping existing foam alive a bit longer
//NSV13 end.

var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot && !isspaceturf(T))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Slimecrossing Potions
if(!isliving(M) || M.stat == DEAD)
to_chat(user, "<span class='warning'>The love potion only works on living things, sicko!</span>")
return ..()
if(istype(M, /mob/living/simple_animal/hostile/megafauna))
if(istype(M, /mob/living/simple_animal/hostile/megafauna) || isknpc(M)) //NSV13 - knpcs are evil.
to_chat(user, "<span class='warning'>The love potion does not work on beings of pure evil!</span>")
return ..()
if(user == M)
Expand Down
2 changes: 2 additions & 0 deletions nsv13/code/__HELPERS/overmap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Helper method to get what ship an observer belongs to for stuff like parallax.
*/

/mob/proc/update_overmap()
if(!loc) //Being deleted or cursed things.
return
var/obj/structure/overmap/OM = loc.get_overmap() //Accounts for things like fighters and for being in nullspace because having no loc is bad.
if(OM == last_overmap)
return
Expand Down
4 changes: 2 additions & 2 deletions nsv13/code/game/machinery/computer/helm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
/obj/machinery/computer/ship/helm/multitool_act(mob/living/user, obj/item/I)
if(!linked)
linked = get_overmap()
if(linked && allowed(user) && linked.role <= NORMAL_OVERMAP)
if(linked && allowed(user) && linked.role <= NORMAL_OVERMAP && initial(linked.ai_controlled))
linked.ai_controlled = !linked.ai_controlled
linked.apply_weapons()
linked.apply_weapons() //This is horrible but I've got more bugs to fix.
playsound(src, 'nsv13/sound/effects/computer/startup.ogg', 75, 1)
to_chat(user, "<span class='warning'>Autopilot [linked.ai_controlled ? "Enabled" : "Disengaged"].</span>")
..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
loot = list(
/obj/item/powder_bag = 10,
/obj/machinery/computer/deckgun = 1,
/obj/machinery/deck_turret = 1,
/obj/machinery/deck_turret/core = 1,
/obj/machinery/deck_turret/payload_gate = 1,
/obj/machinery/deck_turret/autoelevator = 1,
/obj/machinery/deck_turret/powder_gate = 1
Expand Down
4 changes: 2 additions & 2 deletions nsv13/code/game/objects/items/nsv_circuitboards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@
build_path = /obj/machinery/computer/deckgun
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF

/obj/item/circuitboard/machine/deck_gun
/obj/item/circuitboard/machine/deck_gun/core
name = "deck gun core (Machine Board)"
req_components = list(
/obj/item/stack/sheet/mineral/titanium = 10,
/obj/item/stack/cable_coil = 5)
build_path = /obj/machinery/deck_turret
build_path = /obj/machinery/deck_turret/core
needs_anchored = FALSE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF

Expand Down
Loading

0 comments on commit 5437b72

Please sign in to comment.