Merge remote-tracking branch 'upstream/dev-freeze' into dev

This commit is contained in:
PsiOmega
2015-05-22 08:39:07 +02:00
224 changed files with 3659 additions and 3235 deletions
+163
View File
@@ -0,0 +1,163 @@
/*
adds a dizziness amount to a mob
use this rather than directly changing var/dizziness
since this ensures that the dizzy_process proc is started
currently only humans get dizzy
value of dizziness ranges from 0 to 1000
below 100 is not dizzy
*/
/mob/var/dizziness = 0//Carbon
/mob/var/is_dizzy = 0
/mob/proc/make_dizzy(var/amount)
if(!istype(src, /mob/living/carbon/human)) // for the moment, only humans get dizzy
return
dizziness = min(1000, dizziness + amount) // store what will be new value
// clamped to max 1000
if(dizziness > 100 && !is_dizzy)
spawn(0)
dizzy_process()
/*
dizzy process - wiggles the client's pixel offset over time
spawned from make_dizzy(), will terminate automatically when dizziness gets <100
note dizziness decrements automatically in the mob's Life() proc.
*/
/mob/proc/dizzy_process()
is_dizzy = 1
while(dizziness > 100)
if(client)
var/amplitude = dizziness*(sin(dizziness * 0.044 * world.time) + 1) / 70
client.pixel_x = amplitude * sin(0.008 * dizziness * world.time)
client.pixel_y = amplitude * cos(0.008 * dizziness * world.time)
sleep(1)
//endwhile - reset the pixel offsets to zero
is_dizzy = 0
if(client)
client.pixel_x = 0
client.pixel_y = 0
// jitteriness - copy+paste of dizziness
/mob/var/is_jittery = 0
/mob/var/jitteriness = 0//Carbon
/mob/proc/make_jittery(var/amount)
if(!istype(src, /mob/living/carbon/human)) // for the moment, only humans get dizzy
return
jitteriness = min(1000, jitteriness + amount) // store what will be new value
// clamped to max 1000
if(jitteriness > 100 && !is_jittery)
spawn(0)
jittery_process()
// Typo from the oriignal coder here, below lies the jitteriness process. So make of his code what you will, the previous comment here was just a copypaste of the above.
/mob/proc/jittery_process()
//var/old_x = pixel_x
//var/old_y = pixel_y
is_jittery = 1
while(jitteriness > 100)
// var/amplitude = jitteriness*(sin(jitteriness * 0.044 * world.time) + 1) / 70
// pixel_x = amplitude * sin(0.008 * jitteriness * world.time)
// pixel_y = amplitude * cos(0.008 * jitteriness * world.time)
var/amplitude = min(4, jitteriness / 100)
pixel_x = old_x + rand(-amplitude, amplitude)
pixel_y = old_y + rand(-amplitude/3, amplitude/3)
sleep(1)
//endwhile - reset the pixel offsets to zero
is_jittery = 0
pixel_x = old_x
pixel_y = old_y
//handles up-down floaty effect in space
/mob/var/is_floating = 0
/mob/var/floatiness = 0
/mob/proc/make_floating(var/n)
floatiness = n
if(floatiness && !is_floating)
start_floating()
else if(!floatiness && is_floating)
stop_floating()
/mob/proc/start_floating()
is_floating = 1
var/amplitude = 2 //maximum displacement from original position
var/period = 36 //time taken for the mob to go up >> down >> original position, in deciseconds. Should be multiple of 4
var/top = old_y + amplitude
var/bottom = old_y - amplitude
var/half_period = period / 2
var/quarter_period = period / 4
animate(src, pixel_y = top, time = quarter_period, easing = SINE_EASING | EASE_OUT, loop = -1) //up
animate(pixel_y = bottom, time = half_period, easing = SINE_EASING, loop = -1) //down
animate(pixel_y = old_y, time = quarter_period, easing = SINE_EASING | EASE_IN, loop = -1) //back
/mob/proc/stop_floating()
animate(src, pixel_y = old_y, time = 5, easing = SINE_EASING | EASE_IN) //halt animation
//reset the pixel offsets to zero
is_floating = 0
/atom/movable/proc/do_attack_animation(atom/A)
var/pixel_x_diff = 0
var/pixel_y_diff = 0
var/direction = get_dir(src, A)
switch(direction)
if(NORTH)
pixel_y_diff = 8
if(SOUTH)
pixel_y_diff = -8
if(EAST)
pixel_x_diff = 8
if(WEST)
pixel_x_diff = -8
if(NORTHEAST)
pixel_x_diff = 8
pixel_y_diff = 8
if(NORTHWEST)
pixel_x_diff = -8
pixel_y_diff = 8
if(SOUTHEAST)
pixel_x_diff = 8
pixel_y_diff = -8
if(SOUTHWEST)
pixel_x_diff = -8
pixel_y_diff = -8
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, time = 2)
animate(pixel_x = initial(pixel_x), pixel_y = initial(pixel_y), time = 2)
/mob/do_attack_animation(atom/A)
..()
is_floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement.
/mob/proc/spin(spintime, speed)
spawn()
var/D = dir
while(spintime >= speed)
sleep(speed)
switch(D)
if(NORTH)
D = EAST
if(SOUTH)
D = WEST
if(EAST)
D = SOUTH
if(WEST)
D = NORTH
set_dir(D)
spintime -= speed
return
+2 -1
View File
@@ -218,7 +218,7 @@ var/list/slot_equipment_priority = list( \
drop_from_inventory(I)
return 1
//Attemps to remove an object on a mob. Will not move it to another area or such, just removes from the mob.
//Attemps to remove an object on a mob.
/mob/proc/remove_from_mob(var/obj/O)
src.u_equip(O)
if (src.client)
@@ -227,6 +227,7 @@ var/list/slot_equipment_priority = list( \
O.screen_loc = null
if(istype(O, /obj/item))
var/obj/item/I = O
I.loc = src.loc
I.dropped(src)
return 1
+3 -2
View File
@@ -228,6 +228,7 @@
switch(action)
if("weed")
flick("farmbot_hoe", src)
do_attack_animation(A)
if(prob(50))
visible_message("<span class='danger'>[src] swings wildly at [A] with a minihoe, missing completely!</span>")
return
@@ -241,7 +242,7 @@
visible_message("<span class='danger'>[src] blows apart!</span>")
var/turf/Tsec = get_turf(src)
new /obj/item/weapon/minihoe(Tsec)
new /obj/item/weapon/material/minihoe(Tsec)
new /obj/item/weapon/reagent_containers/glass/bucket(Tsec)
new /obj/item/device/assembly/prox_sensor(Tsec)
new /obj/item/device/analyzer/plant_analyzer(Tsec)
@@ -326,7 +327,7 @@
user.remove_from_mob(W)
qdel(W)
else if((istype(W, /obj/item/weapon/minihoe)) && (build_step == 2))
else if((istype(W, /obj/item/weapon/material/minihoe)) && (build_step == 2))
build_step++
user << "You add a minihoe to [src]."
name = "farmbot assembly with bucket and minihoe"
+3 -3
View File
@@ -154,7 +154,7 @@
target = T
break
if(maketiles && !target)
for(var/obj/item/stack/sheet/metal/T in view(src))
for(var/obj/item/stack/material/steel/T in view(src))
if(T in ignorelist)
continue
target = T
@@ -249,8 +249,8 @@
target = null
repairing = 0
update_icons()
else if(istype(A, /obj/item/stack/sheet/metal) && amount + 3 < maxAmount)
var/obj/item/stack/sheet/metal/M = A
else if(istype(A, /obj/item/stack/material/steel) && amount + 3 < maxAmount)
var/obj/item/stack/material/steel/M = A
visible_message("<span class='notice'>[src] begins to make tiles.</span>")
repairing = 1
update_icons()
+2
View File
@@ -264,6 +264,7 @@
if(!cuff)
C.stun_effect_act(0, 60, null)
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
do_attack_animation(C)
is_attacking = 1
update_icons()
spawn(2)
@@ -283,6 +284,7 @@
var/mob/living/simple_animal/S = M
S.AdjustStunned(10)
S.adjustBruteLoss(15)
do_attack_animation(M)
playsound(loc, "swing_hit", 50, 1, -1)
is_attacking = 1
update_icons()
+1 -1
View File
@@ -132,7 +132,7 @@
/mob/living/carbon/proc/swap_hand()
var/obj/item/item_in_hand = src.get_active_hand()
if(item_in_hand) //this segment checks if the item in your hand is twohanded.
if(istype(item_in_hand,/obj/item/weapon/twohanded))
if(istype(item_in_hand,/obj/item/weapon/material/twohanded))
if(item_in_hand:wielded == 1)
usr << "<span class='warning'>Your other hand is too busy holding the [item_in_hand.name]</span>"
return
@@ -1026,7 +1026,7 @@
var/list/visible_implants = list()
for(var/obj/item/organ/external/organ in src.organs)
for(var/obj/item/weapon/O in organ.implants)
if(!istype(O,/obj/item/weapon/implant) && (O.w_class > class) && !istype(O,/obj/item/weapon/shard/shrapnel))
if(!istype(O,/obj/item/weapon/implant) && (O.w_class > class) && !istype(O,/obj/item/weapon/material/shard/shrapnel))
visible_implants += O
return(visible_implants)
@@ -15,10 +15,11 @@
if(istype(H))
if((H != src) && check_shields(0, H.name))
visible_message("\red <B>[H] attempted to touch [src]!</B>")
H.do_attack_animation(src)
return 0
if(istype(H.gloves, /obj/item/clothing/gloves/boxing/hologlove))
H.do_attack_animation(src)
var/damage = rand(0, 9)
if(!damage)
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
@@ -95,6 +96,7 @@
G.synch()
LAssailant = M
H.do_attack_animation(src)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("<span class='warning'>[M] has grabbed [src] passively!</span>")
return 1
@@ -186,6 +188,7 @@
if(!attack)
return 0
H.do_attack_animation(src)
if(!attack_message)
attack.show_attack(H, src, hit_zone, rand_damage)
else
@@ -220,6 +223,7 @@
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been disarmed by [M.name] ([M.ckey])</font>")
msg_admin_attack("[key_name(M)] disarmed [src.name] ([src.ckey])")
M.do_attack_animation(src)
if(w_uniform)
w_uniform.add_fingerprint(M)
@@ -278,6 +282,7 @@
user.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [user.name] ([user.ckey])</font>")
src.visible_message("<span class='danger'>[user] has [attack_message] [src]!</span>")
user.do_attack_animation(src)
var/dam_zone = pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg", "groin")
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
@@ -43,7 +43,7 @@ emp_act
if(P.can_embed())
var/armor = getarmor_organ(organ, "bullet")
if(prob(20 + max(P.damage - armor, -10)))
var/obj/item/weapon/shard/shrapnel/SP = new()
var/obj/item/weapon/material/shard/shrapnel/SP = new()
SP.name = (P.name != "shrapnel")? "[P.name] shrapnel" : "shrapnel"
SP.desc = "[SP.desc] It looks like it was fired from [P.shot_from]."
SP.loc = organ
@@ -253,6 +253,6 @@
visible_message("<span class='warning'>\The [src] quivers slightly, then splits apart with a wet slithering noise.</span>")
del(src)
qdel(src)
@@ -54,8 +54,10 @@ var/const/MAX_ACTIVE_TIME = 400
user << "\red \b It looks like the proboscis has been removed."
return
/obj/item/clothing/mask/facehugger/attackby()
Die()
/obj/item/clothing/mask/facehugger/attackby(obj/item/I, mob/user)
if(I.force)
user.do_attack_animation(src)
Die()
return
/obj/item/clothing/mask/facehugger/bullet_act()
@@ -63,7 +65,7 @@ var/const/MAX_ACTIVE_TIME = 400
return
/obj/item/clothing/mask/facehugger/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
if(exposed_temperature > T0C+80)
Die()
return
@@ -210,7 +210,7 @@
visible_message("<span class='warning'><B>[src] vomits up a thick purple substance and begins to shape it!</B></span>", "<span class='alium'>You shape a [choice].</span>")
switch(choice)
if("resin door")
new /obj/structure/mineral_door/resin(loc)
new /obj/structure/simple_door/resin(loc)
if("resin wall")
new /obj/effect/alien/resin/wall(loc)
if("resin membrane")
+2 -2
View File
@@ -118,7 +118,7 @@
say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
del(handcuffed)
qdel(handcuffed)
handcuffed = null
if(buckled && buckled.buckle_require_restraints)
buckled.unbuckle_mob()
@@ -139,7 +139,7 @@
say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
del(legcuffed)
qdel(legcuffed)
legcuffed = null
update_inv_legcuffed()
-17
View File
@@ -777,20 +777,3 @@ default behaviour is:
return
..()
/mob/living/carbon/proc/spin(spintime, speed)
spawn()
var/D = dir
while(spintime >= speed)
sleep(speed)
switch(D)
if(NORTH)
D = EAST
if(SOUTH)
D = WEST
if(EAST)
D = SOUTH
if(WEST)
D = NORTH
set_dir(D)
spintime -= speed
return
@@ -194,6 +194,7 @@
user.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [user.name] ([user.ckey])</font>")
src.visible_message("<span class='danger'>[user] has [attack_message] [src]!</span>")
user.do_attack_animation(src)
spawn(1) updatehealth()
return 1
@@ -92,7 +92,7 @@
icon_state = "gripper-sheet"
can_hold = list(
/obj/item/stack/sheet
/obj/item/stack/material
)
/obj/item/weapon/gripper/attack_self(mob/user as mob)
@@ -328,10 +328,10 @@
else if(istype(W,/obj/item/ammo_casing))
if(metal)
metal.add_charge(1000)
else if(istype(W,/obj/item/weapon/shard/shrapnel))
else if(istype(W,/obj/item/weapon/material/shard/shrapnel))
if(metal)
metal.add_charge(1000)
else if(istype(W,/obj/item/weapon/shard))
else if(istype(W,/obj/item/weapon/material/shard))
if(glass)
glass.add_charge(1000)
else if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/grown))
@@ -1081,8 +1081,9 @@
if(cell.charge == 0)
return 0
if(cell.use(amount * CELLRATE * CYBORG_POWER_USAGE_MULTIPLIER))
used_power_this_tick += amount * CYBORG_POWER_USAGE_MULTIPLIER
var/power_use = amount * CYBORG_POWER_USAGE_MULTIPLIER
if(cell.checked_use(CELLRATE * power_use))
used_power_this_tick += power_use
return 1
return 0
@@ -37,8 +37,8 @@
for(var/obj/I in contents)
for(var/mob/M in I.contents)
M.death()
if(istype(I,/obj/item/stack/sheet))//Only deconsturcts one sheet at a time instead of the entire stack
var/obj/item/stack/sheet/S = I
if(istype(I,/obj/item/stack/material))//Only deconsturcts one sheet at a time instead of the entire stack
var/obj/item/stack/material/S = I
if(S.get_amount() > 1)
S.use(1)
loaded_item = S
@@ -310,7 +310,7 @@ var/global/list/robot_modules = list(
synths += plasteel
synths += glass
var/obj/item/stack/sheet/metal/cyborg/M = new /obj/item/stack/sheet/metal/cyborg(src)
var/obj/item/stack/material/cyborg/steel/M = new (src)
M.synths = list(metal)
src.modules += M
@@ -318,11 +318,11 @@ var/global/list/robot_modules = list(
R.synths = list(metal)
src.modules += R
var/obj/item/stack/sheet/plasteel/cyborg/S = new /obj/item/stack/sheet/plasteel/cyborg(src)
var/obj/item/stack/material/cyborg/plasteel/S = new (src)
S.synths = list(plasteel)
src.modules += S
var/obj/item/stack/sheet/glass/reinforced/cyborg/RG = new /obj/item/stack/sheet/glass/reinforced/cyborg(src)
var/obj/item/stack/material/cyborg/glass/reinforced/RG = new (src)
RG.synths = list(metal, glass)
src.modules += RG
@@ -356,11 +356,11 @@ var/global/list/robot_modules = list(
MD.glass = glass
src.modules += MD
var/obj/item/stack/sheet/metal/cyborg/M = new /obj/item/stack/sheet/metal/cyborg(src)
var/obj/item/stack/material/cyborg/steel/M = new (src)
M.synths = list(metal)
src.modules += M
var/obj/item/stack/sheet/glass/cyborg/G = new /obj/item/stack/sheet/glass/cyborg(src)
var/obj/item/stack/material/cyborg/glass/G = new (src)
G.synths = list(glass)
src.modules += G
@@ -376,7 +376,7 @@ var/global/list/robot_modules = list(
S.synths = list(metal)
src.modules += S
var/obj/item/stack/sheet/glass/reinforced/cyborg/RG = new /obj/item/stack/sheet/glass/reinforced/cyborg(src)
var/obj/item/stack/material/cyborg/glass/reinforced/RG = new (src)
RG.synths = list(metal, glass)
src.modules += RG
@@ -484,8 +484,8 @@ var/global/list/robot_modules = list(
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/weapon/gripper/service(src)
src.modules += new /obj/item/weapon/reagent_containers/glass/bucket(src)
src.modules += new /obj/item/weapon/minihoe(src)
src.modules += new /obj/item/weapon/hatchet(src)
src.modules += new /obj/item/weapon/material/minihoe(src)
src.modules += new /obj/item/weapon/material/hatchet(src)
src.modules += new /obj/item/device/analyzer/plant_analyzer(src)
src.modules += new /obj/item/weapon/storage/bag/plants(src)
src.modules += new /obj/item/weapon/robot_harvester(src)
@@ -676,11 +676,11 @@ var/global/list/robot_modules = list(
MD.plastic = plastic
src.modules += MD
var/obj/item/stack/sheet/metal/cyborg/M = new /obj/item/stack/sheet/metal/cyborg(src)
var/obj/item/stack/material/cyborg/steel/M = new (src)
M.synths = list(metal)
src.modules += M
var/obj/item/stack/sheet/glass/cyborg/G = new /obj/item/stack/sheet/glass/cyborg(src)
var/obj/item/stack/material/cyborg/glass/G = new (src)
G.synths = list(glass)
src.modules += G
@@ -696,7 +696,7 @@ var/global/list/robot_modules = list(
S.synths = list(metal)
src.modules += S
var/obj/item/stack/sheet/glass/reinforced/cyborg/RG = new /obj/item/stack/sheet/glass/reinforced/cyborg(src)
var/obj/item/stack/material/cyborg/glass/reinforced/RG = new (src)
RG.synths = list(metal, glass)
src.modules += RG
@@ -704,11 +704,11 @@ var/global/list/robot_modules = list(
WT.synths = list(wood)
src.modules += WT
var/obj/item/stack/sheet/wood/cyborg/W = new /obj/item/stack/sheet/wood/cyborg(src)
var/obj/item/stack/material/cyborg/wood/W = new (src)
W.synths = list(wood)
src.modules += W
var/obj/item/stack/sheet/mineral/plastic/cyborg/P = new /obj/item/stack/sheet/mineral/plastic/cyborg(src)
var/obj/item/stack/material/cyborg/plastic/P = new (src)
P.synths = list(plastic)
src.modules += P
@@ -51,7 +51,7 @@
if(locate(/obj/machinery/portable_atmospherics/hydroponics/soil/invisible) in loc)
var/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/SP = locate() in loc
del(SP)
qdel(SP)
if(!pulledby)
var/obj/effect/plant/food
@@ -135,19 +135,7 @@
spawn(300) src.explode()
else
if(O.force)
var/damage = O.force
if (O.damtype == HALLOSS)
damage = 0
adjustBruteLoss(damage)
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("\red \b [src] has been attacked with the [O] by [user]. ")
else
usr << "\red This weapon is ineffective, it does no damage."
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("\red [user] gently taps [src] with the [O]. ")
attacked_with_item(O, user)
/mob/living/simple_animal/spiderbot/proc/transfer_personality(var/obj/item/device/mmi/M as obj)
@@ -232,8 +232,8 @@
if(istype(A,/obj/machinery/door/airlock))
var/obj/machinery/door/airlock/D = A
D.open(1)
else if(istype(A,/obj/structure/mineral_door))
var/obj/structure/mineral_door/D = A
else if(istype(A,/obj/structure/simple_door))
var/obj/structure/simple_door/D = A
if(D.density)
D.Open()
else if(istype(A,/obj/structure/cult/pylon))
@@ -170,16 +170,16 @@
var/obj/O
//shards
O = new /obj/item/weapon/shard(src.loc)
O = new /obj/item/weapon/material/shard(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(75))
O = new /obj/item/weapon/shard(src.loc)
O = new /obj/item/weapon/material/shard(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(50))
O = new /obj/item/weapon/shard(src.loc)
O = new /obj/item/weapon/material/shard(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(25))
O = new /obj/item/weapon/shard(src.loc)
O = new /obj/item/weapon/material/shard(src.loc)
step_to(O, get_turf(pick(view(7, src))))
//rods
@@ -196,16 +196,16 @@
step_to(O, get_turf(pick(view(7, src))))
//plasteel
O = new /obj/item/stack/sheet/plasteel(src.loc)
O = new /obj/item/stack/material/plasteel(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(75))
O = new /obj/item/stack/sheet/plasteel(src.loc)
O = new /obj/item/stack/material/plasteel(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(50))
O = new /obj/item/stack/sheet/plasteel(src.loc)
O = new /obj/item/stack/material/plasteel(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(25))
O = new /obj/item/stack/sheet/plasteel(src.loc)
O = new /obj/item/stack/material/plasteel(src.loc)
step_to(O, get_turf(pick(view(7, src))))
//also drop dummy circuit boards deconstructable for research (loot)
@@ -20,7 +20,7 @@
attacktext = "punched"
a_intent = I_HURT
var/corpse = /obj/effect/landmark/mobcorpse/russian
var/weapon1 = /obj/item/weapon/kitchenknife
var/weapon1 = /obj/item/weapon/material/knife
min_oxy = 5
max_oxy = 0
min_tox = 0
@@ -68,6 +68,7 @@
visible_message("\red \b [src] has been attacked with the [O] by [user]. ")
else
visible_message("\red \b [src] blocks the [O] with its shield! ")
//user.do_attack_animation(src)
else
usr << "\red This weapon is ineffective, it does no damage."
visible_message("\red [user] gently taps [src] with the [O]. ")
@@ -52,5 +52,5 @@
/mob/living/simple_animal/hostile/tree/death()
..(null,"is hacked into pieces!")
new /obj/item/stack/sheet/wood(loc)
new /obj/item/stack/material/wood(loc)
qdel(src)
@@ -240,6 +240,7 @@
if(I_DISARM)
M.visible_message("\blue [M] [response_disarm] \the [src]")
M.do_attack_animation(src)
//TODO: Push the mob away or something
if(I_GRAB)
@@ -257,10 +258,12 @@
LAssailant = M
M.visible_message("\red [M] has grabbed [src] passively!")
M.do_attack_animation(src)
if(I_HURT)
adjustBruteLoss(harm_intent_damage)
M.visible_message("\red [M] [response_harm] \the [src]")
M.do_attack_animation(src)
return
@@ -279,28 +282,33 @@
if ((M.client && !( M.blinded )))
M.show_message("<span class='notice'>[user] applies the [MED] on [src].</span>")
else
user << "<span class='notice'>\The [src] is dead, medical items won't bring it back to life.</span>"
user << "<span class='notice'>\The [src] is dead, medical items won't bring \him back to life.</span>"
if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
if(istype(O, /obj/item/weapon/kitchenknife) || istype(O, /obj/item/weapon/butch))
if(istype(O, /obj/item/weapon/material/knife) || istype(O, /obj/item/weapon/material/knife/butch))
harvest(user)
else
user.changeNext_move(8)
if(O.force > resistance)
var/damage = O.force
if (O.damtype == HALLOSS)
damage = 0
if(supernatural && istype(O,/obj/item/weapon/nullrod))
damage *= 2
purge = 3
adjustBruteLoss(damage)
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("<span class='danger>[src] has been attacked with the [O] by [user].</span>")
else
usr << "<span class='danger>This weapon is ineffective, it does no damage.</span>"
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("<span class='notice'>[user] gently taps [src] with \the [O].</span>")
attacked_with_item(O, user)
//TODO: refactor mob attackby(), attacked_by(), and friends.
/mob/living/simple_animal/proc/attacked_with_item(var/obj/item/O, var/mob/user)
user.changeNext_move(8)
if(!O.force)
visible_message("<span class='notice'>[user] gently taps [src] with \the [O].</span>")
return
if(O.force > resistance)
var/damage = O.force
if (O.damtype == HALLOSS)
damage = 0
if(supernatural && istype(O,/obj/item/weapon/nullrod))
damage *= 2
purge = 3
adjustBruteLoss(damage)
else
usr << "<span class='danger>This weapon is ineffective, it does no damage.</span>"
visible_message("<span class='danger>[src] has been attacked with the [O] by [user].</span>")
user.do_attack_animation(src)
/mob/living/simple_animal/movement_delay()
var/tally = 0 //Incase I need to add stuff other than "speed" later
@@ -175,18 +175,18 @@
for(var/atom/movable/stomachContent in contents)
if(prob(digestionProbability))
if(istype(stomachContent,/obj/item/stack)) //converts to plasma, keeping the stack value
if(!istype(stomachContent,/obj/item/stack/sheet/mineral/phoron))
if(!istype(stomachContent,/obj/item/stack/material/phoron))
var/obj/item/stack/oldStack = stomachContent
new /obj/item/stack/sheet/mineral/phoron(src, oldStack.get_amount())
new /obj/item/stack/material/phoron(src, oldStack.get_amount())
qdel(oldStack)
continue
else if(istype(stomachContent,/obj/item)) //converts to plasma, keeping the w_class
var/obj/item/oldItem = stomachContent
new /obj/item/stack/sheet/mineral/phoron(src, oldItem.w_class)
new /obj/item/stack/material/phoron(src, oldItem.w_class)
qdel(oldItem)
continue
else
new /obj/item/stack/sheet/mineral/phoron(src, flatPlasmaValue) //just flat amount
new /obj/item/stack/material/phoron(src, flatPlasmaValue) //just flat amount
qdel(stomachContent)
continue
-105
View File
@@ -601,111 +601,6 @@
for(var/mob/M in viewers())
M.see(message)
/*
adds a dizziness amount to a mob
use this rather than directly changing var/dizziness
since this ensures that the dizzy_process proc is started
currently only humans get dizzy
value of dizziness ranges from 0 to 1000
below 100 is not dizzy
*/
/mob/proc/make_dizzy(var/amount)
if(!istype(src, /mob/living/carbon/human)) // for the moment, only humans get dizzy
return
dizziness = min(1000, dizziness + amount) // store what will be new value
// clamped to max 1000
if(dizziness > 100 && !is_dizzy)
spawn(0)
dizzy_process()
/*
dizzy process - wiggles the client's pixel offset over time
spawned from make_dizzy(), will terminate automatically when dizziness gets <100
note dizziness decrements automatically in the mob's Life() proc.
*/
/mob/proc/dizzy_process()
is_dizzy = 1
while(dizziness > 100)
if(client)
var/amplitude = dizziness*(sin(dizziness * 0.044 * world.time) + 1) / 70
client.pixel_x = amplitude * sin(0.008 * dizziness * world.time)
client.pixel_y = amplitude * cos(0.008 * dizziness * world.time)
sleep(1)
//endwhile - reset the pixel offsets to zero
is_dizzy = 0
if(client)
client.pixel_x = 0
client.pixel_y = 0
// jitteriness - copy+paste of dizziness
/mob/proc/make_jittery(var/amount)
if(!istype(src, /mob/living/carbon/human)) // for the moment, only humans get dizzy
return
jitteriness = min(1000, jitteriness + amount) // store what will be new value
// clamped to max 1000
if(jitteriness > 100 && !is_jittery)
spawn(0)
jittery_process()
// Typo from the oriignal coder here, below lies the jitteriness process. So make of his code what you will, the previous comment here was just a copypaste of the above.
/mob/proc/jittery_process()
//var/old_x = pixel_x
//var/old_y = pixel_y
is_jittery = 1
while(jitteriness > 100)
// var/amplitude = jitteriness*(sin(jitteriness * 0.044 * world.time) + 1) / 70
// pixel_x = amplitude * sin(0.008 * jitteriness * world.time)
// pixel_y = amplitude * cos(0.008 * jitteriness * world.time)
var/amplitude = min(4, jitteriness / 100)
pixel_x = old_x + rand(-amplitude, amplitude)
pixel_y = old_y + rand(-amplitude/3, amplitude/3)
sleep(1)
//endwhile - reset the pixel offsets to zero
is_jittery = 0
pixel_x = old_x
pixel_y = old_y
//handles up-down floaty effect in space
/mob/proc/make_floating(var/n)
floatiness = n
if(floatiness && !is_floating)
start_floating()
else if(!floatiness && is_floating)
stop_floating()
/mob/proc/start_floating()
is_floating = 1
var/amplitude = 2 //maximum displacement from original position
var/period = 36 //time taken for the mob to go up >> down >> original position, in deciseconds. Should be multiple of 4
var/top = old_y + amplitude
var/bottom = old_y - amplitude
var/half_period = period / 2
var/quarter_period = period / 4
animate(src, pixel_y = top, time = quarter_period, easing = SINE_EASING | EASE_OUT, loop = -1) //up
animate(pixel_y = bottom, time = half_period, easing = SINE_EASING, loop = -1) //down
animate(pixel_y = old_y, time = quarter_period, easing = SINE_EASING | EASE_IN, loop = -1) //back
/mob/proc/stop_floating()
animate(src, pixel_y = old_y, time = 5, easing = SINE_EASING | EASE_IN) //halt animation
//reset the pixel offsets to zero
is_floating = 0
/mob/Stat()
..()
-6
View File
@@ -108,12 +108,6 @@
var/old_x = 0
var/old_y = 0
var/drowsyness = 0.0//Carbon
var/dizziness = 0//Carbon
var/is_dizzy = 0
var/is_jittery = 0
var/jitteriness = 0//Carbon
var/is_floating = 0
var/floatiness = 0
var/charges = 0.0
var/nutrition = 400.0//Carbon
+1
View File
@@ -328,6 +328,7 @@
bad = 1
if(E.status & ORGAN_DEAD)
assailant << "<span class='warning'>[E] is decaying!</span>"
bad = 1
if(!bad)
assailant << "<span class='notice'>[H]'s skin is normal.</span>"
else