Thread Rating:
  • 8 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Feature] A traitor Katana
#17
There are some problems with some of the initial values for the variables on this thing.

Code:
icon_state = "Sheathed"
item_state = "SheathedHand"
hit_type = DAMAGE_BLUNT
var/sheathed = 1
w_class = 3.0

If we take a look at some later bits of code, we find that these values create some odd behavior.
Code:
if(sheathed)
    var/mob/living/carbon/human/U = user
    playsound(get_turf(U), pick('sound/effects/bloody_stab.ogg'), 70, 0, 0, max(0.7, min(1.2, 1.0 + (30 - U.bioHolder.age)/60)))
Code:
/obj/item/katana/attack_self(mob/user as mob)
    if (user.bioHolder.HasEffect("clumsy") && prob(50))
        user.visible_message("<span style=\"color:red\"><b>[user]</b> fumbles [src] and cuts \himself.</span>")
        user.TakeDamage(user.hand == 1 ? "l_arm" : "r_arm", 5, 5)
        take_bleeding_damage(user, user, 5)
    src.sheathed = !( src.sheathed )
    if (src.sheathed)
        boutput(user, "<span style=\"color:blue\">The sword is now unsheathed</span>")
        hit_type = DAMAGE_CUT
        if(ishuman(user))
            var/mob/living/carbon/human/U = user
            if(U.gender == MALE) playsound(get_turf(U),"sound/weapons/swordsheath.ogg", 70, 0, 0, max(0.7, min(1.2, 1.0 + (30 - U.bioHolder.age)/60)))
            else playsound(get_turf(U),"sound/weapons/swordsheath.ogg", 100, 0, 0, max(0.7, min(1.4, 1.0 + (30 - U.bioHolder.age)/50)))
        src.force = 80
        src.icon_state = "Katana"
        src.item_state = "Katana"
        src.w_class = 4
    else
        boutput(user, "<span style=\"color:blue\">The sword is now sheathed</span>")
        hit_type = DAMAGE_BLUNT
        if(ishuman(user))
            var/mob/living/carbon/human/U = user
            if(U.gender == MALE) playsound(get_turf(U),"sound/weapons/swordsheath.ogg", 70, 0, 0, max(0.7, min(1.2, 1.0 + (30 - U.bioHolder.age)/60)))
            else playsound(get_turf(U),"sound/weapons/swordsheath.ogg", 100, 0, 0, max(0.7, min(1.4, 1.0 + (30 - U.bioHolder.age)/50)))
        src.force = 1
        src.icon_state = "Sheathed"
        src.item_state = "SheathedHand"
        src.w_class = 2
    user.update_inhands()
    src.add_fingerprint(user)
    return

This causes some interesting results with newly spawned katanas.

A freshly spawned katana will spawn with its icons matching those of a sheathed katana, but if you smack someone with it, it will make stabbing noises like an unsheathed sword.

Even though its already sheathed, at least in apperance, you have to actually resheathe it once before you can unsheathe it.

The w_class is initially 3.0, but neither unsheathing nor resheathing the katana will restore it to this weight value. An unsheathed sword has a w_class of 4, and a katana replaced in its scabbard will have a w_class of 2. This means that a newly spawned katana is somehow bigger than the same katana once its been unsheathed and resheathed at least once.
Reply


Messages In This Thread
[Feature] A traitor Katana - by robertGN - 03-15-2016, 08:05 PM
RE: [Feature] A traitor Katana - by Wraithcraft - 02-01-2017, 03:59 PM
RE: [Feature] A traitor Katana - by ZeWaka - 02-01-2017, 08:57 PM
RE: [Feature] A traitor Katana - by Arborinus - 02-02-2017, 12:03 AM
RE: [Feature] A traitor Katana - by Mageziya - 02-02-2017, 04:39 PM
RE: [Feature] A traitor Katana - by misto - 02-03-2017, 09:50 AM
RE: [Feature] A traitor Katana - by atomic1fire - 03-18-2017, 06:22 PM
RE: [Feature] A traitor Katana - by Superlagg - 03-18-2017, 07:32 PM
RE: [Feature] A traitor Katana - by Ed Venture - 03-18-2017, 11:54 PM
RE: [Feature] A traitor Katana - by Nnystyxx - 03-19-2017, 02:28 AM
RE: [Feature] A traitor Katana - by babayetu83 - 03-19-2017, 11:45 PM
RE: [Feature] A traitor Katana - by Dr Zoidcrab - 03-19-2017, 04:59 AM
RE: [Feature] A traitor Katana - by Grifflez - 03-19-2017, 11:28 AM
RE: [Feature] A traitor Katana - by Dr Zoidcrab - 03-20-2017, 03:59 PM
RE: [Feature] A traitor Katana - by Nnystyxx - 03-27-2017, 07:06 AM
RE: [Feature] A traitor Katana - by Noah Buttes - 03-27-2017, 07:46 AM
RE: [Feature] A traitor Katana - by Superlagg - 03-27-2017, 09:01 PM
RE: [Feature] A traitor Katana - by Frank_Stein - 03-28-2017, 01:32 AM
RE: [Feature] A traitor Katana - by Wraithcraft - 03-28-2017, 02:12 PM
RE: [Feature] A traitor Katana - by HydroFloric - 03-28-2017, 02:37 PM
RE: [Feature] A traitor Katana - by Dr Zoidcrab - 03-29-2017, 04:56 AM
RE: [Feature] A traitor Katana - by Cirrial - 03-29-2017, 06:01 AM
RE: [Feature] A traitor Katana - by Sundance - 03-29-2017, 09:48 AM
RE: [Feature] A traitor Katana - by Noah Buttes - 03-29-2017, 09:57 AM
RE: [Feature] A traitor Katana - by Sundance - 03-29-2017, 10:15 AM
RE: [Feature] A traitor Katana - by Dr Zoidcrab - 03-29-2017, 10:33 AM
RE: [Feature] A traitor Katana - by Noah Buttes - 03-29-2017, 10:41 AM
RE: [Feature] A traitor Katana - by Sundance - 03-29-2017, 10:47 AM
RE: [Feature] A traitor Katana - by Frank_Stein - 03-29-2017, 09:21 PM
RE: [Feature] A traitor Katana - by NateTheSquid - 03-30-2017, 12:16 AM
RE: [Feature] A traitor Katana - by medsal15 - 03-30-2017, 01:44 AM
RE: [Feature] A traitor Katana - by Mageziya - 03-30-2017, 02:13 PM
RE: [Feature] A traitor Katana - by Musketman12 - 03-30-2017, 05:38 PM
RE: [Feature] A traitor Katana - by atamusvaleo - 03-31-2017, 07:25 AM
RE: [Feature] A traitor Katana - by robertGN - 03-31-2017, 08:21 AM
RE: [Feature] A traitor Katana - by Frank_Stein - 03-31-2017, 09:43 AM
RE: [Feature] A traitor Katana - by Nnystyxx - 03-31-2017, 10:30 AM
RE: [Feature] A traitor Katana - by Ed Venture - 03-31-2017, 12:38 PM
RE: [Feature] A traitor Katana - by Musketman12 - 03-31-2017, 12:58 PM
RE: [Feature] A traitor Katana - by Ed Venture - 03-31-2017, 01:05 PM
RE: [Feature] A traitor Katana - by Mordent - 03-31-2017, 02:21 PM
RE: [Feature] A traitor Katana - by Frank_Stein - 03-31-2017, 08:26 PM
RE: [Feature] A traitor Katana - by Superlagg - 04-01-2017, 07:20 AM
RE: [Feature] A traitor Katana - by Spy_Guy - 04-02-2017, 10:50 PM
RE: [Feature] A traitor Katana - by Dr Zoidcrab - 04-03-2017, 10:39 AM
RE: [Feature] A traitor Katana - by OMJ - 05-06-2017, 08:23 AM
RE: [Feature] A traitor Katana - by 69andahalf - 05-06-2017, 04:31 PM
RE: [Feature] A traitor Katana - by Ed Venture - 05-06-2017, 08:08 PM
RE: [Feature] A traitor Katana - by ZeWaka - 05-06-2017, 08:28 PM
RE: [Feature] A traitor Katana - by Wraithcraft - 05-07-2017, 07:41 AM
RE: [Feature] A traitor Katana - by robertGN - 05-11-2017, 04:34 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)