Skip to content

Commit

Permalink
Fixed scribbles not having correct blood DNA/fingerprints sometimes, …
Browse files Browse the repository at this point in the history
…as well as fixed palmprints too.

Wrassling tweaks
  • Loading branch information
Crystalwarrior committed Apr 9, 2015
1 parent 768455a commit 2736e15
Show file tree
Hide file tree
Showing 12 changed files with 162 additions and 51 deletions.
15 changes: 13 additions & 2 deletions code/game/objects/effects/decals/Cleanable/humans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
/obj/effect/decal/cleanable/blood/Crossed(mob/living/carbon/human/perp)
if (!istype(perp))
return
if(amount < 1 || nostep)
if(amount <= 0 || nostep)
return

if(perp.shoes && !perp.buckled)//Adding blood to shoes
Expand Down Expand Up @@ -99,11 +99,22 @@
var/obj/item/clothing/gloves/G = user.gloves
G.transfer_blood += taken
G.blood_color = basecolor
//Jacked from blood.dm. I REALLY need to make add_blood_from_DNA.
//if we haven't made our blood_overlay already
if( !G.blood_overlay )
G.generate_blood_overlay()

//apply the blood-splatter overlay if it's not the same blood.
if(G.blood_overlay && G.blood_overlay.color != G.blood_color)
G.blood_overlay.color = G.blood_color
G.overlays.Cut() //This will ruin custom overlays...
G.update_icon() //So this is why you have your overlays made in update_icon
G.overlays += G.blood_overlay
else
user << "<span class='notice'>You get some of \the [src] on your hands.</span>"
if (!user.blood_DNA)
user.blood_DNA = list()
user.blood_DNA |= blood_DNA.Copy()
user.hand_blood_DNA |= blood_DNA.Copy()
user.bloody_hands += taken
user.hand_blood_color = basecolor

Expand Down
1 change: 1 addition & 0 deletions code/game/objects/effects/decals/Cleanable/robots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
basecolor="#232630"
fleshcolor="#FFFFFF"
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7")
amount = 0 //Current issues: counts as blood, shows up as "blood-stained" for examine text. Might have to seperate it from blood type.

/obj/effect/decal/cleanable/blood/gibs/robot/update_icon()
color = "#FFFFFF"
Expand Down
11 changes: 5 additions & 6 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
var/mult = 0 //For code to reset throwforce back to normal after it hits something

//Vars for use by martial arts
var/martial_art = null
var/martial_art_slot = null
var/martial_art_instance = null
var/martial_art_slot = null //The slot the item must be equipped in for martial arts to happen
var/datum/martial_art/martial_art = null //The martial art that is given to user
var/datum/martial_art/martial_art_instance = null //The actual instance that is created

/obj/item/device
icon = 'icons/obj/device.dmi'
Expand Down Expand Up @@ -238,12 +238,11 @@
return

/obj/item/proc/dropped(mob/user as mob)

if(ishuman(user) && martial_art_instance)
var/mob/living/carbon/human/H = user

H.martial_arts -= martial_art_instance

martial_art_instance.onDropped(H)
H.update_martial_art()

..()
Expand Down Expand Up @@ -282,7 +281,7 @@
if(slot == martial_art_slot)
martial_art_instance = new martial_art
H.martial_arts += martial_art_instance

martial_art_instance.onEquip(H)
H.update_martial_art()

return
Expand Down
8 changes: 7 additions & 1 deletion code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,13 @@
return 0

/obj/structure/table/MouseDrop_T(atom/movable/O, mob/user)
if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O))
if(user.canTableClimb && O == user && user.loc != src.loc)
user.visible_message("<span class='danger'>[user] starts climbing onto \the [src]!</span>", \
"<span class='userdanger'>[user] starts climbing onto \the [src]!</span>")
if(do_after(user, 30))
user.loc = src.loc
return
if(!istype(O, /obj/item/weapon) || user.get_active_hand() != O)
return
if(isrobot(user))
return
Expand Down
9 changes: 7 additions & 2 deletions code/modules/MartialArts/martial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var/streak = ""
var/max_streak_length = 6
var/current_target = null
var/priority = 0
var/priority = 0 //Having multiple same-priority martial arts on same guy is not very good, so try to avoid that.

/datum/martial_art/proc/disarm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
return 0
Expand All @@ -14,6 +14,12 @@
/datum/martial_art/proc/grab_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
return 0

/datum/martial_art/proc/onEquip(var/mob/living/carbon/human/H) //Called when martial art was "equipped". Used for wrassling belt.
return 0

/datum/martial_art/proc/onDropped(var/mob/living/carbon/human/H) //Called when martial art was "dropped". Used for wrassling belt.
return 0

/datum/martial_art/proc/add_to_streak(var/element,var/mob/living/carbon/human/D)
if(D != current_target)
current_target = D
Expand All @@ -26,7 +32,6 @@
/datum/martial_art/proc/basic_hit(var/mob/living/carbon/human/A,var/mob/living/carbon/human/D, var/damage = rand(0,9))
add_logs(A, D, "punched")
A.do_attack_animation(D)

var/atk_verb = "punch"
if(D.lying)
atk_verb = "kick"
Expand Down
48 changes: 43 additions & 5 deletions code/modules/MartialArts/plasmafist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,32 @@
return
var/mob/living/carbon/human/H = user
var/datum/martial_art/plasma_fist/M = new()
H.martial_art = M
H.martial_arts += M
if(!H.martial_art) //Check if he already has a martial art "equipped"
H.martial_art = M
user << "<span class='notice'>You have learned the arcane arts of <span class='userdanger'>PLASMA FIST!</span></span>"
user << "<span class='notice'>You have four available combos to perform:</span>"
user << "<span class='notice'><B>TORNADO COMBO!</B> Harm, Harm, Disarm (HHD)</span>"
user << "<span class='notice'><B>THROWBACK PUNCH!</B> Disarm, Harm, Disarm (DHD)</span>"
user << "<span class='notice'><B>KNOCKOUT KICK!</B> Grab, Grab, Harm (GGH)</span>"
user << "<span class='notice'><B>THE ULTIMATE PLASMA FIST TECHNIQUE! Grab, Harm, Disarm, Disarm, Disarm (GHDDD)</span>"
user << "<span class='notice'>Check your memory to remember these techniques again.</span>"
if(H.mind)
H.mind.store_memory(\
{"<HR>You have learned the arcane arts of <B>PLASMA FIST!</B>
You have four available combos to perform:
<B>TORNADO COMBO!</B> Harm, Harm, Disarm (HHD)
<B>THROWBACK PUNCH!</B> Disarm, Harm, Disarm (DHD)
<B>KNOCKOUT KICK!</B> Grab, Grab, Harm (GGH)
<B>THE ULTIMATE PLASMA FIST TECHNIQUE!</B> Grab, Harm, Disarm, Disarm, Disarm (GHDDD)
<HR>"}\
)
used = 1
desc += "It looks like it's magic was used up."

#define TORNADO_COMBO "HHD"
#define THROWBACK_COMBO "DHD"
#define KNOCKOUT_COMBO "GGH"
#define PLASMA_COMBO "GHDDD"

/datum/martial_art/plasma_fist
Expand All @@ -26,9 +45,10 @@
var/mob/living/carbon/human/lastmob //This is used for localized streaks. Streak will get cancelled if you switch victims.

/datum/martial_art/plasma_fist/proc/check_streak(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
if(lastmob != D) //Streaks should only be on the same mob.
streak = "" //This cancels out the combos too
lastmob = D //Assign the new lastmob
//If you're attacked by someone else with plasma fist your streak is broken. Must be fixed before uncommenting
// if(lastmob != D) //Streaks should only be on the same mob.
// streak = "" //This cancels out the combos too
// lastmob = D //Assign the new lastmob
if(findtext(streak,TORNADO_COMBO))
streak = ""
Tornado(A,D)
Expand All @@ -37,6 +57,10 @@
streak = ""
Throwback(A,D)
return 1
if(findtext(streak,KNOCKOUT_COMBO))
streak = ""
Knockout(A,D)
return 1
if(findtext(streak,PLASMA_COMBO))
streak = ""
Plasma(A,D)
Expand Down Expand Up @@ -67,14 +91,28 @@
D.IgniteMob()
var/atom/throw_target = get_edge_target_turf(D, get_dir(D, get_step_away(D, A)))
D.throw_at(throw_target, 200, 3)
A.say("HYAH!")
A.say("PLASMA PUNCH!")
A.changeNext_move(3) //Same cooldown for subsequent punches. Otherwise it throws you off.
return

/datum/martial_art/plasma_fist/proc/Knockout(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
D.visible_message("<span class='danger'>[A] has knocked down [D] with a kick!</span>", \
"<span class='userdanger'>[A] has knocked down [D] with a kick!</span>")
playsound(D.loc, 'sound/weapons/punch1.ogg', 50, 1, -1)
D.adjustBruteLoss(17) //Pretty hefty damage.
D.Paralyse(2) //You got kicked so hard you lost consciousness!
var/atom/throw_target = get_edge_target_turf(D, get_dir(D, get_step_away(D, A)))
D.throw_at(throw_target, 2, 2)
A.say("PLASMA KICK!")
A.changeNext_move(3) //Same cooldown for subsequent combos. Otherwise it throws you off.
return

/datum/martial_art/plasma_fist/proc/Plasma(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
A.do_attack_animation(D)
playsound(D.loc, 'sound/weapons/punch1.ogg', 50, 1, -1)
playsound(D.loc, pick("explosion"), 30, 1) //So it's pretty radcore
A.say("PLASMA FIST!")
A.emote("scream")
D.visible_message("<span class='danger'>[A] has hit [D] with THE PLASMA FIST TECHNIQUE!</span>", \
"<span class='userdanger'>[A] has hit [D] with THE PLASMA FIST TECHNIQUE!</span>")
var/obj/item/organ/brain/B = D.getorgan(/obj/item/organ/brain)
Expand Down
86 changes: 63 additions & 23 deletions code/modules/MartialArts/wrestling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,89 @@
name = "Wrestling"
priority = 9

/datum/martial_art/wrestling/harm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
D.grabbedby(A,1)
var/obj/item/weapon/grab/G = A.get_active_hand()
if(G && prob(50))
G.state = GRAB_AGGRESSIVE
G.icon_state = "disarm/kill" //TODO: make grabs have update_icon() proc.
D.visible_message("<span class='danger'>[A] has [D] in a clinch!</span>", \
"<span class='userdanger'>[A] has [D] in a clinch!</span>")
else
D.visible_message("<span class='danger'>[A] fails to get [D] in a clinch!</span>", \
"<span class='userdanger'>[A] fails to get [D] in a clinch!</span>")
return 1


/datum/martial_art/wrestling/proc/Suplex(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
D.visible_message("<span class='danger'>[A] suplexes [D]!</span>", \
"<span class='userdanger'>[A] suplexes [D]!</span>")
D.forceMove(A.loc)
var/armor_block = D.run_armor_check(null, "melee")
D.apply_damage(30, BRUTE, null, armor_block)
D.apply_effect(5, WEAKEN, armor_block)
A.SpinAnimation(10,1)

D.SpinAnimation(10,1)
spawn(3)
armor_block = A.run_armor_check(null, "melee")
A.apply_effect(5, WEAKEN, armor_block)
A.apply_effect(4, WEAKEN, armor_block)
D.apply_damage(25, BRUTE, null, armor_block)
playsound(D, pick("swing_hit"), 40, 1)
return

/datum/martial_art/wrestling/proc/BackhandChop(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
D.visible_message("<span class='danger'>[A] backhand chops [D]!</span>", \
"<span class='userdanger'>[A] backhand chops [D]!</span>")
D.Move(get_step(D,A.dir))
var/armor_block = D.run_armor_check(null, "melee")
D.apply_effect(0.5, STUN, armor_block)
D.apply_damage(10, STAMINA, null, armor_block)
playsound(D, 'sound/weapons/push_hard.ogg', 50, 1)
return

/datum/martial_art/wrestling/proc/ChopDrop(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
D.visible_message("<span class='danger'>[A] chop drops [D]!</span>", \
"<span class='userdanger'>[A] chop drops [D]!</span>")
A.do_attack_animation(D)
spawn(1)
A.forceMove(D.loc)
var/armor_block = D.run_armor_check(null, "melee")
D.apply_damage(10, BRUTE, null, armor_block)
D.apply_effect(2, WEAKEN, armor_block)
armor_block = A.run_armor_check(null, "melee")
D.apply_effect(1, WEAKEN, armor_block)
A.changeNext_move(20) //Takes 2 seconds for another attack to pass
playsound(D, pick("swing_hit"), 40, 1)
return

/datum/martial_art/wrestling/harm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
// if(istype(A.get_inactive_hand(),/obj/item/weapon/grab))
// var/obj/item/weapon/grab/G = A.get_inactive_hand()
// if(G.affecting == D)
// ChopDrop(A,D)
// return 1
if(D.lying)
ChopDrop(A,D)
return 1
BackhandChop(A,D)
return 1

/datum/martial_art/wrestling/disarm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
if(istype(A.get_inactive_hand(),/obj/item/weapon/grab))
var/obj/item/weapon/grab/G = A.get_inactive_hand()
if(G.affecting == D)
Suplex(A,D)
return 1
harm_act(A,D)
grab_act(A,D)
return 1

/datum/martial_art/wrestling/grab_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
D.grabbedby(A,1)
D.visible_message("<span class='danger'>[A] holds [D] down!</span>", \
"<span class='userdanger'>[A] holds [D] down!</span>")
var/obj/item/organ/limb/affecting = D.get_organ(ran_zone(A.zone_sel.selecting))
var/armor_block = D.run_armor_check(affecting, "melee")
D.apply_damage(10, STAMINA, affecting, armor_block)
return 1
var/obj/item/weapon/grab/G = A.get_active_hand()
if(G && prob(50))
G.state = GRAB_AGGRESSIVE
D.visible_message("<span class='danger'>[A] has [D] in a clinch!</span>", \
"<span class='userdanger'>[A] has [D] in a clinch!</span>")
else
D.visible_message("<span class='danger'>[A] holds [D] down!</span>", \
"<span class='userdanger'>[A] holds [D] down!</span>")
return 1

//BROKEN: Doesn't remove tableclimbing when dropped.
// /datum/martial_art/wrestling/onEquip(var/mob/living/carbon/human/H)
// if(istype(H))
// H.canTableClimb = 1
// return 1
// return 0

// /datum/martial_art/wrestling/onDropped(var/mob/living/carbon/human/H)
// if(istype(H))
// H.canTableClimb = 0
// return 1
// return 0
6 changes: 4 additions & 2 deletions code/modules/detectivework/bloody_handwriting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@
W.info = message
W.desc = "It's written in blood..."
W.add_fingerprint(src)
// W.add_blood_list(bloodmob)
W.blood_DNA |= transferDNA.Copy()
if(bloodmob)
W.add_blood_list(bloodmob)
else
W.blood_DNA |= transferDNA.Copy()

if(InCritical())
if(stat == UNCONSCIOUS)
Expand Down
10 changes: 8 additions & 2 deletions code/modules/detectivework/detective_work.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ atom/proc/add_fibers(mob/living/carbon/human/M)
if(istype(B))
if(istype(G.bloody_hands_mob)) //Fixes runtimes
B.add_blood_list(G.bloody_hands_mob)
B.basecolor = M.blood_color
else
B.blood_DNA |= G.blood_DNA.Copy()
B.basecolor = G.blood_color
B.update_icon() //Updates the color and stuff
var/blooddir = get_dir(M, src)
//Adjust pixel offset to make palmprints appear on the wall
B.pixel_x = blooddir & EAST ? 32 : (blooddir & WEST ? -32 : 0)
Expand All @@ -30,7 +33,10 @@ atom/proc/add_fibers(mob/living/carbon/human/M)
if(istype(B))
if(istype(M.bloody_hands_mob)) //Fixes runtimes
B.add_blood_list(M.bloody_hands_mob)
B.basecolor = M.blood_color
else
B.blood_DNA |= M.hand_blood_DNA.Copy()
B.basecolor = M.blood_color
B.update_icon() //Updates the color and stuff
var/blooddir = get_dir(M, src)
//Adjust pixel offset to make palmprints appear on the wall
B.pixel_x = blooddir & EAST ? 32 : (blooddir & WEST ? -32 : 0)
Expand Down
15 changes: 8 additions & 7 deletions code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -659,15 +659,16 @@
H.nutrition_icon.icon_state = "nutrition4"

if(H.stamina_icon)
// world.log << "[H.getStaminaLoss()] Stamina Loss"
// H.stamina_icon.icon_state = "stamina[round(H.getStaminaLoss()/20)]" //Can't display "critstate" stamina loss with this sadly
switch(H.getStaminaLoss())
if(90 to INFINITY) H.stamina_icon.icon_state = "stamina5"
if(80 to 90) H.stamina_icon.icon_state = "stamina4"
if(60 to 80) H.stamina_icon.icon_state = "stamina3"
if(40 to 60) H.stamina_icon.icon_state = "stamina2"
if(20 to 40) H.stamina_icon.icon_state = "stamina1"
if(0 to 20) H.stamina_icon.icon_state = "stamina0"
else H.stamina_icon.icon_state = "stamina"
if(91 to INFINITY) H.stamina_icon.icon_state = "stamina5"
if(81 to 90) H.stamina_icon.icon_state = "stamina4"
if(61 to 80) H.stamina_icon.icon_state = "stamina3"
if(41 to 60) H.stamina_icon.icon_state = "stamina2"
if(1 to 40) H.stamina_icon.icon_state = "stamina1"
if(-INFINITY to 0) H.stamina_icon.icon_state = "stamina0"
else H.stamina_icon.icon_state = "stamina"

if(H.pressure)
H.pressure.icon_state = "pressure[H.pressure_alert]"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,4 @@
var/atom/movable/remote_control //Calls relaymove() to whatever it is

var/turf/listed_turf = null //the current turf being examined in the stat panel
var/footstep = 0 //Footstep cooldown
var/canTableClimb = 0 //Can this mob climb tables? Drag+drop yourself on a table to climb.
Loading

0 comments on commit 2736e15

Please sign in to comment.