mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge branch 'master' of github.com:Baystation12/Baystation12 into dev
Conflicts: html/changelog.html
This commit is contained in:
@@ -26,6 +26,13 @@
|
||||
|
||||
|
||||
/obj/item/weapon/paper_bin/attack_hand(mob/user as mob)
|
||||
if (hasorgans(user))
|
||||
var/datum/organ/external/temp = user:organs_by_name["r_hand"]
|
||||
if (user.hand)
|
||||
temp = user:organs_by_name["l_hand"]
|
||||
if(temp && !temp.is_usable())
|
||||
user << "<span class='notice'>You try to move your [temp.display_name], but cannot!"
|
||||
return
|
||||
if(amount >= 1)
|
||||
amount--
|
||||
if(amount==0)
|
||||
|
||||
@@ -1164,6 +1164,7 @@
|
||||
lastused_equip = area.usage(EQUIP)
|
||||
lastused_environ = area.usage(ENVIRON)
|
||||
if(area.powerupdate)
|
||||
if(debug) log_debug("power update in [area.name] / [name]")
|
||||
area.clear_usage()
|
||||
|
||||
lastused_total = lastused_light + lastused_equip + lastused_environ
|
||||
@@ -1187,16 +1188,16 @@
|
||||
if(terminal && terminal.powernet)
|
||||
perapc = terminal.powernet.perapc
|
||||
|
||||
//if(debug)
|
||||
//world << "Status: [main_status] - Excess: [excess] - Last Equip: [lastused_equip] - Last Light: [lastused_light]"
|
||||
if(debug)
|
||||
log_debug( "Status: [main_status] - Excess: [excess] - Last Equip: [lastused_equip] - Last Light: [lastused_light]")
|
||||
|
||||
if(cell && !shorted)
|
||||
var/cell_charge = cell.charge
|
||||
//var/cell_charge = cell.charge
|
||||
var/cell_maxcharge = cell.maxcharge
|
||||
|
||||
// draw power from cell as before
|
||||
|
||||
var/cellused = min(cell_charge, CELLRATE * lastused_total) // clamp deduction to a max, amount left in cell
|
||||
var/cellused = min(cell.charge, CELLRATE * lastused_total) // clamp deduction to a max, amount left in cell
|
||||
cell.use(cellused)
|
||||
|
||||
if(excess > 0 || perapc > lastused_total) // if power excess, or enough anyway, recharge the cell
|
||||
@@ -1207,10 +1208,9 @@
|
||||
|
||||
else // no excess, and not enough per-apc
|
||||
|
||||
if( (cell_charge/CELLRATE+perapc) >= lastused_total) // can we draw enough from cell+grid to cover last usage?
|
||||
if( (cell.charge/CELLRATE+perapc) >= lastused_total) // can we draw enough from cell+grid to cover last usage?
|
||||
|
||||
cell_charge = min(cell_maxcharge, cell_charge + CELLRATE * perapc) //recharge with what we can
|
||||
cell.charge = cell_charge
|
||||
cell.give(CELLRATE * perapc) //recharge with what we can
|
||||
add_load(perapc) // so draw what we can from the grid
|
||||
charging = 0
|
||||
|
||||
@@ -1233,30 +1233,30 @@
|
||||
longtermpower -= 2
|
||||
|
||||
|
||||
if(cell_charge >= 1250 || longtermpower > 0) // Put most likely at the top so we don't check it last, effeciency 101
|
||||
if(cell.charge >= 1250 || longtermpower > 0) // Put most likely at the top so we don't check it last, effeciency 101
|
||||
if(autoflag != 3)
|
||||
equipment = autoset(equipment, 1)
|
||||
lighting = autoset(lighting, 1)
|
||||
environ = autoset(environ, 1)
|
||||
autoflag = 3
|
||||
area.poweralert(1, src)
|
||||
if(cell_charge >= 4000)
|
||||
if(cell.charge >= 4000)
|
||||
area.poweralert(1, src)
|
||||
else if(cell_charge < 1250 && cell_charge > 750 && longtermpower < 0) // <30%, turn off equipment
|
||||
else if(cell.charge < 1250 && cell.charge > 750 && longtermpower < 0) // <30%, turn off equipment
|
||||
if(autoflag != 2)
|
||||
equipment = autoset(equipment, 2)
|
||||
lighting = autoset(lighting, 1)
|
||||
environ = autoset(environ, 1)
|
||||
area.poweralert(0, src)
|
||||
autoflag = 2
|
||||
else if(cell_charge < 750 && cell_charge > 10 && longtermpower < 0) // <15%, turn off lighting & equipment
|
||||
else if(cell.charge < 750 && cell.charge > 10 && longtermpower < 0) // <15%, turn off lighting & equipment
|
||||
if(autoflag != 1)
|
||||
equipment = autoset(equipment, 2)
|
||||
lighting = autoset(lighting, 2)
|
||||
environ = autoset(environ, 1)
|
||||
area.poweralert(0, src)
|
||||
autoflag = 1
|
||||
else if(cell_charge <= 0) // zero charge, turn all off
|
||||
else if(cell.charge <= 0) // zero charge, turn all off
|
||||
if(autoflag != 0)
|
||||
equipment = autoset(equipment, 0)
|
||||
lighting = autoset(lighting, 0)
|
||||
@@ -1269,7 +1269,7 @@
|
||||
if(chargemode && charging == 1 && operating)
|
||||
if(excess > 0) // check to make sure we have enough to charge
|
||||
// Max charge is perapc share, capped to cell capacity, or % per second constant (Whichever is smallest)
|
||||
var/ch = min(perapc*CELLRATE, (cell_maxcharge - cell_charge), (cell_maxcharge*CHARGELEVEL))
|
||||
var/ch = min(perapc*CELLRATE, (cell_maxcharge - cell.charge), (cell_maxcharge*CHARGELEVEL))
|
||||
add_load(ch/CELLRATE) // Removes the power we're taking from the grid
|
||||
cell.give(ch) // actually recharge the cell
|
||||
|
||||
|
||||
@@ -460,6 +460,7 @@ var/global/list/uneatable = list(
|
||||
move_self = 1 //Do we move on our own?
|
||||
grav_pull = 10 //How many tiles out do we pull?
|
||||
consume_range = 3 //How many tiles out do we eat
|
||||
var/last_boom = 0
|
||||
|
||||
/obj/machinery/singularity/narsie/large
|
||||
name = "Nar-Sie"
|
||||
@@ -490,9 +491,11 @@ var/global/list/uneatable = list(
|
||||
return 0
|
||||
if (istype(A,/mob/living))//Mobs get gibbed
|
||||
A:gib()
|
||||
else if(istype(A,/obj/))
|
||||
A:ex_act(1.0)
|
||||
if(A) del(A)
|
||||
else if(istype(A,/obj))
|
||||
var/obj/O = A
|
||||
machines -= O
|
||||
processing_objects -= O
|
||||
O.loc = null
|
||||
else if(isturf(A))
|
||||
var/turf/T = A
|
||||
if(T.intact)
|
||||
@@ -502,6 +505,9 @@ var/global/list/uneatable = list(
|
||||
if(O.invisibility == 101)
|
||||
src.consume(O)
|
||||
A:ChangeTurf(/turf/space)
|
||||
if(last_boom + 100 < world.time && prob(5))
|
||||
explosion(loc, -1, -1, -1, 1, 0) //Since we're not exploding everything in consume() toss out an explosion effect every now and again
|
||||
last_boom = world.time
|
||||
return
|
||||
|
||||
/obj/machinery/singularity/narsie/ex_act() //No throwing bombs at it either. --NEO
|
||||
|
||||
@@ -218,6 +218,10 @@
|
||||
if (!istype(src.loc, /turf) && !istype(usr, /mob/living/silicon/))
|
||||
return 0 // Do not update ui
|
||||
|
||||
for(var/area/A in active_areas)
|
||||
A.master.powerupdate = 3
|
||||
|
||||
|
||||
if( href_list["cmode"] )
|
||||
chargemode = !chargemode
|
||||
if(!chargemode)
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
var/excavation_level = 0
|
||||
var/datum/geosample/geological_data
|
||||
var/datum/artifact_find/artifact_find
|
||||
var/last_act = 0
|
||||
|
||||
/obj/structure/boulder/New()
|
||||
icon_state = "boulder[rand(1,4)]"
|
||||
@@ -68,8 +69,14 @@
|
||||
if (istype(W, /obj/item/weapon/pickaxe))
|
||||
var/obj/item/weapon/pickaxe/P = W
|
||||
|
||||
if(last_act + P.digspeed > world.time)//prevents message spam
|
||||
return
|
||||
last_act = world.time
|
||||
|
||||
user << "\red You start [P.drill_verb] [src]."
|
||||
|
||||
|
||||
|
||||
if(!do_after(user,P.digspeed))
|
||||
return
|
||||
|
||||
@@ -97,3 +104,22 @@
|
||||
user.visible_message("<font color='red'><b>[src] suddenly crumbles away.</b></font>",\
|
||||
"\blue [src] has been whittled away under your careful excavation, but there was nothing of interest inside.")
|
||||
del(src)
|
||||
|
||||
/obj/structure/boulder/Bumped(AM)
|
||||
. = ..()
|
||||
if(istype(AM,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = AM
|
||||
if((istype(H.l_hand,/obj/item/weapon/pickaxe)) && (!H.hand))
|
||||
attackby(H.l_hand,H)
|
||||
else if((istype(H.r_hand,/obj/item/weapon/pickaxe)) && H.hand)
|
||||
attackby(H.r_hand,H)
|
||||
|
||||
else if(istype(AM,/mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = AM
|
||||
if(istype(R.module_active,/obj/item/weapon/pickaxe))
|
||||
attackby(R.module_active,R)
|
||||
|
||||
else if(istype(AM,/obj/mecha))
|
||||
var/obj/mecha/M = AM
|
||||
if(istype(M.selected,/obj/item/mecha_parts/mecha_equipment/tool/drill))
|
||||
M.selected.action(src)
|
||||
|
||||
Reference in New Issue
Block a user