From 7ee2b8f79ea33925d967d6e7b05a19982656f0da Mon Sep 17 00:00:00 2001 From: cib Date: Thu, 22 Mar 2012 14:53:29 -0800 Subject: [PATCH 1/3] Added a swing mechanic. --- code/game/objects/items/item.dm | 27 ++++++++++++++----- .../mob/living/carbon/human/human_defense.dm | 2 +- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/code/game/objects/items/item.dm b/code/game/objects/items/item.dm index 621352351c4..c3f621de6b0 100755 --- a/code/game/objects/items/item.dm +++ b/code/game/objects/items/item.dm @@ -259,6 +259,26 @@ mob/proc/flash_weak_pain() user.lastattacked = M M.lastattacker = user + var/power = src.force + + // EXPERIMENTAL: scale power and time to the weight class + if(w_class >= 4.0 && !istype(src,/obj/item/weapon/melee/energy/blade)) // eswords are an exception, they only have a w_class of 4 to not fit into pockets + power = power * 2.5 + + user.visible_message("\red [user.name] swings at [M.name] with \the [src]!") + user.next_move = max(user.next_move, world.time + 30) + + // if the mob didn't move, he has a 100% chance to hit(given the enemy also didn't move) + // otherwise, the chance to hit is lower + var/unmoved = 0 + spawn + unmoved = do_after(user, 4) + sleep(4) + if( (!unmoved && !prob(70)) || get_dist(user, M) != 1) + user.visible_message("\red [user.name] misses with \the [src]!") + return + + user.attack_log += "\[[time_stamp()]\] Attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])" M.attack_log += "\[[time_stamp()]\] Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])" log_admin("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].") @@ -268,13 +288,6 @@ mob/proc/flash_weak_pain() // M.lastattacker = null ///////////////////////// - var/power = src.force - - // EXPERIMENTAL: scale power and time to the weight class - if(w_class >= 4.0) - power = power * 2 - user.next_move = max(user.next_move, world.time + 20) - if(!istype(M, /mob/living/carbon/human)) if(istype(M, /mob/living/carbon/metroid)) var/mob/living/carbon/metroid/Metroid = M diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 3f43ffc3548..223c38582b3 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -107,7 +107,7 @@ emp_act apply_damage(, I.damtype, affecting, armor, is_cut(I), I.name) var/bloody = 0 - if((I.damtype == BRUTE) && prob(25 + (I.force * 2))) + if((I.damtype == BRUTE) && prob(25 + is_sharp(I) * 50 + (I.force * 2))) I.add_blood(src) bloody = 1 var/turf/location = loc From 6815be394cf5d692ecfdc33111922029d4e611b7 Mon Sep 17 00:00:00 2001 From: cib Date: Fri, 23 Mar 2012 04:10:04 -0800 Subject: [PATCH 2/3] Skill system updates. --- code/modules/mob/new_player/preferences.dm | 55 +++++++++++++--------- code/modules/mob/new_player/skill.dm | 4 ++ 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index f3c1755db16..7ba2728e5c4 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -133,39 +133,48 @@ datum/preferences proc/CalculateSkillPoints() used_skillpoints = 0 for(var/V in SKILLS) for(var/datum/skill/S in SKILLS[V]) - var/multiplier = 2 - if(skill_specialization == S.field || S.field == "Misc") - multiplier = 1 + var/multiplier = 1 switch(skills[S.ID]) if(SKILL_NONE) used_skillpoints += 0 * multiplier if(SKILL_BASIC) used_skillpoints += 1 * multiplier if(SKILL_ADEPT) - used_skillpoints += 3 * multiplier + // secondary skills cost less + if(S.secondary) + used_skillpoints += 1 * multiplier + else + used_skillpoints += 3 * multiplier if(SKILL_EXPERT) - used_skillpoints += 8 * multiplier + // secondary skills cost less + if(S.secondary) + used_skillpoints += 3 * multiplier + else + used_skillpoints += 6 * multiplier proc/GetSkillClass(points) // skill classes describe how your character compares in total points + var/original_points = points + points -= min(round((age - 20) / 2.5), 4) // every 2.5 years after 20, one extra skillpoint + if(age > 30) + points -= round((age - 30) / 5) // every 5 years after 30, one extra skillpoint + if(original_points > 0 && points <= 0) points = 1 switch(points) if(0) return "Unconfigured" - if(1 to 3) - return "Talentless" - if(3 to 6) + if(1 to 2) + return "Terrifying" + if(4 to 6) return "Below Average" if(7 to 10) return "Average" - if(11 to 12) - return "Talented" - if(13 to 15) - return "Extremely Talented" - if(16 to 18) + if(11 to 14) + return "Above Average" + if(15 to 18) + return "Exceptional" + if(19 to 24) return "Genius" - if(19 to 20) - return "True Genius" - if(21 to 1000) + if(24 to 1000) return "God" proc/SetSkills(mob/user) @@ -182,16 +191,20 @@ datum/preferences HTML += "Use preconfigured skillset
" HTML += "" for(var/V in SKILLS) - HTML += "" for(var/datum/skill/S in SKILLS[V]) var/level = skills[S.ID] HTML += "" HTML += "" - HTML += "" - HTML += "" - HTML += "" - HTML += "" + HTML += "" + // secondary skills don't have an amateur level + if(S.secondary) + HTML += "" + else + HTML += "" + HTML += "" + HTML += "" HTML += "" HTML += "
[V]" + HTML += "
[V]" HTML += "
[S.name]\[Layman\]\[Basic\]\[Adept\]\[Expert\]\[Untrained\]\[Amateur\]\[Trained\]\[Professional\]
" HTML += "\[Done\]" diff --git a/code/modules/mob/new_player/skill.dm b/code/modules/mob/new_player/skill.dm index fe9ba9cebc0..fe4d5c37987 100644 --- a/code/modules/mob/new_player/skill.dm +++ b/code/modules/mob/new_player/skill.dm @@ -9,6 +9,7 @@ datum/skill/var name = "None" // name of the skill desc = "Placeholder skill" // detailed description of the skill field = "Misc" // the field under which the skill will be listed + secondary = 0 // secondary skills only have two levels and cost significantly less var/global/list/SKILLS = null var/list/SKILL_ENGINEER = list("field" = "Engineering", "EVA" = SKILL_BASIC, "construction" = SKILL_ADEPT, "electrical" = SKILL_BASIC, "engines" = SKILL_ADEPT) @@ -39,6 +40,7 @@ datum/skill/EVA name = "Extra-vehicular activity" desc = "This skill describes your skill and knowledge of space-suits and working in vacuum." field = "Engineering" + secondary = 1 datum/skill/forensics ID = "forensics" @@ -62,6 +64,7 @@ datum/skill/knowledge/law name = "NanoTrasen Law" desc = "Your knowledge of NanoTrasen law and procedures. This includes space law, as well as general station rulings and procedures. A low level in this skill is typical for security officers, a high level in this skill is typical for captains." field = "Security" + secondary = 1 datum/skill/devices ID = "devices" @@ -86,6 +89,7 @@ datum/skill/engines name = "Engines" desc = "Describes your knowledge of the various engine types common on space stations, such as the singularity or anti-matter engine." field = "Engineering" + secondary = 1 datum/skill/computer ID = "computer" From a55fe842844823a0e263644559b8d617aa41d237 Mon Sep 17 00:00:00 2001 From: cib Date: Sat, 24 Mar 2012 16:54:35 -0800 Subject: [PATCH 3/3] Bugfix: Damage was broke --- code/modules/mob/living/carbon/human/human_defense.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 223c38582b3..ff2ebe92727 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -104,7 +104,7 @@ emp_act var/power = I.force if(I.w_class >= 4) power *= 2 - apply_damage(, I.damtype, affecting, armor, is_cut(I), I.name) + apply_damage(power, I.damtype, affecting, armor, is_cut(I), I.name) var/bloody = 0 if((I.damtype == BRUTE) && prob(25 + is_sharp(I) * 50 + (I.force * 2)))