Files
Polaris/code/game/objects/items/weapons/melee/misc.dm
Neerti fdabe51ee8 Linter Introduction + Cleanup (#8085)
* Adds linter defines to repo.

* Uncomments linter defines already in the code.

* Resolves unreachable code linter errors.

* Nukes decade+ old syndie specops code except for computer since that's mapped in?????

* Resolves procs has no parent linter error.

* Proc signature fixes

* Bad comments

* "In" danger

* Type safety

* Implied nested list abuse

* Top level ..() usage

* Sleepy coder typos

* Invalid kwargs calls

* Pointless returns

* Linter hacks (see full message)

Byond doesn't care and it has no effect but linter doesn't like var/proc
for holding references to procs, despite that it's valid byond code.

Also, the linter seems to have serious issues figuring out relative
proc names. This commit is a sort of take-it-or-leave-it thing. It's not
required, it just cuts down on warnings, but this code is valid DM code.

* WHATEVER THIS IS

* Trick dreamchecker linter into ignoring this file's sins in it's weird use of vars

* Fix list decoration syntax - Its a list, not list of lists

- To declare that a var is a list you can `var/list/blah = list()` syntax or the `var/blah[0]` syntax.  Both do exactly the same thing. But if you do `var/list/blah[0]` that is just like doing `var/list/list/blah = list()`

* Hopefully stops the ai holder subtype folder from going quantum and sometimes changes capitalization over time, and incidentally causing 20+ linter errors.

* Fixes unwrapped negated object in list linter error.

* Resolves colon-like list accessing linter error.

* Turns linter on in linter config.

* Fixes closet indentation properly and cleans up suit storage unit switch.

Co-authored-by: Aronai Sieyes <arokha@arokha.com>
Co-authored-by: Leshana <Leshana@users.noreply.github.com>
2021-05-25 18:17:26 -09:00

89 lines
3.4 KiB
Plaintext

/obj/item/weapon/melee/chainofcommand
name = "chain of command"
desc = "A tool used by great men to placate the frothing masses."
icon_state = "chain"
slot_flags = SLOT_BELT
force = 10
throwforce = 7
w_class = ITEMSIZE_NORMAL
origin_tech = list(TECH_COMBAT = 4)
attack_verb = list("flogged", "whipped", "lashed", "disciplined")
reach = 2
/obj/item/weapon/melee/chainofcommand/suicide_act(mob/user)
var/datum/gender/T = gender_datums[user.get_visible_gender()]
user.visible_message(span("danger", "\The [user] [T.is] strangling [T.himself] with \the [src]! It looks like [T.he] [T.is] trying to commit suicide."), span("danger", "You start to strangle yourself with \the [src]!"), span("danger", "You hear the sound of someone choking!"))
return (OXYLOSS)
/obj/item/weapon/melee/umbrella
name = "umbrella"
desc = "To keep the rain off you. Use with caution on windy days."
icon = 'icons/obj/items.dmi'
icon_state = "umbrella_closed"
addblends = "umbrella_closed_a"
slot_flags = SLOT_BELT
force = 5
throwforce = 5
w_class = ITEMSIZE_NORMAL
var/open = FALSE
/obj/item/weapon/melee/umbrella/New()
..()
update_icon()
/obj/item/weapon/melee/umbrella/attack_self()
src.toggle_umbrella()
/obj/item/weapon/melee/umbrella/proc/toggle_umbrella()
open = !open
icon_state = "umbrella_[open ? "open" : "closed"]"
addblends = icon_state + "_a"
item_state = icon_state
update_icon()
if(ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
H.update_inv_l_hand(0)
H.update_inv_r_hand()
// Randomizes color
/obj/item/weapon/melee/umbrella/random/New()
color = "#"+get_random_colour()
..()
/obj/item/weapon/melee/cursedblade
name = "crystal blade"
desc = "The red crystal blade's polished surface glints in the light, giving off a faint glow."
icon_state = "soulblade"
slot_flags = SLOT_BELT | SLOT_BACK
force = 30
throwforce = 10
w_class = ITEMSIZE_NORMAL
sharp = 1
edge = 1
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
can_speak = 1
var/list/voice_mobs = list() //The curse of the sword is that it has someone trapped inside.
/obj/item/weapon/melee/cursedblade/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
if(default_parry_check(user, attacker, damage_source) && prob(50))
user.visible_message("<span class='danger'>\The [user] parries [attack_text] with \the [src]!</span>")
playsound(src, 'sound/weapons/punchmiss.ogg', 50, 1)
return 1
return 0
/obj/item/weapon/melee/cursedblade/proc/ghost_inhabit(var/mob/candidate)
if(!isobserver(candidate))
return
//Handle moving the ghost into the new shell.
announce_ghost_joinleave(candidate, 0, "They are occupying a cursed sword now.")
var/mob/living/voice/new_voice = new /mob/living/voice(src) //Make the voice mob the ghost is going to be.
new_voice.transfer_identity(candidate) //Now make the voice mob load from the ghost's active character in preferences.
new_voice.mind = candidate.mind //Transfer the mind, if any.
new_voice.ckey = candidate.ckey //Finally, bring the client over.
new_voice.name = "cursed sword" //Cursed swords shouldn't be known characters.
new_voice.real_name = "cursed sword"
voice_mobs.Add(new_voice)
listening_objects |= src