From 7cb9429a8540c9780e42731ad7c154b06bdd84a3 Mon Sep 17 00:00:00 2001 From: "vageyenaman@gmail.com" Date: Mon, 18 Jul 2011 19:58:29 +0000 Subject: [PATCH] Okay, so this is a pretty big change. Guns: The projectile code has been mostly reworked to provide better support for effects, dynamic damage, etc. This also makes adding new projectiles easier for other coders. This is a pretty big change! If you see any bugs, get on IRC and bug me about it before the change goes live on the server! Miscellaneous: I fixed some bugs with Metroids hopefully. Turrets now don't identify people laying down as a threat. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1884 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/spells/ethereal_jaunt.dm | 2 +- code/defines/mob/living/carbon/metroid.dm | 2 +- code/game/gamemodes/blob/theblob.dm | 12 +- code/game/gamemodes/events/ninja_equipment.dm | 12 +- code/game/machinery/atmoalter/canister.dm | 4 +- code/game/machinery/bots/bots.dm | 17 +- code/game/machinery/bots/medbot.dm | 4 +- code/game/machinery/portable_turret.dm | 34 +- code/game/machinery/shieldgen.dm | 49 +- code/game/machinery/turrets.dm | 46 +- code/game/magic/magicmonster.dm | 17 +- code/game/mecha/equipment/tools/tools.dm | 29 +- code/game/mecha/equipment/weapons/weapons.dm | 6 +- code/game/mecha/mecha.dm | 55 +- code/game/objects/alien/egg.dm | 20 +- code/game/objects/alien/facehugger.dm | 20 +- code/game/objects/alien/resin.dm | 14 +- code/game/objects/closets.dm | 4 +- code/game/objects/devices/PDA/PDA.dm | 2 +- code/game/objects/displaycase.dm | 18 +- code/game/objects/items.dm | 2 +- code/game/objects/items/weapons/guns_new.dm | 132 +++- code/game/objects/lamarr.dm | 20 +- code/game/objects/livestock.dm | 31 +- code/game/objects/secure_closets.dm | 2 +- code/game/objects/weapons.dm | 4 +- code/game/objects/window.dm | 23 +- .../carbon/alien/humanoid/caste/sentinel.dm | 2 +- .../living/carbon/alien/humanoid/humanoid.dm | 145 ++--- .../mob/living/carbon/alien/larva/larva.dm | 144 ++--- code/modules/mob/living/carbon/human/human.dm | 596 +++++++----------- .../modules/mob/living/carbon/metroid/life.dm | 15 +- .../mob/living/carbon/metroid/metroid.dm | 103 +-- .../mob/living/carbon/metroid/powers.dm | 23 +- .../mob/living/carbon/monkey/monkey.dm | 136 ++-- code/modules/mob/living/living.dm | 178 +++--- code/modules/mob/living/silicon/ai/ai.dm | 45 +- code/modules/mob/living/silicon/pai/pai.dm | 43 +- .../modules/mob/living/silicon/robot/robot.dm | 87 +-- .../power/singularity/field_generator.dm | 21 +- 40 files changed, 754 insertions(+), 1365 deletions(-) diff --git a/code/datums/spells/ethereal_jaunt.dm b/code/datums/spells/ethereal_jaunt.dm index 9d543f69d0c..159e9cccbad 100644 --- a/code/datums/spells/ethereal_jaunt.dm +++ b/code/datums/spells/ethereal_jaunt.dm @@ -82,5 +82,5 @@ /obj/dummy/spell_jaunt/ex_act(blah) return -/obj/dummy/spell_jaunt/bullet_act(blah,blah) +/obj/dummy/spell_jaunt/bullet_act(blah) return \ No newline at end of file diff --git a/code/defines/mob/living/carbon/metroid.dm b/code/defines/mob/living/carbon/metroid.dm index 81ebd8da5b4..dffbd2fade0 100644 --- a/code/defines/mob/living/carbon/metroid.dm +++ b/code/defines/mob/living/carbon/metroid.dm @@ -6,7 +6,7 @@ icon = 'mob.dmi' icon_state = "baby metroid" pass_flags = PASSTABLE - voice_message = "chatters" + voice_message = "skree!" say_message = "says" health = 150 diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 0b5dfbb4e7c..f0c9ddefd1c 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -99,18 +99,12 @@ return icon_state = "bloba0" -/obj/blob/bullet_act(flag) +/obj/blob/bullet_act(var/obj/item/projectile/Proj) - if (flag == PROJECTILE_BULLET) - health -= 10 - update() - if (flag == PROJECTILE_BULLETBURST) - health -= 4 - update() - else if (flag == PROJECTILE_BOLT) + if (istype(Proj, /obj/item/projectile/bolt)) poisoned(1) else - health -= 20 + health -= Proj.damage update() diff --git a/code/game/gamemodes/events/ninja_equipment.dm b/code/game/gamemodes/events/ninja_equipment.dm index 438d8c58126..e54980e8abb 100644 --- a/code/game/gamemodes/events/ninja_equipment.dm +++ b/code/game/gamemodes/events/ninja_equipment.dm @@ -1380,16 +1380,8 @@ It is possible to destroy the net by the occupant or someone else. M << "\blue You are free of the net!" return - bullet_act(flag) - switch(flag) - if (PROJECTILE_BULLET) - health -= 35 - if (PROJECTILE_BULLETBURST) - health -= 13 - if (PROJECTILE_PULSE) - health -= 50 - if (PROJECTILE_LASER) - health -= 10 + bullet_act(var/obj/item/projectile/Proj) + health -= Proj.damage healthcheck() return diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 2209e229996..f37811e1b55 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -252,8 +252,8 @@ Release Pressure: - [src] beeps, \"[message]\"",2) return -/obj/machinery/bot/medbot/bullet_act(flag, A as obj) - if (flag == PROJECTILE_TASER) +/obj/machinery/bot/medbot/bullet_act(var/obj/item/projectile/Proj) + if (Proj.flag == "taser") src.stunned = min(stunned+10,20) ..() diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 208f8d78794..3dd084e6fda 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -25,7 +25,7 @@ var/raised = 0 // if the turret cover is "open" and the turret is raised var/raising= 0 // if the turret is currently opening or closing its cover - var/health = 60 // the turret's health. can withstand health/10 laser shots + var/health = 80 // the turret's health var/locked = 1 // if the turret's behaviour control access is locked var/installation // the type of weapon installed @@ -225,7 +225,7 @@ Neutralize All Unidentified Life Signs: []
"}, -/obj/machinery/porta_turret/bullet_act(flag) +/obj/machinery/porta_turret/bullet_act(var/obj/item/projectile/Proj) if(on) if(!attacked && !emagged) attacked = 1 @@ -233,24 +233,8 @@ Neutralize All Unidentified Life Signs: []
"}, sleep(60) attacked = 0 - // handles how much damage each type of projectile deals - if (flag == PROJECTILE_BULLET) - src.health -= 5 - else if (flag == PROJECTILE_BULLETBURST) - src.health -= 2 - else if (flag == PROJECTILE_TASER) - src.health -= 1 - else if(flag == PROJECTILE_PULSE) - if(prob(25)) src.spark_system.start() // creates some sparks - src.health -= 30 - else if(flag == PROJECTILE_SHOCK) - if(prob(25)) src.spark_system.start() - src.health -= 15 - else if(flag == PROJECTILE_LASER) - if(prob(25)) src.spark_system.start() - src.health -= 10 - else - src.health -= 2 + src.health -= Proj.damage + if(prob(45) && Proj.damage > 0) src.spark_system.start() if (src.health <= 0) src.die() // the death process :( return @@ -333,20 +317,20 @@ Neutralize All Unidentified Life Signs: []
"}, if (C.stat || C.handcuffed) // if the perp is handcuffed or dead/dying, no need to bother really continue // move onto next potential victim! - if (C.lying) // if the perp is lying down, it's still a target but a less-important target - secondarytargets += C - if (istype(C, /mob/living/carbon/human)) // if the target is a human, analyze threat level if(src.assess_perp(C)<4) continue // if threat level < 4, keep going - else if (istype(C, /mob/living/carbon/monkey)) - continue // WHY WOULD YOU TARGET MONKIES???? Skip all monkies, jesus, don't waste your time bro + else if (istype(C, /mob/living/carbon/monkey) || istype(C, /mob/living/silicon)) + continue // Don't target monkies or borgs/AIs you dumb shit var/dst = get_dist(src, C) // if it's too far away, why bother? if (dst > 12) continue + if (C.lying) // if the perp is lying down, it's still a target but a less-important target + secondarytargets += C + targets += C // if the perp has passed all previous tests, congrats, it is now a "shoot-me!" nominee if (targets.len>0) // if there are targets to shoot diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index c5fc356f757..259f9add509 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -376,29 +376,9 @@ src.cleanup(8) ..() -/obj/machinery/shieldwallgen/bullet_act(flag) +/obj/machinery/shieldwallgen/bullet_act(var/obj/item/projectile/Proj) - switch(flag) - if (PROJECTILE_BULLET) - src.storedpower -= 10 - if (PROJECTILE_BULLETBURST) - src.storedpower -= 4 - if (PROJECTILE_WEAKBULLET) - src.storedpower -= 1 - if (PROJECTILE_WEAKBULLETBURST) - src.storedpower -= 1 - if (PROJECTILE_WEAKERBULLETBURST) - src.storedpower -= 0.5 - if (PROJECTILE_LASER) - src.storedpower +=20 - if (PROJECTILE_SHOCK) - src.storedpower +=25 - if (PROJECTILE_TASER) - src.storedpower +=3 - if (PROJECTILE_PULSE) - src.storedpower +=50 - else - src.storedpower -=2 + storedpower -= Proj.damage return @@ -506,7 +486,7 @@ gen_secondary.storedpower -=10 -/obj/machinery/shieldwall/bullet_act(flag) +/obj/machinery/shieldwall/bullet_act(var/obj/item/projectile/Proj) if(needs_power) var/obj/machinery/shieldwallgen/G @@ -514,27 +494,8 @@ G = gen_primary else G = gen_secondary - switch(flag) - if (PROJECTILE_BULLET) - G.storedpower -= 10 - if (PROJECTILE_BULLETBURST) - G.storedpower -= 4 - if (PROJECTILE_WEAKBULLET) - G.storedpower -=1 - if (PROJECTILE_WEAKBULLETBURST) - G.storedpower -=1 - if (PROJECTILE_WEAKERBULLETBURST) - G.storedpower -=0.5 - if (PROJECTILE_LASER) - G.storedpower +=20 - if (PROJECTILE_SHOCK) - G.storedpower +=25 - if (PROJECTILE_TASER) - G.storedpower +=3 - if (PROJECTILE_PULSE) - G.storedpower +=50 - else - G.storedpower -=2 + + G.storedpower -= Proj.damage return diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index 5a5cff4a425..46cff977e97 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -51,7 +51,7 @@ invisibility = 2 density = 1 var/lasers = 0 - var/health = 40 + var/health = 80 var/obj/machinery/turretcover/cover = null var/popping = 0 var/wasvalid = 0 @@ -228,18 +228,9 @@ invisibility = 2 popping = 0 -/obj/machinery/turret/bullet_act(flag) - if (flag == PROJECTILE_BULLET) - src.health -= 17 - else if (flag == PROJECTILE_BULLETBURST) - src.health -= 7 - else if (flag == PROJECTILE_TASER) //taser - src.health -= 1 - else if(flag == PROJECTILE_PULSE) - src.health -= 30 - else - src.health -= 2 - src.spark_system.start() +/obj/machinery/turret/bullet_act(var/obj/item/projectile/Proj) + src.health -= Proj.damage + if(prob(45) && Proj.damage > 0) src.spark_system.start() if (src.health <= 0) src.die() return @@ -433,34 +424,13 @@ del src return - bullet_act(flag) - var/damage = 0 - switch(flag) - if(PROJECTILE_PULSE) - damage = 40 - if(PROJECTILE_LASER) - damage = 20 - if(PROJECTILE_SHOCK) - damage = 25 - if(PROJECTILE_TASER) - damage = 8 - if(PROJECTILE_WEAKBULLET) - damage = 8 - if(PROJECTILE_WEAKBULLETBURST) - damage = 4 - if(PROJECTILE_WEAKERBULLETBURST) - damage = 2 - if(PROJECTILE_BULLET) - damage = 10 - if(PROJECTILE_BULLETBURST) - damage = 4 - if(PROJECTILE_BOLT) - damage = 5 - if(PROJECTILE_DART) - damage = 5 + + bullet_act(var/obj/item/projectile/Proj) + var/damage = Proj.damage src.take_damage(damage) return + attack_hand(mob/user as mob) user.machine = src var/dat = {" diff --git a/code/game/magic/magicmonster.dm b/code/game/magic/magicmonster.dm index 3552ac53884..46c700c01a6 100644 --- a/code/game/magic/magicmonster.dm +++ b/code/game/magic/magicmonster.dm @@ -75,21 +75,8 @@ src.state = 1 ..() - bullet_act(flag, A as obj) - if (flag == PROJECTILE_BULLET) - src.health -= 20 - else if (flag == PROJECTILE_BULLETBURST) - src.health -= 8 - else if (flag == PROJECTILE_WEAKBULLET) - src.health -= 4 - else if (flag == PROJECTILE_WEAKBULLETBURST) - src.health -= 2 - else if (flag == PROJECTILE_WEAKERBULLETBURST) - src.health -= 1 - else if (flag == PROJECTILE_LASER) - src.health -= 10 - else if (flag == PROJECTILE_SHOCK) - src.health -= 15 + bullet_act(var/obj/item/projectile/Proj) + health -= round(Proj.damage / 2) healthcheck() ex_act(severity) diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index f366e83d8dc..3993949b450 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -471,33 +471,10 @@ ..() return - proc/dynbulletdamage(flag) + proc/dynbulletdamage(var/obj/item/projectile/Proj) if(!action_checks(src)) - return chassis.dynbulletdamage(flag) - var/damage - switch(flag) - if(PROJECTILE_PULSE) - damage = 30 - if(PROJECTILE_LASER) - damage = 20 - if(PROJECTILE_SHOCK) - damage = 25 - if(PROJECTILE_WEAKBULLET) - damage = 8 - if(PROJECTILE_WEAKBULLETBURST) - damage = 4 - if(PROJECTILE_WEAKERBULLETBURST) - damage = 2 - if(PROJECTILE_BULLET) - damage = 10 - if(PROJECTILE_BULLETBURST) - damage = 4 - if(PROJECTILE_BOLT) - damage = 5 - if(PROJECTILE_DART) - damage = 5 - else - return + return chassis.dynbulletdamage(Proj) + var/damage = Proj.damage chassis.take_damage(round(damage*src.damage_coeff)) chassis.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST)) set_ready_state(0) diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index 6e6b7e643d8..480c2ee5143 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -75,7 +75,7 @@ var/life = 20 Bump(atom/A) - A.bullet_act(PROJECTILE_PULSE, src, def_zone) + A.bullet_act(src, def_zone) src.life -= 10 if(life <= 0) del(src) @@ -133,7 +133,7 @@ return 0 if(!equip_ready) return 0 - set_ready_state(0) + playsound(chassis, 'AirHorn.ogg', 100, 1) chassis.occupant_message("HONK") for(var/mob/living/carbon/M in ohearers(6, chassis)) @@ -221,6 +221,7 @@ targloc = locate(target_x+GaussRandRound(deviation,1),target_y+GaussRandRound(deviation,1),target_z) if(!targloc || targloc == curloc) break + playsound(chassis, 'Gunshot.ogg', 80, 1) var/obj/item/projectile/A = new /obj/item/projectile(curloc) src.projectiles-- @@ -260,6 +261,7 @@ continue if (targloc == curloc) continue + playsound(chassis, 'Gunshot.ogg', 50, 1) var/obj/item/projectile/weakbullet/A = new /obj/item/projectile/weakbullet(curloc) src.projectiles-- diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index ce5372c5a18..d3a9987d7df 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -371,58 +371,27 @@ return -/obj/mecha/bullet_act(flag) - var/dam_type - switch(flag) - if(PROJECTILE_PULSE) - dam_type = "Pulse" - if(PROJECTILE_LASER) - dam_type = "Laser" - if(PROJECTILE_SHOCK) - dam_type = "Shock" - if(PROJECTILE_TASER) - dam_type = "Taser" - else - dam_type = "Default" - src.log_message("Hit by projectile. Type: [dam_type]([flag]).",1) +/obj/mecha/bullet_act(var/obj/item/projectile/Proj) + src.log_message("Hit by projectile. Type: [Proj.name]([Proj.flag]).",1) if(prob(src.deflect_chance)) src.occupant_message("\blue The armor deflects the incoming projectile.") src.visible_message("The [src.name] armor deflects the projectile") src.log_append_to_last("Armor saved.") else - call((proc_res["dynbulletdamage"]||src), "dynbulletdamage")(flag) //calls equipment + call((proc_res["dynbulletdamage"]||src), "dynbulletdamage")(Proj) //calls equipment return -/obj/mecha/proc/dynbulletdamage(flag) +/obj/mecha/proc/dynbulletdamage(var/obj/item/projectile/Proj) var/damage var/ignore_threshold - switch(flag) - if(PROJECTILE_PULSE) - damage = 40 - ignore_threshold = 1 - if(PROJECTILE_LASER) - damage = 20 - if(PROJECTILE_SHOCK) - damage = 25 - use_power(500) - if(PROJECTILE_TASER) - use_power(500) - if(PROJECTILE_WEAKBULLET) - damage = 8 - if(PROJECTILE_WEAKBULLETBURST) - damage = 4 - if(PROJECTILE_WEAKERBULLETBURST) - damage = 2 - if(PROJECTILE_BULLET) - damage = 10 - if(PROJECTILE_BULLETBURST) - damage = 4 - if(PROJECTILE_BOLT) - damage = 5 - if(PROJECTILE_DART) - damage = 5 - else - return + + if(Proj.flag == "taser") + use_power(500) + return + if(istype(Proj, /obj/item/projectile/beam/pulse)) + ignore_threshold = 1 + + damage = Proj.damage src.take_damage(damage) src.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST),ignore_threshold) return diff --git a/code/game/objects/alien/egg.dm b/code/game/objects/alien/egg.dm index 0fceab2eb9b..e6f4fad2fc5 100644 --- a/code/game/objects/alien/egg.dm +++ b/code/game/objects/alien/egg.dm @@ -12,24 +12,8 @@ src.icon_state = "egg_hatched" new /obj/alien/facehugger(src.loc) -/obj/alien/egg/bullet_act(flag) - switch(flag) - if (PROJECTILE_BULLET) - health -= 35 - if (PROJECTILE_BULLETBURST) - health -= 13 - if (PROJECTILE_WEAKBULLET) - health -= 12 - if (PROJECTILE_WEAKBULLETBURST) - health -= 6 - if (PROJECTILE_WEAKERBULLETBURST) - health -= 3 - if (PROJECTILE_PULSE) - health -= 50 - if (PROJECTILE_LASER) - health -= 10 - if (PROJECTILE_SHOCK) - health -= 15 +/obj/alien/egg/bullet_act(var/obj/item/projectile/Proj) + health -= Proj.damage healthcheck() return diff --git a/code/game/objects/alien/facehugger.dm b/code/game/objects/alien/facehugger.dm index 50cbff8a789..a827c9fc47b 100644 --- a/code/game/objects/alien/facehugger.dm +++ b/code/game/objects/alien/facehugger.dm @@ -85,24 +85,8 @@ state = 1 ..() - bullet_act(flag, A as obj) - switch(flag) - if (PROJECTILE_BULLET) - health -= 20 - if (PROJECTILE_BULLETBURST) - health -= 7 - if (PROJECTILE_WEAKBULLET) - health -= 4 - if (PROJECTILE_WEAKBULLETBURST) - health -= 2 - if (PROJECTILE_WEAKERBULLETBURST) - health -= 1 - if (PROJECTILE_LASER) - health -= 10 - if (PROJECTILE_SHOCK) - health -= 20 - if (PROJECTILE_PULSE) - health -= 35 + bullet_act(var/obj/item/projectile/Proj) + health -= round(Proj.damage / 2) healthcheck() ex_act(severity) diff --git a/code/game/objects/alien/resin.dm b/code/game/objects/alien/resin.dm index 58a9e3203bc..6d2fef57712 100644 --- a/code/game/objects/alien/resin.dm +++ b/code/game/objects/alien/resin.dm @@ -17,18 +17,8 @@ del(src) return -/obj/alien/resin/bullet_act(flag) - switch(flag) - if (PROJECTILE_BULLET) - health -= 35 - if (PROJECTILE_BULLETBURST) - health -= 13 - if (PROJECTILE_PULSE) - health -= 50 - if (PROJECTILE_LASER) - health -= 10 - if (PROJECTILE_SHOCK) - health -= 15 +/obj/alien/resin/bullet_act(var/obj/item/projectile/Proj) + health -= Proj.damage healthcheck() return diff --git a/code/game/objects/closets.dm b/code/game/objects/closets.dm index a8c3673cd05..e2ffe3849f3 100644 --- a/code/game/objects/closets.dm +++ b/code/game/objects/closets.dm @@ -102,7 +102,7 @@ ex_act(severity) del(src) -/obj/closet/bullet_act(flag) +/obj/closet/bullet_act(var/obj/item/projectile/Proj) /* Just in case someone gives closets health if (flag == PROJECTILE_BULLET) @@ -118,7 +118,7 @@ src.healthcheck() return */ - if(prob(4)) + if(prob(40) && istype(Proj, /obj/item/projectile/beam/pulse)) for (var/atom/movable/A as mob|obj in src) A.loc = src.loc del(src) diff --git a/code/game/objects/devices/PDA/PDA.dm b/code/game/objects/devices/PDA/PDA.dm index 8653279db16..184a40aac7b 100644 --- a/code/game/objects/devices/PDA/PDA.dm +++ b/code/game/objects/devices/PDA/PDA.dm @@ -7,7 +7,7 @@ icon = 'pda.dmi' icon_state = "pda" item_state = "electronic" - w_class = 2.0 + w_class = 1.0 flags = FPRINT | TABLEPASS | ONBELT //Main variables diff --git a/code/game/objects/displaycase.dm b/code/game/objects/displaycase.dm index fb9d60954fc..71a1674b41b 100644 --- a/code/game/objects/displaycase.dm +++ b/code/game/objects/displaycase.dm @@ -15,26 +15,14 @@ src.health -= 5 src.healthcheck() -/obj/displaycase/bullet_act(flag) +/obj/displaycase/bullet_act(var/obj/item/projectile/Proj) - if (flag == PROJECTILE_BULLET) + if (Proj.flag == "bullet") src.health -= 10 src.healthcheck() return - if (flag == PROJECTILE_BULLETBURST) - src.health -= 4 - src.healthcheck() - return - if (flag != PROJECTILE_LASER) //lasers aren't particularly good at breaking glass - src.health -= 2 - src.healthcheck() - return - if (flag != PROJECTILE_SHOCK) - src.health -= 4 - src.healthcheck() - return else - src.health -= 5 + src.health -= 4 src.healthcheck() return diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 289071c2c49..9d6e4d0af7e 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -419,7 +419,7 @@ if (prob(50)) del(src) -/obj/item/latexballon/bullet_act(severity) +/obj/item/latexballon/bullet_act() burst() /obj/item/latexballon/temperature_expose(datum/gas_mixture/air, temperature, volume) diff --git a/code/game/objects/items/weapons/guns_new.dm b/code/game/objects/items/weapons/guns_new.dm index 63834001f94..116ec7ff45f 100644 --- a/code/game/objects/items/weapons/guns_new.dm +++ b/code/game/objects/items/weapons/guns_new.dm @@ -1,3 +1,5 @@ +/* NOPE NOPE SORRY NO DERPFLAGS + var/const/PROJECTILE_TASER = 1 var/const/PROJECTILE_LASER = 2 var/const/PROJECTILE_BULLET = 3 @@ -11,6 +13,19 @@ var/const/PROJECTILE_BULLETBURST = 10 var/const/PROJECTILE_WEAKBULLETBURST = 11 var/const/PROJECTILE_WEAKERBULLETBURST = 12 +*/ + +#define BRUTE "brute" +#define BURN "burn" +#define TOX "tox" +#define OXY "oxy" +#define CLONE "clone" + +#define ADD "add" +#define SET "set" + + + /////////////////////////////////////////////// ////////////////AMMO SECTION/////////////////// /////////////////////////////////////////////// @@ -26,7 +41,7 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 flags = FPRINT | TABLEPASS | CONDUCT | ONBELT // ONBELT??? var def_zone = "" - damage_type = PROJECTILE_BULLET + //damage_type = PROJECTILE_BULLET mob/firer = null silenced = 0 yo = null @@ -34,51 +49,92 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 current = null turf/original = null + damage = 50 // damage dealt by projectile. This is used for machinery, livestock, anything not under /mob heirarchy + flag = "bullet" // identifier flag (bullet, laser, bio, rad, taser). This is to identify what kind of armor protects against the shot + + + nodamage = 0 // determines if the projectile will skip any damage inflictions + list/mobdamage = list(BRUTE = 50, BURN = 0, TOX = 0, OXY = 0, CLONE = 0) // determines what kind of damage it does to mobs + list/effects = list("stun" = 0, "weak" = 0, "paralysis" = 0, "stutter" = 0, "drowsyness" = 0, "radiation" = 0, "eyeblur" = 0, "emp" = 0) // long list of effects a projectile can inflict on something. !!MUY FLEXIBLE!!~ + list/effectprob = list("stun" = 100, "weak" = 100, "paralysis" = 100, "stutter" = 100, "drowsyness" = 100, "radiation" = 100, "eyeblur" = 100, "emp" = 100) // Probability for an effect to execute + list/effectmod = list("stun" = SET, "weak" = SET, "paralysis" = SET, "stutter" = SET, "drowsyness" = SET, "radiation" = SET, "eyeblur" = SET, "emp" = SET) // determines how the effect modifiers will effect a mob's variable + + bumped = 0 + weakbullet - damage_type = PROJECTILE_WEAKBULLET - - bulletburst - damage_type = PROJECTILE_BULLETBURST - - weakbulletburst - damage_type = PROJECTILE_WEAKBULLETBURST - - weakerbulletburst - damage_type = PROJECTILE_WEAKERBULLETBURST + damage = 15 + mobdamage = list(BRUTE = 15, BURN = 0, TOX = 0, OXY = 0, CLONE = 0) beam name = "laser" - damage_type = PROJECTILE_LASER + //damage_type = PROJECTILE_LASER icon_state = "laser" pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE + damage = 20 + mobdamage = list(BRUTE = 0, BURN = 20, TOX = 0, OXY = 0, CLONE = 0) + flag = "laser" + New() + ..() + effects["eyeblur"] = 5 + effectprob["eyeblur"] = 50 pulse name = "pulse" - damage_type = PROJECTILE_PULSE + //damage_type = PROJECTILE_PULSE icon_state = "u_laser" + damage = 50 + mobdamage = list(BRUTE = 10, BURN = 40, TOX = 0, OXY = 0, CLONE = 0) fireball name = "shock" - damage_type = PROJECTILE_SHOCK + //damage_type = PROJECTILE_SHOCK icon_state = "fireball" pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE + damage = 20 + mobdamage = list(BRUTE = 0, BURN = 20, TOX = 0, OXY = 0, CLONE = 0) + flag = "laser" dart name = "dart" - damage_type = PROJECTILE_DART + //damage_type = PROJECTILE_DART icon_state = "toxin" + flag = "bio" + damage = 0 + mobdamage = list(BRUTE = 0, BURN = 0, TOX = 10, OXY = 0, CLONE = 0) + New() + ..() + effects["weak"] = 5 + effectmod["weak"] = ADD electrode name = "electrode" - damage_type = PROJECTILE_TASER + //damage_type = PROJECTILE_TASER icon_state = "spark" + flag = "taser" + damage = 0 + nodamage = 1 + New() + ..() + effects["stun"] = 10 + effects["weak"] = 10 + effects["stutter"] = 10 + effectprob["weak"] = 25 bolt name = "bolt" - damage_type = PROJECTILE_BOLT + //damage_type = PROJECTILE_BOLT icon_state = "cbbolt" + flag = "rad" + damage = 0 + nodamage = 1 + New() + ..() + effects["radiation"] = 100 + effects["drowsyness"] = 5 + effectmod["radiation"] = ADD + effectmod["drowsyness"] = ADD freeze name = "freeze beam" @@ -97,7 +153,7 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 var/temperature = 800 proc/Heat(atom/A as mob|obj|turf|area) - if(istype(A, /mob)) + if(istype(A, /mob/living/carbon)) var/mob/M = A if(M.bodytemperature < temperature) M.bodytemperature = temperature @@ -138,10 +194,10 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 P.Heat(A) else - A.bullet_act(damage_type, src, def_zone) + A.bullet_act(src, def_zone) if(istype(A,/turf) && !istype(src, /obj/item/projectile/beam)) for(var/obj/O in A) - O.bullet_act(damage_type, src, def_zone) + O.bullet_act(src, def_zone) del(src) return @@ -373,14 +429,22 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 throw_range = 10 m_amt = 1000 force = 24 + var list/loaded = list() max_shells = 7 load_method = 0 //0 = Single shells or quick loader, 1 = magazine + // Shotgun variables + pumped = 1 + maxpump = 1 + load_into_chamber() if(!loaded.len) return 0 + if(pumped >= maxpump && istype(src, /obj/item/weapon/gun/projectile/shotgun)) + return 1 + var/obj/item/ammo_casing/AC = loaded[1] //load next casing. loaded -= AC //Remove casing from loaded list. AC.loc = get_turf(src) //Eject casing onto ground. @@ -482,6 +546,7 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 for(var/i = 1, i <= max_shells, i++) loaded += new /obj/item/ammo_casing/shotgun/beanbag(src) update_icon() + pumped = maxpump combat name = "combat shotgun" @@ -491,11 +556,16 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK max_shells = 8 origin_tech = "combat=3" + maxpump = 2 New() for(var/i = 1, i <= max_shells, i++) loaded += new /obj/item/ammo_casing/shotgun(src) update_icon() + proc/pump(mob/M) + playsound(M, 'shotgunpump.ogg', 60, 1) + pumped = 0 + automatic //Hopefully someone will find a way to make these fire in bursts or something. --Superxpdude name = "Submachine Gun" desc = "A lightweight, fast firing gun. Uses 9mm rounds." @@ -957,10 +1027,10 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 attack_self(mob/living/user as mob) user.machine = src var/temp_text = "" - if(temperature > (T0C + 50)) + if(temperature < (T0C + 50)) temp_text = "[temperature] ([round(temperature+T0C)]°C) ([round(temperature*1.8+459.67)]°F)" else - temp_text = "[temperature] ([round(temperature+T0C)]°C) ([round(temperature*1.8+459.67)]°F)" + temp_text = "[temperature] ([round(temperature+T0C)]°C) ([round(temperature*1.8+459.67)]°F)" var/dat = {"Plasma Gun Configuration:
Current output temperature: [temp_text]
@@ -977,10 +1047,10 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 src.add_fingerprint(usr) if(href_list["temp"]) var/amount = text2num(href_list["temp"]) - if(amount > 0) - src.current_temperature = min(T20C, src.current_temperature+amount) + if(amount < 0) + src.current_temperature = max(T20C, src.current_temperature+amount) else - src.current_temperature = max(800, src.current_temperature+amount) + src.current_temperature = min(800, src.current_temperature+amount) if (istype(src.loc, /mob)) attack_self(src.loc) src.add_fingerprint(usr) @@ -1131,6 +1201,12 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 user << "\red *click* *click*"; return + if(istype(src, /obj/item/weapon/gun/projectile/shotgun)) + var/obj/item/weapon/gun/projectile/shotgun/S = src + if(S.pumped >= S.maxpump) + S.pump() + return + update_icon() playsound(user, fire_sound, 50, 1) @@ -1142,7 +1218,7 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 in_chamber.def_zone = user.get_organ_target() if(targloc == curloc) - user.bullet_act(in_chamber.damage_type) + user.bullet_act(in_chamber) del(in_chamber) else if(istype(src, /obj/item/weapon/gun/energy/freeze)) @@ -1162,3 +1238,7 @@ var/const/PROJECTILE_WEAKERBULLETBURST = 12 in_chamber.process() sleep(1) in_chamber = null + + if(istype(src, /obj/item/weapon/gun/projectile/shotgun)) + var/obj/item/weapon/gun/projectile/shotgun/S = src + S.pumped++ diff --git a/code/game/objects/lamarr.dm b/code/game/objects/lamarr.dm index fdbf720fd57..2d8f8c0c559 100644 --- a/code/game/objects/lamarr.dm +++ b/code/game/objects/lamarr.dm @@ -29,32 +29,16 @@ src.health -= 5 src.healthcheck() -/obj/lamarr/bullet_act(flag) +/obj/lamarr/bullet_act(var/obj/item/projectile/Proj) - if (flag == PROJECTILE_BULLET) + if (Proj.flag == "bullet") src.health -= 10 src.healthcheck() return - if (flag == PROJECTILE_BULLETBURST) - src.health -= 4 - src.healthcheck() - return - if (flag != PROJECTILE_LASER) //lasers aren't particularly good at breaking glass - src.health -= 2 - src.healthcheck() - return else - src.health -= 5 - src.healthcheck() - return - if (flag != PROJECTILE_SHOCK) src.health -= 4 src.healthcheck() return - else - src.health -= 7 - src.healthcheck() - return /obj/lamarr/blob_act() diff --git a/code/game/objects/livestock.dm b/code/game/objects/livestock.dm index 8ccf968abb1..902dd8025a2 100644 --- a/code/game/objects/livestock.dm +++ b/code/game/objects/livestock.dm @@ -138,32 +138,11 @@ return ..() - bullet_act(flag, A as obj) - switch(flag) - if(PROJECTILE_BULLET) - src.health -= 15 - if(PROJECTILE_BULLETBURST) - src.health -= 6 - if(PROJECTILE_TASER) - src.health -= 5 - if(PROJECTILE_DART) - src.health -= 10 - if(PROJECTILE_WEAKBULLET) - src.health -= 8 - if(PROJECTILE_WEAKBULLETBURST) - src.health -= 4 - if(PROJECTILE_WEAKERBULLETBURST) - src.health -= 2 - if(PROJECTILE_LASER) - src.health -= 10 - if(PROJECTILE_SHOCK) - src.health -= 15 - if(PROJECTILE_PULSE) - src.health -= 25 - if(prob(30)) - src.gib() - if(PROJECTILE_BOLT) - src.health -= 5 + bullet_act(var/obj/item/projectile/Proj) + health -= Proj.damage + if(istype(Proj, /obj/item/projectile/beam/pulse)) + if(prob(30)) + gib() if(prob(10)) new /obj/decal/cleanable/blood(src.loc) healthcheck() diff --git a/code/game/objects/secure_closets.dm b/code/game/objects/secure_closets.dm index 442cc7b4735..3ea2b6e6fa0 100644 --- a/code/game/objects/secure_closets.dm +++ b/code/game/objects/secure_closets.dm @@ -136,7 +136,7 @@ return return -/obj/secure_closet/bullet_act(flag) +/obj/secure_closet/bullet_act(var/obj/item/projectile/Proj) /* Just in case someone gives closets health if (flag == PROJECTILE_BULLET) src.health -= 1 diff --git a/code/game/objects/weapons.dm b/code/game/objects/weapons.dm index 96e8b2e0428..15c76629389 100644 --- a/code/game/objects/weapons.dm +++ b/code/game/objects/weapons.dm @@ -1052,8 +1052,8 @@ //PROJECTILE_BOLT = 5 crossbow //PROJECTILE_WEAKBULLET = 6 detective's revolver -/atom/proc/bullet_act(flag) - if(flag == PROJECTILE_PULSE) +/atom/proc/bullet_act(var/obj/item/projectile/Proj) + if(istype(Proj ,/obj/item/projectile/beam/pulse)) src.ex_act(2) return diff --git a/code/game/objects/window.dm b/code/game/objects/window.dm index 2e8b3693128..2dddb1234a1 100644 --- a/code/game/objects/window.dm +++ b/code/game/objects/window.dm @@ -1,5 +1,5 @@ -/obj/window/bullet_act(flag) - if (flag == PROJECTILE_BULLET) +/obj/window/bullet_act(var/obj/item/projectile/Proj) + if(Proj.flag == "bullet") if(!reinf) new /obj/item/weapon/shard( src.loc ) //SN src = null @@ -7,30 +7,13 @@ del(src) else - health -= 35 + health -= Proj.damage if(health <=0) new /obj/item/weapon/shard( src.loc ) new /obj/item/stack/rods( src.loc ) src.density = 0 del(src) - return - if (flag == PROJECTILE_BULLETBURST) - if(!reinf) - new /obj/item/weapon/shard( src.loc ) - //SN src = null - src.density = 0 - - del(src) - else - health -= 13 - if(health <=0) - new /obj/item/weapon/shard( src.loc ) - new /obj/item/stack/rods( src.loc ) - src.density = 0 - del(src) - - return return /obj/window/ex_act(severity) diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index d30502e33a9..c9c51fcdabe 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -184,7 +184,7 @@ if(!istype(T, /turf)) return if (U == T) - usr.bullet_act(PROJECTILE_DART, src, src.get_organ_target()) + usr.bullet_act(src, src.get_organ_target()) return if(!istype(U, /turf)) return diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index cc00367d262..970a786a58f 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -74,19 +74,19 @@ if (client.statpanel == "Status") stat(null, "Plasma Stored: [toxloss]") -/mob/living/carbon/alien/humanoid/bullet_act(flag, A as obj) +/mob/living/carbon/alien/humanoid/bullet_act(var/obj/item/projectile/Proj) var/shielded = 0 - if(prob(50)) + if(prob(80)) for(var/mob/living/carbon/metroid/M in view(1,src)) if(M.Victim == src) - M.bullet_act(flag, A) + M.bullet_act(Proj) return for(var/obj/item/device/shield/S in src) if (S.active) - if (flag == "bullet") + if (Proj.flag == "bullet") return shielded = 1 S.active = 0 @@ -96,8 +96,8 @@ shielded = 1 S.active = 0 S.icon_state = "shield0" - if ((shielded && flag != "bullet")) - if (!flag) + if ((shielded && Proj.flag != "bullet")) + if (Proj.flag) src << "\blue Your shield was disturbed by a laser!" if(paralysis <= 12) paralysis = 12 updatehealth() @@ -105,83 +105,78 @@ var/mob/safe = null if (istype(l_hand, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = l_hand - if ((G.state == 3 && get_dir(src, A) == dir)) + if ((G.state == 3 && get_dir(src, Proj) == dir)) safe = G.affecting if (istype(r_hand, /obj/item/weapon/grab)) var/obj/item/weapon.grab/G = r_hand - if ((G.state == 3 && get_dir(src, A) == dir)) + if ((G.state == 3 && get_dir(src, Proj) == dir)) safe = G.affecting if (safe) - return safe.bullet_act(flag, A) - switch(flag)//Did these people not know that switch is a function that exists? I swear, half of the code ignores switch completely. - if(PROJECTILE_BULLET) - var/d = 51 - if (stat != 2) - bruteloss += d - updatehealth() - if (prob(50)&&weakened <= 5) - weakened = 5 - if(PROJECTILE_WEAKBULLET) - var/d = 14 - if (stat != 2) - bruteloss += d - updatehealth() - if (prob(50)&&weakened <= 2) - weakened = 2 - if(PROJECTILE_WEAKBULLETBURST) - var/d = 7 - if (stat != 2) - bruteloss += d - updatehealth() - if (prob(50)&&weakened <= 2) - weakened = 2 - if(PROJECTILE_BULLETBURST) - var/d = 18 - if (stat != 2) - bruteloss += d - updatehealth() - if (prob(50)&&weakened <= 2) - weakened = 2 - if(PROJECTILE_TASER) - if (prob(75) && stunned <= 10) - stunned = 10 - else - weakened = 10 - if(PROJECTILE_DART)//Nothing is supposed to happen, just making sure it's listed. + return safe.bullet_act(Proj) - if(PROJECTILE_LASER) - var/d = 20 - // if (!eye_blurry) eye_blurry = 4 //This stuff makes no sense but lasers need a buff./ It really doesn't make any sense. /N - if (prob(25)) stunned++ - if (stat != 2) - bruteloss += d - updatehealth() - if (prob(25)) - stunned = 1 - if(PROJECTILE_SHOCK) - var/d = 20 - if (!eye_blurry) eye_blurry = 4 //This stuff makes no sense but lasers need a buff./ It really doesn't make any sense. /N - if (prob(25)) stunned++ - if (stat != 2) - bruteloss += d - updatehealth() - if (prob(25)) - stunned = 10 - else - weakened = 10 - if(PROJECTILE_PULSE) - var/d = 40 + for(var/i = 1, i<= Proj.mobdamage.len, i++) - if (stat != 2) - bruteloss += d + switch(i) + if(1) + var/d = Proj.mobdamage[BRUTE] + if(!Proj.nodamage) bruteloss += d updatehealth() - if (prob(50)) - stunned = min(stunned, 5) - if(PROJECTILE_BOLT) - toxloss += 3 - radiation += 100 - updatehealth() - drowsyness += 5 + if(2) + var/d = Proj.mobdamage[BURN] + if(!Proj.nodamage) fireloss += d + updatehealth() + if(3) + var/d = Proj.mobdamage[TOX] + if(!Proj.nodamage) toxloss += d + updatehealth() + if(4) + var/d = Proj.mobdamage[OXY] + if(!Proj.nodamage) oxyloss += d + updatehealth() + if(5) + var/d = Proj.mobdamage[CLONE] + if(!Proj.nodamage) cloneloss += d + updatehealth() + + if(Proj.effects["stun"] && prob(Proj.effectprob["stun"])) + if(Proj.effectmod["stun"] == SET) + stunned = Proj.effects["stun"] + else + stunned += Proj.effects["stun"] + + + if(Proj.effects["weak"] && prob(Proj.effectprob["weak"])) + if(Proj.effectmod["weak"] == SET) + weakened = Proj.effects["weak"] + else + weakened += Proj.effects["weak"] + + if(Proj.effects["paralysis"] && prob(Proj.effectprob["paralysis"])) + if(Proj.effectmod["paralysis"] == SET) + paralysis = Proj.effects["paralysis"] + else + paralysis += Proj.effects["paralysis"] + + if(Proj.effects["stutter"] && prob(Proj.effectprob["stutter"])) + if(Proj.effectmod["stutter"] == SET) + stuttering = Proj.effects["stutter"] + else + stuttering += Proj.effects["stutter"] + + if(Proj.effects["drowsyness"] && prob(Proj.effectprob["drowsyness"])) + if(Proj.effectmod["drowsyness"] == SET) + drowsyness = Proj.effects["drowsyness"] + else + drowsyness += Proj.effects["drowsyness"] + + // Aliums not effected by radiation damage + + if(Proj.effects["eyeblur"] && prob(Proj.effectprob["eyeblur"])) + if(Proj.effectmod["eyeblur"] == SET) + eye_blurry = Proj.effects["eyeblur"] + else + eye_blurry += Proj.effects["eyeblur"] + return /mob/living/carbon/alien/humanoid/emp_act(severity) diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 9e026d7cc07..5a6e53f480b 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -67,12 +67,12 @@ //This is okay I guess unless we add alien shields or something. Should be cleaned up a bit. -/mob/living/carbon/alien/larva/bullet_act(flag, A as obj) +/mob/living/carbon/alien/larva/bullet_act(var/obj/item/projectile/Proj) - if(prob(50)) + if(prob(80)) for(var/mob/living/carbon/metroid/M in view(1,src)) if(M.Victim == src) - M.bullet_act(flag, A) + M.bullet_act(Proj) return @@ -80,105 +80,79 @@ var/mob/safe = null if (istype(l_hand, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = l_hand - if ((G.state == 3 && get_dir(src, A) == dir)) + if ((G.state == 3 && get_dir(src, Proj) == dir)) safe = G.affecting if (istype(r_hand, /obj/item/weapon/grab)) var/obj/item/weapon.grab/G = r_hand - if ((G.state == 3 && get_dir(src, A) == dir)) + if ((G.state == 3 && get_dir(src, Proj) == dir)) safe = G.affecting if (safe) - return safe.bullet_act(flag, A) - switch(flag) - if(PROJECTILE_BULLET) - var/d = 51 + return safe.bullet_act(Proj) - if (stat != 2) - bruteloss += d + for(var/i = 1, i<= Proj.mobdamage.len, i++) + + switch(i) + if(1) + var/d = Proj.mobdamage[BRUTE] + if(!Proj.nodamage) bruteloss += d updatehealth() - if (prob(50)) - if(weakened <= 5) weakened = 5 - return - if(PROJECTILE_WEAKBULLET) - var/d = 14 - - if (stat != 2) - bruteloss += d - + if(2) + var/d = Proj.mobdamage[BURN] + if(!Proj.nodamage) fireloss += d updatehealth() - if (prob(50)) - if(weakened <= 2) weakened = 2 - return - if(PROJECTILE_WEAKBULLETBURST) - var/d = 7 - - if (stat != 2) - bruteloss += d - + if(3) + var/d = Proj.mobdamage[TOX] + if(!Proj.nodamage) toxloss += d updatehealth() - if (prob(50)) - if(weakened <= 2) weakened = 2 - return - if(PROJECTILE_BULLETBURST) - var/d = 18 - - if (stat != 2) - bruteloss += d - + if(4) + var/d = Proj.mobdamage[OXY] + if(!Proj.nodamage) oxyloss += d updatehealth() - if (prob(50)) - if(weakened <= 2) weakened = 2 - return - if(PROJECTILE_TASER) - if (prob(75) && stunned <= 10) - stunned = 10 - else - weakened = 10 - if (stuttering < 10) - stuttering = 10 - if(PROJECTILE_DART) - return - if(PROJECTILE_LASER) - var/d = 20 - - // if (!eye_blurry) eye_blurry = 4 //This stuff makes no sense but lasers need a buff./ It really doesn't make any sense. /N - if (prob(25)) stunned++ - - if (stat != 2) - bruteloss += d - + if(5) + var/d = Proj.mobdamage[CLONE] + if(!Proj.nodamage) cloneloss += d updatehealth() - if (prob(25)) - stunned = 1 - if(PROJECTILE_SHOCK) - var/d = 20 - if (!eye_blurry) eye_blurry = 4 //This stuff makes no sense but lasers need a buff./ It really doesn't make any sense. /N - if (prob(25)) stunned++ + if(Proj.effects["stun"] && prob(Proj.effectprob["stun"])) + if(Proj.effectmod["stun"] == SET) + stunned = Proj.effects["stun"] + else + stunned += Proj.effects["stun"] - if (stat != 2) - bruteloss += d - updatehealth() - if (prob(25)) - stunned = 1 - else - weakened = 10 - if(PROJECTILE_PULSE) - var/d = 40 + if(Proj.effects["weak"] && prob(Proj.effectprob["weak"])) + if(Proj.effectmod["weak"] == SET) + weakened = Proj.effects["weak"] + else + weakened += Proj.effects["weak"] - if (stat != 2) - bruteloss += d + if(Proj.effects["paralysis"] && prob(Proj.effectprob["paralysis"])) + if(Proj.effectmod["paralysis"] == SET) + paralysis = Proj.effects["paralysis"] + else + paralysis += Proj.effects["paralysis"] + + if(Proj.effects["stutter"] && prob(Proj.effectprob["stutter"])) + if(Proj.effectmod["stutter"] == SET) + stuttering = Proj.effects["stutter"] + else + stuttering += Proj.effects["stutter"] + + if(Proj.effects["drowsyness"] && prob(Proj.effectprob["drowsyness"])) + if(Proj.effectmod["drowsyness"] == SET) + drowsyness = Proj.effects["drowsyness"] + else + drowsyness += Proj.effects["drowsyness"] + + // Aliums not effected by radiation damage + + if(Proj.effects["eyeblur"] && prob(Proj.effectprob["eyeblur"])) + if(Proj.effectmod["eyeblur"] == SET) + eye_blurry = Proj.effects["eyeblur"] + else + eye_blurry += Proj.effects["eyeblur"] - updatehealth() - if (prob(50)) - stunned = min(stunned, 5) - if(PROJECTILE_BOLT) - toxloss += 3 - radiation += 100 - updatehealth() - stuttering += 5 - drowsyness += 5 return /mob/living/carbon/alien/larva/emp_act(severity) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 16b9bc41067..b69c16a5b06 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -192,21 +192,31 @@ if (istype(wear_suit, /obj/item/clothing/suit/space/space_ninja)&&wear_suit:s_initialized) stat("Energy Charge", round(wear_suit:cell:charge/100)) -/mob/living/carbon/human/bullet_act(flag, A as obj, var/datum/organ/external/def_zone) +/mob/living/carbon/human/bullet_act(A as obj, var/datum/organ/external/def_zone) var/shielded = 0 - var/list/armor //Preparing the var for grabbing the armor information, can't grab the values yet because we don't know what kind of bullet was used. --NEO - if(prob(50)) + var/obj/item/projectile/P = A + if(prob(80)) for(var/mob/living/carbon/metroid/M in view(1,src)) if(M.Victim == src) - M.bullet_act(flag, A) // the bullet hits them, not src! + M.bullet_act(A) // the bullet hits them, not src! return + if (istype(l_hand, /obj/item/weapon/shield/riot)) + if (prob(50 + round(P.damage / 3))) // the more damage a projectile does, the more likely to block it + show_message("\red Your shield blocks the blow!", 4) + return + + if (istype(r_hand, /obj/item/weapon/shield/riot)) + if (prob(50 + round(P.damage / 3))) + show_message("\red Your shield blocks the blow!", 4) + return + for(var/obj/item/device/shield/S in src) if (S.active) - if (flag == "bullet") + if (P.flag == "bullet") return shielded = 1 S.active = 0 @@ -216,8 +226,8 @@ shielded = 1 S.active = 0 S.icon_state = "shield0" - if ((shielded && flag != "bullet")) - if (!flag) + if ((shielded && P.flag != "bullet")) + if (P.flag) src << "\blue Your shield was disturbed by a laser!" if(paralysis <= 120) paralysis = 120 updatehealth() @@ -243,398 +253,216 @@ if ((G.state == 3 && get_dir(src, A) == dir)) safe = G.affecting if (safe) - return safe.bullet_act(flag, A) + return safe.bullet_act(A) + var/absorb + var/soften - switch(flag) - if(PROJECTILE_BULLET) - armor = getarmor(affecting, "bullet") - var/d = 51 - if (prob(armor["armor"])) - show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) - return - else - if (prob(armor["armor"]/2)) - show_message("\red Your [armor["clothes"]] only softens the hit!", 4) - if (prob(20)) - d = d / 2 - d = d / 4 - /* - else - if (istype(wear_suit, /obj/item/clothing/suit/swat_suit)) - if (prob(90)) - show_message("\red Your armor absorbs the blow!", 4) - return + for(var/i = 1, i<= P.mobdamage.len, i++) + + switch(i) + if(1) + var/d = P.mobdamage[BRUTE] + if(d) + var/list/armor = getarmor(affecting, P.flag) + if (prob(armor["armor"])) + absorb = 1 else - if (prob(90)) - show_message("\red Your armor only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 5*/ - if (istype(r_hand, /obj/item/weapon/shield/riot)) - if (prob(90)) - show_message("\red Your shield absorbs the blow!", 4) - return - else - if (prob(40)) - show_message("\red Your shield only softens the blow!", 4) - if (prob(60)) + if (prob(armor["armor"])/2) + soften = 1 d = d / 2 - d = d / 5 - else - if (istype(l_hand, /obj/item/weapon/shield/riot)) - if (prob(90)) - show_message("\red Your shield absorbs the blow!", 4) - return - else - if (prob(40)) - show_message("\red Your shield only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 5 - if (stat != 2) - affecting.take_damage(d, 0) - UpdateDamageIcon() - updatehealth() - if (prob(50)) - if(weakened <= 5) weakened = 5 - return - if(PROJECTILE_BULLETBURST) - armor = getarmor(affecting, "bullet") - var/d = 18 - if (prob(armor["armor"])) - show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) - return - else - if (prob(armor["armor"]/2)) - show_message("\red Your [armor["clothes"]] only softens the hit!", 4) - if (prob(20)) - d = d / 2 - d = d / 4 - /* - else - if (istype(wear_suit, /obj/item/clothing/suit/swat_suit)) - if (prob(90)) - show_message("\red Your armor absorbs the blow!", 4) - return - else - if (prob(90)) - show_message("\red Your armor only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 5*/ - if (istype(r_hand, /obj/item/weapon/shield/riot)) - if (prob(90)) - show_message("\red Your shield absorbs the blow!", 4) - return - else - if (prob(40)) - show_message("\red Your shield only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 5 - else - if (istype(l_hand, /obj/item/weapon/shield/riot)) - if (prob(90)) - show_message("\red Your shield absorbs the blow!", 4) - return - else - if (prob(40)) - show_message("\red Your shield only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 5 - if (stat != 2) - affecting.take_damage(d, 0) - UpdateDamageIcon() - updatehealth() - if (prob(50)) - if(weakened <= 2) weakened = 2 - return - if(PROJECTILE_TASER) - armor = getarmor(affecting, "taser") - if (prob(armor["armor"])) - show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) - return - /*else - if (istype(wear_suit, /obj/item/clothing/suit/swat_suit)) - if (prob(70)) - show_message("\red Your armor absorbs the hit!", 4) - return*/ - if (prob(75) && stunned <= 10) - stunned = 10 - else - weakened = 10 - if (stuttering < 10) - stuttering = 10 - if(PROJECTILE_DART) - armor = getarmor(affecting, "bio") - if (prob(armor["armor"])) - show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) - return - if (istype(l_hand, /obj/item/weapon/shield/riot)||istype(r_hand, /obj/item/weapon/shield/riot)) - if (prob(50)) - show_message("\red Your shield absorbs the hit!", 4) - else - weakened += 5 - toxloss += 10 - if(PROJECTILE_LASER) - armor = getarmor(affecting, "laser") - var/d = 20 - if (prob(armor["armor"])) - show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) - return - else - if (prob(armor["armor"])/2) - show_message("\red Your [armor["clothes"]] only softens the hit!", 4) - if (prob(20)) - d = d / 2 - d = d / 2 - /*else - if (istype(wear_suit, /obj/item/clothing/suit/swat_suit)) - if (prob(70)) - show_message("\red Your armor absorbs the blow!", 4) - return - else - if (prob(90)) - show_message("\red Your armor only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 2*/ - if (!eye_blurry) eye_blurry = 4 //This stuff makes no sense but lasers need a buff. - if (prob(25)) stunned++ - if (stat != 2) - affecting.take_damage(0, d) - UpdateDamageIcon() - updatehealth() - if (prob(25)) - stunned = 1 - if(PROJECTILE_SHOCK) - armor = getarmor(affecting, "laser") - var/d = 20 - if (prob(armor["armor"])) - show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) - return - else - if (prob(armor["armor"])/2) - show_message("\red Your [armor["clothes"]] only softens the hit!", 4) - if (prob(20)) - d = d / 2 - d = d / 2 - /*else - if (istype(wear_suit, /obj/item/clothing/suit/swat_suit)) - if (prob(70)) - show_message("\red Your armor absorbs the blow!", 4) - return + if(!P.nodamage) affecting.take_damage(d, 0) + UpdateDamageIcon() + updatehealth() + if(2) + var/d = P.mobdamage[BURN] + if(d) + var/list/armor = getarmor(affecting, P.flag) + if (prob(armor["armor"])) + absorb = 1 else - if (prob(90)) - show_message("\red Your armor only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 2*/ + if (prob(armor["armor"])/2) + soften = 1 + d = d / 2 - if (!eye_blurry) eye_blurry = 4 //This stuff makes no sense but lasers need a buff. - if (prob(25)) stunned++ - if (stat != 2) - affecting.take_damage(0, d) - UpdateDamageIcon() - updatehealth() - if (prob(25)) - stunned = 10 - else - weakened = 10 - if(PROJECTILE_PULSE) - armor = getarmor(affecting, "laser") - var/d = 40 - if (prob(armor["armor"]/2)) - show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) - return - else - if (prob(armor["armor"])/2) - show_message("\red Your [armor["clothes"]] only softens the hit!", 4) - if (prob(20)) - d = d / 2 - d = d / 2 - /*else - if (istype(wear_suit, /obj/item/clothing/suit/swat_suit)) - if (prob(50)) - show_message("\red Your armor absorbs the blow!", 4) - return + if(!P.nodamage) affecting.take_damage(0, d) + UpdateDamageIcon() + updatehealth() + if(3) + var/d = P.mobdamage[TOX] + if(d) + var/list/armor = getarmor(affecting, P.flag) + if (prob(armor["armor"])) + absorb = 1 else - if (prob(50)) - show_message("\red Your armor only softens the blow!", 4) - if (prob(50)) - d = d / 2 - d = d / 2*/ - if (stat != 2) - affecting.take_damage(0, d) - UpdateDamageIcon() - updatehealth() - if (prob(50)) - stunned = min(stunned, 5) - if(PROJECTILE_BOLT) - armor = getarmor(affecting, "rad") - if (prob(getarmor(affecting, "bio"))) - show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) - return - toxloss += 3 - radiation += 100 - updatehealth() - stuttering += 5 - drowsyness += 5 - if(PROJECTILE_WEAKBULLET) - armor = getarmor(affecting, "bullet") - var/d = 14 - if (prob(armor["armor"])) - show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) - return - else - if (prob(armor["armor"]/2)) - show_message("\red Your [armor["clothes"]] only softens the hit!", 4) - if (prob(20)) - d = d / 2 - d = d / 4 - /*else - if (istype(wear_suit, /obj/item/clothing/suit/swat_suit)) - if (prob(90)) - show_message("\red Your armor absorbs the blow!", 4) - return - else - if (prob(90)) - show_message("\red Your armor only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 5*/ - if (istype(r_hand, /obj/item/weapon/shield/riot)) - if (prob(90)) - show_message("\red Your shield absorbs the blow!", 4) - return - else - if (prob(40)) - show_message("\red Your shield only softens the blow!", 4) - if (prob(60)) + if (prob(armor["armor"])/2) + soften = 1 d = d / 2 - d = d / 5 - else - if (istype(l_hand, /obj/item/weapon/shield/riot)) - if (prob(90)) - show_message("\red Your shield absorbs the blow!", 4) - return + + + if(!P.nodamage) toxloss += d + UpdateDamageIcon() + updatehealth() + if(4) + var/d = P.mobdamage[OXY] + if(d) + var/list/armor = getarmor(affecting, P.flag) + if (prob(armor["armor"])) + absorb = 1 else - if (prob(40)) - show_message("\red Your shield only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 5 - if (stat != 2) - affecting.take_damage(d, 0) - UpdateDamageIcon() - updatehealth() - if(weakened <= 5) weakened = 5 - return - if(PROJECTILE_WEAKBULLETBURST) - armor = getarmor(affecting, "bullet") - var/d = 7 - if (prob(armor["armor"])) - show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) - return - else - if (prob(armor["armor"]/2)) - show_message("\red Your [armor["clothes"]] only softens the hit!", 4) - if (prob(20)) - d = d / 2 - d = d / 4 - /*else - if (istype(wear_suit, /obj/item/clothing/suit/swat_suit)) - if (prob(90)) - show_message("\red Your armor absorbs the blow!", 4) - return - else - if (prob(90)) - show_message("\red Your armor only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 5*/ - if (istype(r_hand, /obj/item/weapon/shield/riot)) - if (prob(90)) - show_message("\red Your shield absorbs the blow!", 4) - return - else - if (prob(40)) - show_message("\red Your shield only softens the blow!", 4) - if (prob(60)) + if (prob(armor["armor"])/2) + soften = 1 d = d / 2 - d = d / 5 - else - if (istype(l_hand, /obj/item/weapon/shield/riot)) - if (prob(90)) - show_message("\red Your shield absorbs the blow!", 4) - return + + + if(!P.nodamage) oxyloss += d + UpdateDamageIcon() + updatehealth() + if(5) + var/d = P.mobdamage[CLONE] + if(d) + var/list/armor = getarmor(affecting, P.flag) + if (prob(armor["armor"])) + absorb = 1 else - if (prob(40)) - show_message("\red Your shield only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 5 - if (stat != 2) - affecting.take_damage(d, 0) - UpdateDamageIcon() - updatehealth() - if(weakened <= 2) weakened = 2 - return - if(PROJECTILE_WEAKERBULLETBURST) - armor = getarmor(affecting, "bullet") - var/d = 4 - if (prob(armor["armor"])) - show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) - return - else - if (prob(armor["armor"]/2)) - show_message("\red Your [armor["clothes"]] only softens the hit!", 4) - if (prob(20)) - d = d / 2 - d = d / 4 - /*else - if (istype(wear_suit, /obj/item/clothing/suit/swat_suit)) - if (prob(90)) - show_message("\red Your armor absorbs the blow!", 4) - return - else - if (prob(90)) - show_message("\red Your armor only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 5*/ - if (istype(r_hand, /obj/item/weapon/shield/riot)) - if (prob(90)) - show_message("\red Your shield absorbs the blow!", 4) - return - else - if (prob(40)) - show_message("\red Your shield only softens the blow!", 4) - if (prob(60)) + if (prob(armor["armor"])/2) + soften = 1 d = d / 2 - d = d / 5 + + + if(!nodamage) cloneloss += d + UpdateDamageIcon() + updatehealth() + + + + + /////////////////// All the unique projectile stuff goes here /////////////////// + + if(absorb) + show_message("\red Your armor absorbs the blow!", 4) + return // a projectile can be deflected/absorbed given the right amount of protection + if(soften) + show_message("\red Your armor only softens the blow!", 4) + if(prob(15)) return + + var/nostutter = 0 + + if(P.effects["stun"] && prob(P.effectprob["stun"])) + var/list/armor = getarmor(affecting, "taser") + if (!prob(armor["armor"])) + if(P.effectmod["stun"] == SET) + stunned = P.effects["stun"] else - if (istype(l_hand, /obj/item/weapon/shield/riot)) - if (prob(90)) - show_message("\red Your shield absorbs the blow!", 4) - return - else - if (prob(40)) - show_message("\red Your shield only softens the blow!", 4) - if (prob(60)) - d = d / 2 - d = d / 5 - if (stat != 2) - affecting.take_damage(d, 0) - UpdateDamageIcon() - updatehealth() - if(weakened <= 2) weakened = 2 + stunned += P.effects["stun"] + else + nostutter = 1 + + + if(P.effects["weak"] && prob(P.effectprob["weak"])) + if(P.effectmod["weak"] == SET) + weakened = P.effects["weak"] + else + weakened += P.effects["weak"] + + if(P.effects["paralysis"] && prob(P.effectprob["paralysis"])) + if(P.effectmod["paralysis"] == SET) + paralysis = P.effects["paralysis"] + else + paralysis += P.effects["paralysis"] + + if(P.effects["stutter"] && prob(P.effectprob["stutter"]) && !nostutter) + if(P.effectmod["stutter"] == SET) + stuttering = P.effects["stutter"] + else + stuttering += P.effects["stutter"] + + if(P.effects["drowsyness"] && prob(P.effectprob["drowsyness"])) + if(P.effectmod["drowsyness"] == SET) + drowsyness = P.effects["drowsyness"] + else + drowsyness += P.effects["drowsyness"] + + if(P.effects["radiation"] && prob(P.effectprob["radiation"])) + var/list/armor = getarmor(affecting, "rad") + if (!prob(armor["armor"])) + if(P.effectmod["radiation"] == SET) + radiation = P.effects["radiation"] + else + radiation += P.effects["radiation"] + + if(P.effects["eyeblur"] && prob(P.effectprob["eyeblur"])) + if(P.effectmod["eyeblur"] == SET) + eye_blurry = P.effects["eyeblur"] + else + eye_blurry += P.effects["eyeblur"] + + + + /* + // Bullet shots + if(P.flag == "bullet") + if (prob(50) && stat != 2) + if(weakened <= 5) weakened = 5 + + // Taser shots + if(P.flag == "taser" && d == P.damage) + armor = getarmor(affecting, "taser") + if (prob(armor["armor"])) + show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) return + + if (prob(75) && stunned <= 10) + stunned = 10 + else + weakened = 10 + if (stuttering < 10) + stuttering = 10 + + // Laser shots + if(P.flag == "laser") + if (!eye_blurry && prob(50)) eye_blurry = 4 + if (prob(25)) stunned++ + + // Shock shots + if(istype(P, /obj/item/projectile/fireball)) + if (!eye_blurry && prob(50)) eye_blurry = 4 + if (prob(25)) + stunned = 10 + else + weakened = 10 + + // Dart shots + if(istype(P, /obj/item/projectile/dart) && d == P.damage) + armor = getarmor(affecting, "bio") + if (prob(armor["armor"])) + show_message("\red Your [armor["clothes"]] absorbs the hit!", 4) + return + if (istype(l_hand, /obj/item/weapon/shield/riot)||istype(r_hand, /obj/item/weapon/shield/riot)) + if (prob(50)) + show_message("\red Your shield absorbs the hit!", 4) + else + weakened += 5 + toxloss += 10 + + // Pulse shots + if(istype(P, /obj/item/projectile/beam/pulse)) + if (prob(50)) + stunned = min(stunned, 5) + + // Bolt shots + if(istype(P, /obj/item/projectile/bolt) && d == P.damage) + toxloss += 3 + radiation += 100 + updatehealth() + stuttering += 5 + drowsyness += 5 + + */ + return /mob/living/carbon/human/emp_act(severity) @@ -1075,7 +903,7 @@ if (emptyHand) l_store.DblClick() return - if ((!( istype(W, /obj/item) ) || W.w_class > 2 || !( w_uniform ))) + if ((!( istype(W, /obj/item) ) || W.w_class >= 2 || !( w_uniform ))) return u_equip(W) l_store = W @@ -1084,7 +912,7 @@ if (emptyHand) r_store.DblClick() return - if ((!( istype(W, /obj/item) ) || W.w_class > 2 || !( w_uniform ))) + if ((!( istype(W, /obj/item) ) || W.w_class >= 2 || !( w_uniform ))) return u_equip(W) r_store = W diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index dbe332cf89e..5439efb0ab5 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -74,6 +74,9 @@ if(attacked <= 0) Target = null + if(Victim && !Target) + Victim = null + if(Victim) return // if it's eating someone already, continue eating! @@ -171,8 +174,13 @@ if(!Target) - if(prob(33) && canmove && isturf(loc)) - step(src, pick(cardinal)) + if(hungry || starving) + if(prob(50) && canmove && isturf(loc)) + step(src, pick(cardinal)) + + else + if(prob(33) && canmove && isturf(loc)) + step(src, pick(cardinal)) else @@ -200,10 +208,11 @@ if(Victim) // can't eat AND have this little process at the same time break - if(attacked <= 0) + if(attacked <= 0 || !Target) break + if(Target.health <= -70 || Target.stat == 2) Target = null AIproc = 0 diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index 9995cf894c4..8a325817f3a 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -137,97 +137,56 @@ stat(null,"Power Level: [powerlevel]") -/mob/living/carbon/metroid/bullet_act(flag, A as obj) - if(A) +/mob/living/carbon/metroid/bullet_act(var/obj/item/projectile/Proj) + if(Proj) if (locate(/obj/item/weapon/grab, src)) var/mob/safe = null if (istype(l_hand, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = l_hand - if ((G.state == 3 && get_dir(src, A) == dir)) + if ((G.state == 3 && get_dir(src, Proj) == dir)) safe = G.affecting if (istype(r_hand, /obj/item/weapon/grab)) var/obj/item/weapon.grab/G = r_hand - if ((G.state == 3 && get_dir(src, A) == dir)) + if ((G.state == 3 && get_dir(src, Proj) == dir)) safe = G.affecting if (safe) - return safe.bullet_act(flag, A) + return safe.bullet_act(Proj) - switch(flag) - if(PROJECTILE_BULLET) - var/d = 1 - - attacked += 10 - if (stat != 2) - bruteloss += d + attacked += 10 + for(var/i = 1, i<= Proj.mobdamage.len, i++) + switch(i) + if(1) + var/d = Proj.mobdamage[BRUTE] + if(!Proj.nodamage) bruteloss += d updatehealth() - return - if(PROJECTILE_BULLETBURST) - var/d = 1 - - attacked += 10 - if (stat != 2) - bruteloss += d - + if(2) + var/d = Proj.mobdamage[BURN] + if(!Proj.nodamage) fireloss += d updatehealth() - return - if(PROJECTILE_WEAKBULLETBURST) - var/d = 1 - - attacked += 10 - if (stat != 2) - bruteloss += d - + if(3) + var/d = Proj.mobdamage[TOX] + if(!Proj.nodamage) toxloss += d updatehealth() - return - if(PROJECTILE_WEAKERBULLETBURST) - var/d = 0.5 - - attacked += 10 - if (stat != 2) - bruteloss += d - + if(4) + var/d = Proj.mobdamage[OXY] + if(!Proj.nodamage) oxyloss += d updatehealth() - return - if(PROJECTILE_TASER) - if (prob(70)) - powerlevel++ - if(powerlevel > 10) powerlevel = 10 - - if(PROJECTILE_LASER) - var/d = 30 - - attacked += 10 - // if (!eye_blurry) eye_blurry = 4 //This stuff makes no sense but lasers need a buff./ It really doesn't make any sense. /N - - if (stat != 2) - bruteloss += d - - updatehealth() - if(PROJECTILE_SHOCK) - var/d = 30 - - attacked += 10 - if (!eye_blurry) eye_blurry = 4 //This stuff makes no sense but lasers need a buff./ It really doesn't make any sense. /N - - if (stat != 2) - bruteloss += d - + if(5) + var/d = Proj.mobdamage[CLONE] + if(!Proj.nodamage) cloneloss += d updatehealth() - if (prob(70)) - powerlevel++ - if(powerlevel > 10) powerlevel = 10 - if(PROJECTILE_PULSE) - var/d = 100 - attacked += 10 - if (stat != 2) - bruteloss += d - - updatehealth() - return + if(Proj.flag == "taser" && prob(35)) + // Metroids have a small chance of "absorbing" taser shots. Deal /w it + powerlevel++ + src << "I have absorbed the electrode projectile..." + // K + // ~~~~ N + // Metroids aren't effected by extra status effects. DO NOT NERF THIS PLZ THNX - LOVE, DOOHL 3===========D ~~~~ HONK + // ~~~~ H /mob/living/carbon/metroid/emp_act(severity) powerlevel = 0 // oh no, the power! diff --git a/code/modules/mob/living/carbon/metroid/powers.dm b/code/modules/mob/living/carbon/metroid/powers.dm index ed8b49f8d0a..ec4659faa25 100644 --- a/code/modules/mob/living/carbon/metroid/powers.dm +++ b/code/modules/mob/living/carbon/metroid/powers.dm @@ -5,6 +5,10 @@ Feedstop() return + if(stat) + src << "I must be conscious to do this..." + return + var/list/choices = list() for(var/mob/living/carbon/C in view(1,src)) if(C!=src && !istype(C,/mob/living/carbon/metroid)) @@ -67,19 +71,19 @@ Victim.toxloss += rand(2,4) if(toxloss > 0) - toxloss -= 5 + toxloss = max(0, toxloss-10) if(oxyloss > 0) - oxyloss -= 5 + oxyloss = max(0, oxyloss-10) if(bruteloss > 0) - bruteloss -= 5 + bruteloss = max(0, bruteloss-10) if(fireloss > 0) - fireloss -= 5 + fireloss = max(0, fireloss-10) if(cloneloss > 0) - cloneloss -= 5 + cloneloss = max(0, cloneloss-10) if(Victim) for(var/mob/living/carbon/metroid/Metroid in view(1,M)) @@ -160,6 +164,10 @@ /mob/living/carbon/metroid/verb/Evolve() set category = "Metroid" set desc = "This will let you evolve from baby to adult metroid." + + if(stat) + src << "I must be conscious to do this..." + return if(!istype(src, /mob/living/carbon/metroid/adult)) if(amount_grown >= 10) var/mob/living/carbon/metroid/adult/new_metroid = new /mob/living/carbon/metroid/adult (loc) @@ -179,6 +187,11 @@ /mob/living/carbon/metroid/verb/Reproduce() set category = "Metroid" set desc = "This will make you split into a random number of Metroids (usually 2). NOTE: this will KILL you, but you will be transferred into one of the babies." + + if(stat) + src << "I must be conscious to do this..." + return + if(istype(src, /mob/living/carbon/metroid/adult)) if(amount_grown >= 10) switch(input("Are you absolutely sure you want to reproduce? Your current body will cease to be, but your consciousness will be transferred into a produced metroid.") in list("Yes","No")) diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 4346abc8f9e..e2626cd8058 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -110,82 +110,80 @@ health = 100 - oxyloss - toxloss - fireloss - bruteloss return -/mob/living/carbon/monkey/bullet_act(flag) +/mob/living/carbon/monkey/bullet_act(var/obj/item/projectile/Proj) - if(prob(50)) + if(prob(80)) for(var/mob/living/carbon/metroid/M in view(1,src)) if(M.Victim == src) - M.bullet_act(flag) + M.bullet_act(Proj) return + for(var/i = 1, i<= Proj.mobdamage.len, i++) - if (flag == PROJECTILE_BULLET) - if (stat != 2) - take_organ_damage(60, 0) - updatehealth() - if (prob(50)) - if(weakened <= 5) weakened = 5 - else if (flag == PROJECTILE_BULLETBURST) - if (stat != 2) - take_organ_damage(21, 0) - updatehealth() - if (prob(50)) - if(weakened <= 2) weakened = 2 - else if (flag == PROJECTILE_TASER) - if (prob(75) && stunned <= 10) - stunned = 10 + switch(i) + if(1) + var/d = Proj.mobdamage[BRUTE] + if(!Proj.nodamage) src.take_organ_damage(d) + updatehealth() + if(2) + var/d = Proj.mobdamage[BURN] + if(!Proj.nodamage) src.take_organ_damage(0, d) + updatehealth() + if(3) + var/d = Proj.mobdamage[TOX] + if(!Proj.nodamage) toxloss += d + updatehealth() + if(4) + var/d = Proj.mobdamage[OXY] + if(!Proj.nodamage) oxyloss += d + updatehealth() + if(5) + var/d = Proj.mobdamage[CLONE] + if(!Proj.nodamage) cloneloss += d + updatehealth() + + if(Proj.effects["stun"] && prob(Proj.effectprob["stun"])) + if(Proj.effectmod["stun"] == SET) + stunned = Proj.effects["stun"] else - weakened = 10 - if (stuttering < 10) - stuttering = 10 - else if (flag == PROJECTILE_DART) - weakened += 5 - toxloss += 10 - else if(flag == PROJECTILE_LASER) - if (!eye_blurry) eye_blurry = 4 //This stuff makes no sense but lasers need a buff. - if (prob(25)) stunned++ - if (stat != 2) - take_organ_damage(0, 20) - updatehealth() - if (prob(25)) - stunned = 1 - else if(flag == PROJECTILE_SHOCK) - if (!eye_blurry) eye_blurry = 4 //This stuff makes no sense but lasers need a buff. - if (prob(25)) stunned++ - if (stat != 2) - take_organ_damage(0, 20) - updatehealth() - if (prob(25)) - stunned = 10 - else - weakened = 10 - else if(flag == PROJECTILE_PULSE) - if (stat != 2) - take_organ_damage(0, 40) - updatehealth() - if (prob(50)) - stunned = min(stunned, 5) - else if(flag == PROJECTILE_BOLT) - toxloss += 3 - radiation += 100 - updatehealth() - stuttering += 5 - drowsyness += 5 - else if (flag == PROJECTILE_WEAKBULLET) - if (stat != 2) - take_organ_damage(10, 0) - updatehealth() - if(weakened <= 5) weakened = 5 - else if (flag == PROJECTILE_WEAKBULLETBURST) - if (stat != 2) - take_organ_damage(5, 0) - updatehealth() - if(weakened <= 2) weakened = 2 - else if (flag == PROJECTILE_WEAKERBULLETBURST) - if (stat != 2) - take_organ_damage(3, 0) - updatehealth() - if(weakened <= 2) weakened = 2 + stunned += Proj.effects["stun"] + + + if(Proj.effects["weak"] && prob(Proj.effectprob["weak"])) + if(Proj.effectmod["weak"] == SET) + weakened = Proj.effects["weak"] + else + weakened += Proj.effects["weak"] + + if(Proj.effects["paralysis"] && prob(Proj.effectprob["paralysis"])) + if(Proj.effectmod["paralysis"] == SET) + paralysis = Proj.effects["paralysis"] + else + paralysis += Proj.effects["paralysis"] + + if(Proj.effects["stutter"] && prob(Proj.effectprob["stutter"])) + if(Proj.effectmod["stutter"] == SET) + stuttering = Proj.effects["stutter"] + else + stuttering += Proj.effects["stutter"] + + if(Proj.effects["drowsyness"] && prob(Proj.effectprob["drowsyness"])) + if(Proj.effectmod["drowsyness"] == SET) + drowsyness = Proj.effects["drowsyness"] + else + drowsyness += Proj.effects["drowsyness"] + + if(Proj.effects["radiation"] && prob(Proj.effectprob["radiation"])) + if(Proj.effectmod["radiation"] == SET) + radiation = Proj.effects["radiation"] + else + radiation += Proj.effects["radiation"] + + if(Proj.effects["eyeblur"] && prob(Proj.effectprob["eyeblur"])) + if(Proj.effectmod["eyeblur"] == SET) + eye_blurry = Proj.effects["eyeblur"] + else + eye_blurry += Proj.effects["eyeblur"] return /mob/living/carbon/monkey/hand_p(mob/M as mob) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index c8f6e9ea72d..d0e4eff1f89 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -7,107 +7,85 @@ src << "\blue You have given up life and succumbed to death." -/mob/living/bullet_act(flag) - switch(flag) - if(PROJECTILE_BULLET) - if (istype(src, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = src - var/dam_zone = pick("chest", "chest", "chest", "groin", "head") - if (H.organs[text("[]", dam_zone)]) - var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)] - if (affecting.take_damage(51, 0)) - H.UpdateDamageIcon() - else - H.UpdateDamage() - else - src.take_organ_damage(51) - src.updatehealth() - if (prob(80) && src.weakened <= 2) - src.weakened = 2 - if(PROJECTILE_TASER) - if (prob(75) && src.stunned <= 10) - src.stunned = 10 - else - src.weakened = 10 - if(PROJECTILE_BULLETBURST) - if (istype(src, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = src - var/dam_zone = pick("chest", "chest", "chest", "groin", "head") - if (H.organs[text("[]", dam_zone)]) - var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)] - if (affecting.take_damage(18, 0)) - H.UpdateDamageIcon() - else - H.UpdateDamage() - else - src.take_organ_damage(18) - src.updatehealth() - if (prob(80) && src.weakened <= 2) - src.weakened = 2 - if(PROJECTILE_TASER) - if (prob(75) && src.stunned <= 10) - src.stunned = 10 - else - src.weakened = 10 - if(PROJECTILE_DART) - src.weakened += 5 - src.toxloss += 10 - if(PROJECTILE_LASER) - if (istype(src, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = src - var/dam_zone = pick("chest", "chest", "chest", "groin", "head") - if (H.organs[text("[]", dam_zone)]) - var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)] - if (affecting.take_damage(20, 0)) - H.UpdateDamageIcon() - else - H.UpdateDamage() +/mob/living/bullet_act(var/obj/item/projectile/Proj) + + for(var/i = 1, i<= Proj.mobdamage.len, i++) + + switch(i) + if(1) + if (istype(src, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = src + var/dam_zone = pick("chest", "chest", "chest", "groin", "head") + if (H.organs[text("[]", dam_zone)]) + var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)] + if (affecting.take_damage(Proj.mobdamage[BRUTE], 0)) + H.UpdateDamageIcon() + else + H.UpdateDamage() src.updatehealth() - else - src.take_organ_damage(20) - if (prob(25) && src.stunned <= 2) - src.stunned = 2 - if(PROJECTILE_SHOCK) - if (istype(src, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = src - var/dam_zone = pick("chest", "chest", "chest", "groin", "head") - if (H.organs[text("[]", dam_zone)]) - var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)] - if (affecting.take_damage(20, 0)) - H.UpdateDamageIcon() - else - H.UpdateDamage() - src.updatehealth() - else - src.take_organ_damage(20) - if (prob(25) && src.stunned <= 2) - src.stunned = 10 - else - src.weakened = 10 - if(PROJECTILE_PULSE) - if (istype(src, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = src - var/dam_zone = pick("chest", "chest", "chest", "groin", "head") - if (H.organs[text("[]", dam_zone)]) - var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)] - if (affecting.take_damage(40, 0)) - H.UpdateDamageIcon() - else - H.UpdateDamage() - src.updatehealth() - else - src.take_organ_damage(40) - if (prob(50)) - src.stunned = min(src.stunned, 5) - if(PROJECTILE_BOLT) - src.toxloss += 3 - src.radiation += 100 - src.updatehealth() - src.stuttering += 5 - src.drowsyness += 5 - if (prob(10)) - src.weakened = min(src.weakened, 2) - return + + else + if(!nodamage) src.take_organ_damage(Proj.mobdamage[BRUTE]) + + if(2) + var/d = Proj.mobdamage[BURN] + if(!Proj.nodamage) fireloss += d + updatehealth() + if(3) + var/d = Proj.mobdamage[TOX] + if(!Proj.nodamage) toxloss += d + updatehealth() + if(4) + var/d = Proj.mobdamage[OXY] + if(!Proj.nodamage) oxyloss += d + updatehealth() + if(5) + var/d = Proj.mobdamage[CLONE] + if(!Proj.nodamage) cloneloss += d + updatehealth() + + if(Proj.effects["stun"] && prob(Proj.effectprob["stun"])) + if(Proj.effectmod["stun"] == SET) + stunned = Proj.effects["stun"] + else + stunned += Proj.effects["stun"] + + + if(Proj.effects["weak"] && prob(Proj.effectprob["weak"])) + if(Proj.effectmod["weak"] == SET) + weakened = Proj.effects["weak"] + else + weakened += Proj.effects["weak"] + + if(Proj.effects["paralysis"] && prob(Proj.effectprob["paralysis"])) + if(Proj.effectmod["paralysis"] == SET) + paralysis = Proj.effects["paralysis"] + else + paralysis += Proj.effects["paralysis"] + + if(Proj.effects["stutter"] && prob(Proj.effectprob["stutter"])) + if(Proj.effectmod["stutter"] == SET) + stuttering = Proj.effects["stutter"] + else + stuttering += Proj.effects["stutter"] + + if(Proj.effects["drowsyness"] && prob(Proj.effectprob["drowsyness"])) + if(Proj.effectmod["drowsyness"] == SET) + drowsyness = Proj.effects["drowsyness"] + else + drowsyness += Proj.effects["drowsyness"] + + if(Proj.effects["radiation"] && prob(Proj.effectprob["radiation"])) + if(Proj.effectmod["radiation"] == SET) + radiation = Proj.effects["radiation"] + else + radiation += Proj.effects["radiation"] + + if(Proj.effects["eyeblur"] && prob(Proj.effectprob["eyeblur"])) + if(Proj.effectmod["eyeblur"] == SET) + eye_blurry = Proj.effects["eyeblur"] + else + eye_blurry += Proj.effects["eyeblur"] /mob/living/proc/updatehealth() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 65b879edcd2..721a8e6733e 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -265,45 +265,12 @@ updatehealth() return -/mob/living/silicon/ai/bullet_act(flag) - if (flag == PROJECTILE_BULLET) - if (stat != 2) - bruteloss += 60 - updatehealth() - weakened = 10 - else if (flag == PROJECTILE_BULLETBURST) - if (stat != 2) - bruteloss += 21 - updatehealth() - weakened = 4 - else if (flag == PROJECTILE_TASER) - if (prob(75)) - stunned = 15 - else - weakened = 15 - else if (flag == PROJECTILE_DART) - return - else if(flag == PROJECTILE_LASER) - if (stat != 2) - bruteloss += 20 - updatehealth() - if (prob(25)) - stunned = 1 - else if(flag == PROJECTILE_SHOCK) - if (stat != 2) - bruteloss += 20 - updatehealth() - if (prob(25)) - stunned = 10 - else - weakened = 10 - else if(flag == PROJECTILE_PULSE) - if (stat != 2) - bruteloss += 40 - updatehealth() - if (prob(50)) - stunned = min(5, stunned) - return +/mob/living/silicon/ai/bullet_act(var/obj/item/projectile/Proj) + + // AI bullet code is pretty simple. No other effects really need to be added. + if(!Proj.nodamage) bruteloss += Proj.damage + updatehealth() + /mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M as mob) if (!ticker) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 453dc7ad2ce..c5618d7badd 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -114,44 +114,11 @@ src.updatehealth() return -/mob/living/silicon/pai/bullet_act(flag) - if (flag == PROJECTILE_BULLET) - if (src.stat != 2) - src.bruteloss += 60 - src.updatehealth() - src.weakened = 10 - else if (flag == PROJECTILE_BULLETBURST) - if (src.stat != 2) - src.bruteloss += 21 - src.updatehealth() - src.weakened = 4 - else if (flag == PROJECTILE_TASER) - if (prob(75)) - src.stunned = 15 - else - src.weakened = 15 - else if (flag == PROJECTILE_DART) - return - else if(flag == PROJECTILE_LASER) - if (src.stat != 2) - src.bruteloss += 20 - src.updatehealth() - if (prob(25)) - src.stunned = 1 - else if(flag == PROJECTILE_SHOCK) - if (src.stat != 2) - src.bruteloss += 20 - src.updatehealth() - if (prob(25)) - src.stunned = 10 - else - src.weakened = 15 - else if(flag == PROJECTILE_PULSE) - if (src.stat != 2) - src.bruteloss += 40 - src.updatehealth() - if (prob(50)) - src.stunned = min(5, src.stunned) +/mob/living/silicon/pai/bullet_act(var/obj/item/projectile/Proj) + + bruteloss += Proj.damage + updatehealth() + return /mob/living/silicon/pai/attack_alien(mob/living/carbon/alien/humanoid/M as mob) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index b4e8d805173..0ec38ed829f 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -271,89 +271,10 @@ updatehealth() return -/mob/living/silicon/robot/bullet_act(flag) - switch(flag) - if(PROJECTILE_BULLET) - if (stat != 2) - bruteloss += 60 - updatehealth() - return - if(PROJECTILE_BULLETBURST) - if (stat != 2) - bruteloss += 21 - updatehealth() - return - /* - if(PROJECTILE_MEDBULLET) - if (stat != 2) - bruteloss += 30 - updatehealth() - */ - if(PROJECTILE_WEAKBULLET) - if (stat != 2) - bruteloss += 15 - updatehealth() - return - if(PROJECTILE_WEAKBULLETBURST) - if (stat != 2) - bruteloss += 7 - updatehealth() - return - if(PROJECTILE_WEAKERBULLETBURST) - if (stat != 2) - bruteloss += 5 - updatehealth() - return - /* - if(PROJECTILE_MPBULLET) - if (stat != 2) - bruteloss += 20 - updatehealth() - - if(PROJECTILE_SLUG) - if (stat != 2) - bruteloss += 40 - updatehealth() - - if(PROJECTILE_BAG) - if (stat != 2) - bruteloss += 2 - updatehealth() - */ - - if(PROJECTILE_TASER) - if (stat != 2) - fireloss += rand(0,10) - stunned += rand(0,3) - return - if(PROJECTILE_DART) - if (stat != 2) - stunned += 5 - fireloss += 10 - updatehealth() - return - /* - if(PROJECTILE_WAVE) - if (stat != 2) - bruteloss += 25 - updatehealth() - return - */ - if(PROJECTILE_LASER) - if (stat != 2) - bruteloss += 20 - updatehealth() - if(PROJECTILE_SHOCK) - if (stat != 2) - bruteloss += 20 - updatehealth() - fireloss += rand(0,10) - stunned += rand(0,3) - if(PROJECTILE_PULSE) - if (stat != 2) - bruteloss += 40 - updatehealth() - spark_system.start() +/mob/living/silicon/robot/bullet_act(var/obj/item/projectile/Proj) + if(!Proj.nodamage) bruteloss += Proj.damage + updatehealth() + if(prob(75) && Proj.damage > 0) spark_system.start() return diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index d8cdc717df3..524eec25d4d 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -171,25 +171,8 @@ field_generator power level display ..() - bullet_act(flag) - if (flag == PROJECTILE_BULLET) - src.power -= 50 - else if (flag == PROJECTILE_BULLETBURST) - src.power -= 20 - else if (flag == PROJECTILE_WEAKBULLET) - src.power -= 25 - else if (flag == PROJECTILE_WEAKBULLETBURST) - src.power -= 13 - else if (flag == PROJECTILE_WEAKERBULLETBURST) - src.power -= 7 - else if (flag == PROJECTILE_LASER) - src.power += 20 - else if (flag == PROJECTILE_SHOCK) - src.power += 25 - else if (flag == PROJECTILE_TASER) - src.power += 5 - else - src.power -= 10 + bullet_act(var/obj/item/projectile/Proj) + power -= Proj.damage update_icon() return