mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-23 05:07:51 +01:00
[MIRROR] fix some runtimes and an overlay overflow (#8210)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Kashargul
parent
57a0b4a5eb
commit
234aed941f
@@ -27,12 +27,10 @@
|
||||
var/newlevel = round(charging.percent() * 4.0 / 99)
|
||||
//to_world("nl: [newlevel]")
|
||||
|
||||
//CHOMPEdit Start prevet overlay overflow
|
||||
cut_overlays()
|
||||
add_overlay("ccharger-o[newlevel]")
|
||||
|
||||
chargelevel = newlevel
|
||||
//CHOMPEdit End prevet overlay overflow
|
||||
add_overlay(image(charging.icon, charging.icon_state))
|
||||
add_overlay("ccharger-[charging.connector_type]-on")
|
||||
|
||||
@@ -125,11 +123,11 @@
|
||||
return
|
||||
|
||||
if(charging && !charging.fully_charged())
|
||||
var/newlevel = round(charging.percent() * 4.0 / 99) //CHOMPEdit prevent overlay overflow
|
||||
var/newlevel = round(charging.percent() * 4.0 / 99)
|
||||
charging.give(efficiency*CELLRATE)
|
||||
update_use_power(USE_POWER_ACTIVE)
|
||||
if(chargelevel != newlevel) //CHOMPEdit prevent overlay overflow
|
||||
update_icon() //CHOMPEdit prevent overlay overflow
|
||||
if(chargelevel != newlevel)
|
||||
update_icon()
|
||||
else
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
// Used when a target is out of sight or invisible.
|
||||
/datum/ai_holder/proc/engage_unseen_enemy()
|
||||
ai_log("engage_unseen_enemy() : Entering.", AI_LOG_TRACE)
|
||||
|
||||
|
||||
// Also handled in strategic updates but handling it here allows for more fine resolution timeouts
|
||||
if((lose_target_time+lose_target_timeout) <= world.time)
|
||||
return find_target()
|
||||
|
||||
|
||||
// Lets do some last things before giving up.
|
||||
if(conserve_ammo || !holder.ICheckRangedAttack(target_last_seen_turf))
|
||||
// We conserve ammo (or can't shoot) so walk closer
|
||||
@@ -29,7 +29,7 @@
|
||||
on_engagement(T)
|
||||
if(firing_lanes && !test_projectile_safety(T))
|
||||
step_rand(holder)
|
||||
holder.face_atom(T)
|
||||
holder?.face_atom(T)
|
||||
return ATTACK_FAILED
|
||||
|
||||
return ranged_attack(T)
|
||||
@@ -60,7 +60,7 @@
|
||||
/obj/structure/stairs/top,
|
||||
/obj/structure/stairs/bottom
|
||||
)
|
||||
|
||||
|
||||
if(intelligence_level >= AI_SMART)
|
||||
possible_escape_types += /obj/structure/ladder
|
||||
|
||||
@@ -69,18 +69,18 @@
|
||||
continue // Not something they could have escaped through
|
||||
if(turn(holder.dir, 180) & get_dir(get_turf(holder), get_turf(A)))
|
||||
continue // Surely, they couldn't have escaped *behind* us!
|
||||
|
||||
|
||||
if(istype(A, /obj/machinery/door))
|
||||
var/obj/machinery/door/D = A
|
||||
if(D.glass) // Surely, they couldn't hide behind a transparent door!
|
||||
continue
|
||||
if(D.density && intelligence_level < AI_SMART) // Surely, they couldn't have escaped through a *closed* door
|
||||
continue
|
||||
|
||||
|
||||
var/dist = get_dist(holder, A)
|
||||
if(dist == closest_dist)
|
||||
closest_escape += A
|
||||
|
||||
|
||||
else if(dist < closest_dist)
|
||||
closest_escape.Cut()
|
||||
closest_escape += A
|
||||
@@ -89,5 +89,3 @@
|
||||
if(closest_escape.len)
|
||||
return pick(closest_escape)
|
||||
return null
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
else
|
||||
ammo = projectile_gun.contents[1]
|
||||
P = ammo.BB
|
||||
if(!P)
|
||||
return "no"
|
||||
switch(P.damage)
|
||||
if(0)
|
||||
return "no"
|
||||
@@ -57,6 +59,8 @@
|
||||
else
|
||||
ammo = projectile_gun.contents[1]
|
||||
P = ammo.BB
|
||||
if(!P)
|
||||
return "no"
|
||||
switch(P.armor_penetration)
|
||||
if(0)
|
||||
return "cannot pierce armor"
|
||||
@@ -149,4 +153,4 @@
|
||||
if(reach > 1)
|
||||
weapon_stats += "\nIt can attack targets up to [reach] tiles away, and can attack over certain objects."
|
||||
|
||||
return weapon_stats
|
||||
return weapon_stats
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
|
||||
if(affecting)
|
||||
to_chat(target, "<span class='danger'>\The [fruit]'s thorns pierce your [affecting.name] greedily!</span>")
|
||||
target.apply_damage(damage, BRUTE, target_limb, blocked, soaked, "Thorns", sharp = TRUE, edge=has_edge)
|
||||
target.apply_damage(damage, BRUTE, target_limb, blocked, soaked, TRUE, has_edge, "Thorns")
|
||||
else
|
||||
to_chat(target, "<span class='danger'>\The [fruit]'s thorns pierce your flesh greedily!</span>")
|
||||
target.adjustBruteLoss(damage)
|
||||
@@ -149,7 +149,7 @@
|
||||
has_edge = prob(get_trait(TRAIT_POTENCY)/5)
|
||||
if(affecting)
|
||||
to_chat(target, "<span class='danger'>\The [fruit]'s thorns dig deeply into your [affecting.name]!</span>")
|
||||
target.apply_damage(damage, BRUTE, target_limb, blocked, "Thorns", sharp = TRUE, edge=has_edge)
|
||||
target.apply_damage(damage, BRUTE, target_limb, blocked, soaked, TRUE, has_edge, "Thorns")
|
||||
else
|
||||
to_chat(target, "<span class='danger'>\The [fruit]'s thorns dig deeply into your flesh!</span>")
|
||||
target.adjustBruteLoss(damage)
|
||||
|
||||
@@ -331,7 +331,7 @@
|
||||
// PERSON BEING HIT: CAN BE DROP PRED, ALLOWS THROW VORE.
|
||||
// PERSON BEING THROWN: DEVOURABLE, ALLOWS THROW VORE, CAN BE DROP PREY.
|
||||
if((can_be_drop_pred && throw_vore) && (thrown_mob.devourable && thrown_mob.throw_vore && thrown_mob.can_be_drop_prey)) //Prey thrown into pred.
|
||||
if(!thrown_mob.allowmobvore && isanimal(src)) //Does the person being thrown not allow mob vore and is the person being hit (us) a simple_mob?
|
||||
if(!thrown_mob.allowmobvore && isanimal(src) || !vore_selected) //Does the person being thrown not allow mob vore and is the person being hit (us) a simple_mob?
|
||||
return
|
||||
vore_selected.nom_mob(thrown_mob) //Eat them!!!
|
||||
visible_message("<span class='vwarning'>[thrown_mob] is thrown right into [src]'s [lowertext(vore_selected.name)]!</span>")
|
||||
@@ -344,7 +344,7 @@
|
||||
// PERSON BEING HIT: CAN BE DROP PREY, ALLOWS THROW VORE, AND IS DEVOURABLE.
|
||||
// PERSON BEING THROWN: CAN BE DROP PRED, ALLOWS THROW VORE.
|
||||
else if((can_be_drop_prey && throw_vore && devourable) && (thrown_mob.can_be_drop_pred && thrown_mob.throw_vore)) //Pred thrown into prey.
|
||||
if(!allowmobvore && isanimal(thrown_mob)) //Does the person being hit not allow mob vore and the perrson being thrown a simple_mob?
|
||||
if(!allowmobvore && isanimal(thrown_mob) || !thrown_mob.vore_selected) //Does the person being hit not allow mob vore and the perrson being thrown a simple_mob?
|
||||
return
|
||||
visible_message("<span class='vwarning'>[src] suddenly slips inside of [thrown_mob]'s [lowertext(thrown_mob.vore_selected.name)] as [thrown_mob] flies into them!</span>")
|
||||
thrown_mob.vore_selected.nom_mob(src) //Eat them!!!
|
||||
|
||||
@@ -163,6 +163,8 @@
|
||||
page--
|
||||
playsound(src, "pageturn", 50, 1)
|
||||
if(href_list["remove"])
|
||||
if(!pages.len)
|
||||
return
|
||||
var/obj/item/weapon/W = pages[page]
|
||||
usr.put_in_hands(W)
|
||||
pages.Remove(pages[page])
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
cut_overlays()
|
||||
|
||||
if(!hose_overlay)
|
||||
hose_overlay = new icon(icon, "[icon_state]+hose")
|
||||
hose_overlay = new/icon(icon, "[icon_state]+hose")
|
||||
|
||||
if(InputSocket.get_pairing())
|
||||
add_overlay(hose_overlay)
|
||||
|
||||
Reference in New Issue
Block a user