5f835bfc26
Please refer to #20867 and #20870 for a easier view of the changes. Those two PRs show all meaningful changes (hopefully) and doesn't show the files changed with just 3 lines changed. This PR does three things: It makes all children of /obj/ use the same damage system. Previously to make your new machine/structure be destroyable you needed to give it a var/health, and its own version of many damage related proc such as bullet_act(), take_damage(), attacked_by(), attack_animal(), attack_hulk(), ex_act(), etc... But now, all /obj/ use the same version of those procs at the /obj/ level in code/game/obj_defense.dm. All these obj share the same necessary vars: obj_integrity (health), max_integrity, integrity_failure (optional, below that health level failure happens), and the armor list var which was previously only for items, as well as the resistance_flags bitfield. When you want your new object to be destroyable, you only have to give it a value for those vars and maybe override one proc if you want a special behavior but that's it. This reorganization removes a lot of copypasta (most bullet_act() version for each obj were nearly identical). Two new elements are added to the armor list var: fire and acid armor values. How much damage an obj take depends on the armor value for each damage category. But some objects are INDESTRUCTIBLE and simply never take any damage no matter the type. The armor categories are: -melee(punches, item attacks, xeno/animal/hulk attacks, blob attacks, thrown weapons) -bullet -laser -energy (used by projectiles like ionrifle, taser, and also by EMPs) -bio (unused for this, only here because clothes use them when worn) -rad (same) -bomb (self-explanatory) -fire (for fire damage, not for heat damage though) -acid For machines and structures, when their health reaches zero the object is not just deleted but gets somewhat forcedeconstructed (the proc used is shared with the actual deconstruction system) which can drops things. To not frustrates players most of these objects drop most of the elements necessary to rebuild them (think window dropping shards). Machines drop a machine frame and all components for example (but the frame can then be itself smashed to pieces). For clothes, when they are damaged, they get a "damaged" overlay, which can also be seen when worn, similar to the "bloody" overlay. It refactors acid. See #20537. Some objects are ACID_PROOF and take no damage from acid, while others take varying amounts of damage depending on their acid armor value. Some objects are even UNACIDABLE, no acid effect can even land on them. Acid on objects can be washed off using water. It changes some aspect of damage from fires. All /obj/ can now take fire damage and be flammable, instead of just items. And instead of having just FLAMMABLE objs that become ON_FIRE as soon as some fire touch them (paper), we now have objects that are non flammable but do take damage from fire and become ashes if their health reaches zero (only for items). The damage taken varies depending on the obj's fire armor value and total health. There's also still obj and items that are FIRE_PROOF (although some might still be melted by lava if they're not LAVA_PROOF). When a mob is on fire, its clothes now take fire damage and can turn to ashes. Similarly, when a mob takes melee damages, its clothes gets damaged a bit and can turn to shreds. You can repair clothes with cloth that is produceable by botany's biogenerator. It also does many minor things: Clicking a structure/machine with an item on help intent never results in an attack (so you don't destroy a structure while trying to figure out which tool to use). I moved a lot of objects away from /obj/effect, it should only be used for visual effects, decals and stuff, not for things you can hit and destroy. I tweaked a bit how clothes shredding from bombs work. I made a machine or structure un/anchorable with the wrench, I don't remember which object... Since I changed the meaning of the FIRE_PROOF bitflag to actually mean fire immune, I'm buffing the slime extract that you apply on items to make them fire proof. well now they're really 100% fire proof! animals with environment_smash = 1 no longer one-hit destroy tables and stuff, we give them a decent obj_damage value so they can destroy most obj relatively fast depending on the animal. Probably a million things I forgot. If you want to know how the damage system works all you need is the three obj vars "obj_integrity", "max_integrity", "integrity_failure", as well as the armor list var and the resistance_flags bitfield, and read the file obj_defense.dm
338 lines
9.5 KiB
Plaintext
338 lines
9.5 KiB
Plaintext
//Academy Areas
|
|
|
|
/area/awaymission/academy
|
|
name = "Academy Asteroids"
|
|
icon_state = "away"
|
|
|
|
/area/awaymission/academy/headmaster
|
|
name = "Academy Fore Block"
|
|
icon_state = "away1"
|
|
|
|
/area/awaymission/academy/classrooms
|
|
name = "Academy Classroom Block"
|
|
icon_state = "away2"
|
|
|
|
/area/awaymission/academy/academyaft
|
|
name = "Academy Ship Aft Block"
|
|
icon_state = "away3"
|
|
|
|
/area/awaymission/academy/academygate
|
|
name = "Academy Gateway"
|
|
icon_state = "away4"
|
|
|
|
/area/awaymission/academy/academycellar
|
|
name = "Academy Cellar"
|
|
icon_state = "away4"
|
|
|
|
/area/awaymission/academy/academyengine
|
|
name = "Academy Engine"
|
|
icon_state = "away4"
|
|
|
|
//Academy Items
|
|
|
|
/obj/singularity/academy
|
|
dissipate = 0
|
|
move_self = 0
|
|
grav_pull = 1
|
|
|
|
/obj/singularity/academy/admin_investigate_setup()
|
|
return
|
|
|
|
/obj/singularity/academy/process()
|
|
eat()
|
|
if(prob(1))
|
|
mezzer()
|
|
|
|
|
|
/obj/item/clothing/glasses/meson/truesight
|
|
name = "The Lens of Truesight"
|
|
desc = "I can see forever!"
|
|
icon_state = "monocle"
|
|
item_state = "headset"
|
|
|
|
|
|
/obj/structure/academy_wizard_spawner
|
|
name = "Academy Defensive System"
|
|
desc = "Made by Abjuration Inc"
|
|
icon = 'icons/obj/cult.dmi'
|
|
icon_state = "forge"
|
|
anchored = 1
|
|
obj_integrity = 200
|
|
max_integrity = 200
|
|
var/mob/living/current_wizard = null
|
|
var/next_check = 0
|
|
var/cooldown = 600
|
|
var/faction = "wizard"
|
|
var/braindead_check = 0
|
|
|
|
/obj/structure/academy_wizard_spawner/New()
|
|
START_PROCESSING(SSobj, src)
|
|
|
|
/obj/structure/academy_wizard_spawner/Destroy()
|
|
if(!broken)
|
|
STOP_PROCESSING(SSobj, src)
|
|
return ..()
|
|
|
|
/obj/structure/academy_wizard_spawner/process()
|
|
if(next_check < world.time)
|
|
if(!current_wizard)
|
|
for(var/mob/living/L in player_list)
|
|
if(L.z == src.z && L.stat != DEAD && !(faction in L.faction))
|
|
summon_wizard()
|
|
break
|
|
else
|
|
if(current_wizard.stat == DEAD)
|
|
current_wizard = null
|
|
summon_wizard()
|
|
if(!current_wizard.client)
|
|
if(!braindead_check)
|
|
braindead_check = 1
|
|
else
|
|
braindead_check = 0
|
|
give_control()
|
|
next_check = world.time + cooldown
|
|
|
|
/obj/structure/academy_wizard_spawner/proc/give_control()
|
|
if(!current_wizard)
|
|
return
|
|
spawn(0)
|
|
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as Wizard Academy Defender?", "wizard", null, ROLE_WIZARD, current_wizard)
|
|
var/mob/dead/observer/chosen = null
|
|
|
|
if(candidates.len)
|
|
chosen = pick(candidates)
|
|
message_admins("[key_name_admin(chosen)] was spawned as Wizard Academy Defender")
|
|
current_wizard.ghostize() // on the off chance braindead defender gets back in
|
|
current_wizard.key = chosen.key
|
|
|
|
/obj/structure/academy_wizard_spawner/proc/summon_wizard()
|
|
var/turf/T = src.loc
|
|
|
|
var/mob/living/carbon/human/wizbody = new(T)
|
|
wizbody.equipOutfit(/datum/outfit/wizard/academy)
|
|
var/obj/item/weapon/implant/exile/Implant = new/obj/item/weapon/implant/exile(wizbody)
|
|
Implant.implant(wizbody)
|
|
wizbody.faction |= "wizard"
|
|
wizbody.real_name = "Academy Teacher"
|
|
wizbody.name = "Academy Teacher"
|
|
|
|
var/datum/mind/wizmind = new /datum/mind()
|
|
wizmind.name = "Wizard Defender"
|
|
wizmind.special_role = "Academy Defender"
|
|
var/datum/objective/O = new("Protect Wizard Academy from the intruders")
|
|
wizmind.objectives += O
|
|
wizmind.transfer_to(wizbody)
|
|
ticker.mode.wizards |= wizmind
|
|
|
|
wizmind.AddSpell(new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt)
|
|
wizmind.AddSpell(new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile)
|
|
wizmind.AddSpell(new /obj/effect/proc_holder/spell/fireball)
|
|
|
|
current_wizard = wizbody
|
|
|
|
give_control()
|
|
|
|
/obj/structure/academy_wizard_spawner/deconstruct(disassembled = TRUE)
|
|
if(!broken)
|
|
broken = 1
|
|
visible_message("<span class='warning'>[src] breaks down!</span>")
|
|
icon_state = "forge_off"
|
|
STOP_PROCESSING(SSobj, src)
|
|
|
|
/datum/outfit/wizard/academy
|
|
name = "Academy Wizard"
|
|
r_pocket = null
|
|
r_hand = null
|
|
suit = /obj/item/clothing/suit/wizrobe/red
|
|
head = /obj/item/clothing/head/wizard/red
|
|
backpack_contents = list(/obj/item/weapon/storage/box/survival = 1)
|
|
|
|
/obj/item/weapon/dice/d20/fate
|
|
name = "Die of Fate"
|
|
desc = "A die with twenty sides. You can feel unearthly energies radiating from it. Using this might be VERY risky."
|
|
icon_state = "d20"
|
|
sides = 20
|
|
var/reusable = 1
|
|
var/used = 0
|
|
var/rigged = -1
|
|
|
|
/obj/item/weapon/dice/d20/fate/one_use
|
|
reusable = 0
|
|
|
|
/obj/item/weapon/dice/d20/fate/diceroll(mob/user)
|
|
..()
|
|
if(!used)
|
|
if(!ishuman(user) || !user.mind || (user.mind in ticker.mode.wizards))
|
|
user << "<span class='warning'>You feel the magic of the dice is restricted to ordinary humans!</span>"
|
|
return
|
|
if(rigged > 0)
|
|
effect(user,rigged)
|
|
else
|
|
effect(user,result)
|
|
|
|
/obj/item/weapon/dice/d20/fate/equipped(mob/user, slot)
|
|
if(!ishuman(user) || !user.mind || (user.mind in ticker.mode.wizards))
|
|
user << "<span class='warning'>You feel the magic of the dice is restricted to ordinary humans! You should leave it alone.</span>"
|
|
user.drop_item()
|
|
|
|
|
|
/obj/item/weapon/dice/d20/fate/proc/effect(var/mob/living/carbon/human/user,roll)
|
|
if(!reusable)
|
|
used = 1
|
|
visible_message("<span class='userdanger'>The die flare briefly.</span>")
|
|
switch(roll)
|
|
if(1)
|
|
//Dust
|
|
user.dust()
|
|
if(2)
|
|
//Death
|
|
user.death()
|
|
if(3)
|
|
//Swarm of creatures
|
|
for(var/direction in alldirs)
|
|
var/turf/T = get_turf(src)
|
|
new /mob/living/simple_animal/hostile/creature(get_step(T,direction))
|
|
if(4)
|
|
//Destroy Equipment
|
|
for (var/obj/item/I in user)
|
|
if (istype(I, /obj/item/weapon/implant))
|
|
continue
|
|
qdel(I)
|
|
if(5)
|
|
//Monkeying
|
|
user.monkeyize()
|
|
if(6)
|
|
//Cut speed
|
|
var/datum/species/S = user.dna.species
|
|
S.speedmod += 1
|
|
if(7)
|
|
//Throw
|
|
user.Stun(3)
|
|
user.adjustBruteLoss(50)
|
|
var/throw_dir = pick(cardinal)
|
|
var/atom/throw_target = get_edge_target_turf(user, throw_dir)
|
|
user.throw_at(throw_target, 200, 4)
|
|
if(8)
|
|
//Fueltank Explosion
|
|
explosion(src.loc,-1,0,2, flame_range = 2)
|
|
if(9)
|
|
//Cold
|
|
var/datum/disease/D = new /datum/disease/cold
|
|
user.ForceContractDisease(D)
|
|
if(10)
|
|
//Nothing
|
|
visible_message("<span class='notice'>[src] roll perfectly.</span>")
|
|
if(11)
|
|
//Cookie
|
|
var/obj/item/weapon/reagent_containers/food/snacks/cookie/C = new(get_turf(src))
|
|
C.name = "Cookie of Fate"
|
|
if(12)
|
|
//Healing
|
|
user.revive(full_heal = 1, admin_revive = 1)
|
|
if(13)
|
|
//Mad Dosh
|
|
var/turf/Start = get_turf(src)
|
|
for(var/direction in alldirs)
|
|
var/turf/T = get_step(Start,direction)
|
|
if(rand(0,1))
|
|
new /obj/item/stack/spacecash/c1000(T)
|
|
else
|
|
var/obj/item/weapon/storage/bag/money/M = new(T)
|
|
for(var/i in 1 to rand(5,50))
|
|
new /obj/item/weapon/coin/gold(M)
|
|
if(14)
|
|
//Free Gun
|
|
new /obj/item/weapon/gun/projectile/revolver/mateba(get_turf(src))
|
|
if(15)
|
|
//Random One-use spellbook
|
|
new /obj/item/weapon/spellbook/oneuse/random(get_turf(src))
|
|
if(16)
|
|
//Servant & Servant Summon
|
|
var/mob/living/carbon/human/H = new(get_turf(src))
|
|
H.equipOutfit(/datum/outfit/butler)
|
|
var/datum/mind/servant_mind = new /datum/mind()
|
|
var/datum/objective/O = new("Serve [user.real_name].")
|
|
servant_mind.objectives += O
|
|
servant_mind.transfer_to(H)
|
|
|
|
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [user.real_name] Servant?", "wizard", mob = H)
|
|
var/mob/dead/observer/chosen = null
|
|
|
|
if(candidates.len)
|
|
chosen = pick(candidates)
|
|
message_admins("[key_name_admin(chosen)] was spawned as Dice Servant")
|
|
H.key = chosen.key
|
|
|
|
var/obj/effect/proc_holder/spell/targeted/summonmob/S = new
|
|
S.target_mob = H
|
|
user.mind.AddSpell(S)
|
|
|
|
if(17)
|
|
//Tator Kit
|
|
new /obj/item/weapon/storage/box/syndicate/(get_turf(src))
|
|
if(18)
|
|
//Captain ID
|
|
new /obj/item/weapon/card/id/captains_spare(get_turf(src))
|
|
if(19)
|
|
//Instrinct Resistance
|
|
user << "<span class='notice'>You feel robust.</span>"
|
|
var/datum/species/S = user.dna.species
|
|
S.brutemod *= 0.5
|
|
S.burnmod *= 0.5
|
|
S.coldmod *= 0.5
|
|
if(20)
|
|
//Free wizard!
|
|
user.mind.make_Wizard()
|
|
|
|
|
|
/datum/outfit/butler
|
|
name = "Butler"
|
|
uniform = /obj/item/clothing/under/suit_jacket/really_black
|
|
shoes = /obj/item/clothing/shoes/laceup
|
|
head = /obj/item/clothing/head/bowler
|
|
glasses = /obj/item/clothing/glasses/monocle
|
|
gloves = /obj/item/clothing/gloves/color/white
|
|
|
|
/obj/effect/proc_holder/spell/targeted/summonmob
|
|
name = "Summon Servant"
|
|
desc = "This spell can be used to call your servant, whenever you need it."
|
|
charge_max = 100
|
|
clothes_req = 0
|
|
invocation = "JE VES"
|
|
invocation_type = "whisper"
|
|
range = -1
|
|
level_max = 0 //cannot be improved
|
|
cooldown_min = 100
|
|
include_user = 1
|
|
|
|
var/mob/living/target_mob
|
|
|
|
action_icon_state = "summons"
|
|
|
|
/obj/effect/proc_holder/spell/targeted/summonmob/cast(list/targets,mob/user = usr)
|
|
if(!target_mob)
|
|
return
|
|
var/turf/Start = get_turf(user)
|
|
for(var/direction in alldirs)
|
|
var/turf/T = get_step(Start,direction)
|
|
if(!T.density)
|
|
target_mob.Move(T)
|
|
|
|
/obj/structure/ladder/unbreakable/rune
|
|
name = "Teleportation Rune"
|
|
desc = "Could lead anywhere."
|
|
icon = 'icons/obj/rune.dmi'
|
|
icon_state = "1"
|
|
color = rgb(0,0,255)
|
|
|
|
/obj/structure/ladder/unbreakable/rune/update_icon()
|
|
return
|
|
|
|
/obj/structure/ladder/unbreakable/rune/show_fluff_message(up,mob/user)
|
|
user.visible_message("[user] activates \the [src].","<span class='notice'>You activate \the [src].</span>")
|
|
|
|
/obj/structure/ladder/can_use(mob/user)
|
|
if(user.mind in ticker.mode.wizards)
|
|
return 0
|
|
return 1
|