Merge branch 'master' into shields!

This commit is contained in:
Trilbyspaceclone
2020-04-17 19:32:39 -04:00
committed by GitHub
246 changed files with 32323 additions and 33448 deletions
@@ -37,7 +37,7 @@
if(ishuman(source_mob))
var/mob/living/carbon/human/H = source_mob
if(H.dna.species.use_skintones)
body_coloring = "#[skintone2hex(H.skin_tone)]"
body_coloring = SKINTONE2HEX(H.skin_tone)
else
body_coloring = "#[H.dna.features["mcolor"]]"
@@ -49,7 +49,7 @@
H.set_species(gib_mob_species)
dna_to_add = temp_mob.get_blood_dna_list()
if(H.dna.species.use_skintones)
body_coloring = "#[skintone2hex(H.skin_tone)]"
body_coloring = SKINTONE2HEX(H.skin_tone)
else
body_coloring = "#[H.dna.features["mcolor"]]"
else
+99 -1
View File
@@ -264,7 +264,6 @@
LAZYSET(loot, M, our_chance)
return ..()
// Tech storage circuit board spawners
// For these, make sure that lootcount equals the number of list items
@@ -526,6 +525,105 @@
/obj/item/clothing/shoes/sneakers/noslip = 10
)
/obj/effect/spawner/lootdrop/low_tools
name = "random basic tool(s) spawner"
lootcount = 1
loot = list(
/obj/item/screwdriver = 1,
/obj/item/wrench = 1,
/obj/item/weldingtool/mini = 1,
/obj/item/crowbar = 1,
/obj/item/wirecutters = 1,
/obj/item/analyzer = 1,
/obj/item/t_scanner = 1
)
/obj/effect/spawner/lootdrop/high_tools
name = "random adv tool(s) spawner"
lootcount = 1
loot = list(
/obj/item/screwdriver/power = 1,
/obj/item/weldingtool/experimental = 1,
/obj/item/crowbar/power = 1,
/obj/item/analyzer = 1,
/obj/item/multitool = 1
)
/obj/effect/spawner/lootdrop/welder_tools
name = "random safe welder tool(s) spawner"
lootcount = 1
loot = list(
/obj/item/weldingtool = 1,
/obj/item/weldingtool/mini = 1,
/obj/item/weldingtool/hugetank = 1,
/obj/item/weldingtool/largetank = 1
)
/obj/effect/spawner/lootdrop/tool_box
name = "random safe tool box(es) spawner"
lootcount = 1
loot = list(
/obj/item/storage/toolbox/mechanical = 1,
/obj/item/storage/toolbox/mechanical/old = 1,
/obj/item/storage/toolbox/emergency = 1,
/obj/item/storage/toolbox/emergency/old = 1,
/obj/item/storage/toolbox/electrical = 1,
/obj/item/storage/toolbox/syndicate = 1,
/obj/item/storage/toolbox/artistic = 1,
/obj/item/storage/toolbox/gold_fake = 1,
/obj/item/storage/toolbox/rubber = 1
)
/obj/effect/spawner/lootdrop/healing_kits
name = "random safe medical kit(s) spawner"
lootcount = 1
loot = list(
/obj/item/storage/firstaid/regular = 1,
/obj/item/storage/firstaid/ancient = 1,
/obj/item/storage/firstaid/fire = 1,
/obj/item/storage/firstaid/toxin = 1,
/obj/item/storage/firstaid/radbgone = 1,
/obj/item/storage/firstaid/o2 = 1,
/obj/item/storage/firstaid/brute = 1
)
/obj/effect/spawner/lootdrop/breathing_tanks
name = "random internal tank(s) spawner"
lootcount = 1
loot = list(
/obj/item/tank/internals/oxygen = 1,
/obj/item/tank/internals/oxygen/yellow = 1,
/obj/item/tank/internals/oxygen/red = 1,
/obj/item/tank/internals/air = 1,
/obj/item/tank/internals/plasmaman = 1,
/obj/item/tank/internals/plasmaman/belt = 1,
/obj/item/tank/internals/emergency_oxygen = 1,
/obj/item/tank/internals/emergency_oxygen/engi = 1,
/obj/item/tank/internals/emergency_oxygen/double = 1
)
/obj/effect/spawner/lootdrop/breathing_masks
name = "random internal mask(s) spawner"
lootcount = 1
loot = list(
/obj/item/clothing/mask/gas = 2,
/obj/item/clothing/mask/gas/glass = 4,
/obj/item/clothing/mask/breath = 5,
/obj/item/clothing/mask/breath/medical = 1
)
/obj/effect/spawner/lootdrop/welder_tools/no_turf
spawn_on_turf = FALSE
/obj/effect/spawner/lootdrop/low_tools/no_turf
spawn_on_turf = FALSE
/obj/effect/spawner/lootdrop/breathing_tanks/no_turf
spawn_on_turf = FALSE
/obj/effect/spawner/lootdrop/breathing_masks/no_turf
spawn_on_turf = FALSE
/obj/effect/spawner/lootdrop/coin/no_turf
spawn_on_turf = FALSE
+4 -1
View File
@@ -19,9 +19,12 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
///Icon file for mob worn overlays.
///no var for state because it should *always* be the same as icon_state
var/icon/mob_overlay_icon
//Forced mob worn layer instead of the standard preferred ssize.
//Forced mob worn layer instead of the standard preferred size.
var/alternate_worn_layer
var/icon/anthro_mob_worn_overlay //Version of the above dedicated to muzzles/digitigrade
var/icon/taur_mob_worn_overlay // Idem but for taurs. Currently only used by suits.
var/list/alternate_screams = list() //REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
//Dimensions of the icon file used when this item is worn, eg: hats.dmi
@@ -244,7 +244,7 @@
/obj/machinery/vending/autodrobe = "AutoDrobe",
/obj/machinery/vending/assist = "\improper Vendomat",
/obj/machinery/vending/engivend = "\improper Engi-Vend",
/obj/machinery/vending/engivend = "\improper YouTool",
/obj/machinery/vending/tool = "\improper YouTool",
/obj/machinery/vending/sustenance = "\improper Sustenance Vendor",
/obj/machinery/vending/dinnerware = "\improper Plasteel Chef's Dinnerware Vendor",
/obj/machinery/vending/cart = "\improper PTech",
+1
View File
@@ -187,6 +187,7 @@
body_parts_covered = CHEST|GROIN|LEGS|ARMS
allowed = list(/obj/item/storage/book/bible, HOLY_WEAPONS, /obj/item/reagent_containers/food/drinks/bottle/holywater, /obj/item/storage/fancy/candle_box, /obj/item/candle, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman)
hoodtype = /obj/item/clothing/head/hooded/chaplain_hood
mutantrace_variation = STYLE_DIGITIGRADE|STYLE_NO_ANTHRO_ICON
/obj/item/clothing/head/hooded/chaplain_hood
name = "follower hood"
+1
View File
@@ -189,6 +189,7 @@
slowdown = 2.0 //gotta pretend we're balanced.
body_parts_covered = CHEST|GROIN|LEGS|FEET|ARMS|HANDS
armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 40, "bomb" = 60, "bio" = 0, "rad" = 0, "fire" = 60, "acid" = 60)
mutantrace_variation = STYLE_DIGITIGRADE|STYLE_NO_ANTHRO_ICON
/obj/item/clothing/suit/armor/plate/crusader/red
icon_state = "crusader-red"
+148 -7
View File
@@ -3,11 +3,151 @@
icon = 'icons/obj/shields.dmi'
block_chance = 50
armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 70)
var/transparent = FALSE // makes beam projectiles pass through the shield
/// Shield flags
var/shield_flags = SHIELD_FLAGS_DEFAULT
/// Last shieldbash world.time
var/last_shieldbash = 0
/// Shieldbashing cooldown
var/shieldbash_cooldown = 5 SECONDS
/// Shieldbashing stamina cost
var/shieldbash_stamcost = 7.5
/// Shieldbashing knockback
var/shieldbash_knockback = 2
/// Shield bashing brute damage
var/shieldbash_brutedamage = 5
/// Shield bashing stamina damage
var/shieldbash_stamdmg = 15
/// Shield bashing stagger duration
var/shieldbash_stagger_duration = 3.5 SECONDS
/// Shield bashing push distance
var/shieldbash_push_distance = 1
/obj/item/shield/examine(mob/user)
. = ..()
if(shield_flags & SHIELD_CAN_BASH)
. += "<span class='notice'>Right click on combat mode attack with [src] to shield bash!</span>"
if(shield_flags & SHIELD_BASH_GROUND_SLAM)
. += "<span class='notice'>Directly rightclicking on a downed target with [src] will slam them instead of bashing.</span>"
/obj/item/shield/proc/on_shield_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance)
return TRUE
/obj/item/shield/alt_pre_attack(atom/A, mob/living/user, params)
user_shieldbash(user, A, user.a_intent != INTENT_HARM)
return TRUE
/obj/item/shield/altafterattack(atom/target, mob/user, proximity_flag, click_parameters)
user_shieldbash(user, target, user.a_intent != INTENT_HARM)
return TRUE
/obj/item/shield/proc/do_shieldbash_effect(mob/living/user, dir, harmful)
var/px = 0
var/py = 0
switch(dir)
if(NORTH)
py = 12
if(SOUTH)
py = -12
if(EAST)
px = 12
if(WEST)
px = -12
var/oldpx = user.pixel_x
var/oldpy = user.pixel_y
animate(user, pixel_x = px, pixel_y = py, time = 3, easing = SINE_EASING | EASE_OUT, flags = ANIMATION_END_NOW)
animate(user, pixel_x = oldpx, pixel_y = oldpy, time = 3)
user.visible_message("<span class='warning'>[user] [harmful? "charges forwards with" : "sweeps"] [src]!</span>")
var/obj/effect/temp_visual/dir_setting/shield_bash/effect = new(user.loc, dir)
animate(effect, alpha = 0, pixel_x = px + 4, pixel_y = py + 4, time = 3)
/obj/item/shield/proc/bash_target(mob/living/user, mob/living/target, bashdir, harmful)
if(!(target.status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) // should probably add stun absorption check at some point I guess..
// unified stun absorption system when lol
target.visible_message("<span class='warning'>[user] slams [target] with [src], but [target] doesn't falter!</span>", "<span class='userdanger'>[user] slams you with [src], but it barely fazes you!</span>")
return FALSE
var/target_downed = !CHECK_MOBILITY(target, MOBILITY_STAND)
var/wallhit = FALSE
var/turf/target_current_turf = get_turf(target)
if(harmful)
target.visible_message("<span class='warning'>[target_downed? "[user] slams [src] into [target]" : "[user] bashes [target] with [src]"]!</span>",
"<span class='warning'>[target_downed? "[user] slams [src] into you" : "[user] bashes you with [src]"]!</span>")
else
target.visible_message("<span class='warning'>[user] shoves [target] with [src]!</span>",
"<span class='warning'>[user] shoves you with [src]!</span>")
for(var/i in 1 to harmful? shieldbash_knockback : shieldbash_push_distance)
var/turf/new_turf = get_step(target, bashdir)
var/mob/living/carbon/human/H = locate() in new_turf
if(H && harmful)
H.visible_message("<span class='warning'>[target] is sent crashing into [H]!</span>",
"<span class='userdanger'>[target] is sent crashing into you!</span>")
H.KnockToFloor()
wallhit = TRUE
break
else
step(target, bashdir)
if(get_turf(target) == target_current_turf)
wallhit = TRUE
break
else
target_current_turf = get_turf(target)
var/disarming = (target_downed && (shield_flags & SHIELD_BASH_GROUND_SLAM_DISARM)) || (shield_flags & SHIELD_BASH_ALWAYS_DISARM) || (wallhit && (shield_flags & SHIELD_BASH_WALL_DISARM))
var/knockdown = !target_downed && ((shield_flags & SHIELD_BASH_ALWAYS_KNOCKDOWN) || (wallhit && (shield_flags & SHIELD_BASH_WALL_KNOCKDOWN)))
if(shieldbash_stagger_duration || knockdown)
target.visible_message("<span class='warning'>[target] is knocked [knockdown? "to the floor" : "off balanace"]!</span>",
"<span class='userdanger'>You are knocked [knockdown? "to the floor" : "off balanace"]!</span>")
if(knockdown)
target.KnockToFloor(disarming)
else if(disarming)
target.drop_all_held_items()
if(harmful)
target.apply_damage(shieldbash_stamdmg, STAMINA, BODY_ZONE_CHEST)
target.apply_damage(shieldbash_brutedamage, BRUTE, BODY_ZONE_CHEST)
target.Stagger(shieldbash_stagger_duration)
return TRUE
/obj/item/shield/proc/user_shieldbash(mob/living/user, atom/target, harmful)
if(!(shield_flags & SHIELD_CAN_BASH))
to_chat(user, "<span class='warning'>[src] can't be used to shield bash!</span>")
return FALSE
if(world.time < last_shieldbash + shieldbash_cooldown)
to_chat(user, "<span class='warning'>You can't bash with [src] again so soon!</span>")
return FALSE
if(isliving(target)) //GROUND SLAAAM
if(!(shield_flags & SHIELD_BASH_GROUND_SLAM))
to_chat(user, "<span class='warning'>You can't ground slam with [src]!</span>")
return FALSE
bash_target(user, target, NONE, harmful)
user.do_attack_animation(target, used_item = src)
playsound(src, harmful? "swing_hit" : 'sound/weapons/thudswoosh.ogg', 75, 1)
last_shieldbash = world.time
user.adjustStaminaLossBuffered(shieldbash_stamcost)
return 1
// Directional sweep!
last_shieldbash = world.time
user.adjustStaminaLossBuffered(shieldbash_stamcost)
// Since we are in combat mode, we can probably safely use the user's dir instead of getting their mouse pointing cardinal dir.
var/bashdir = user.dir
do_shieldbash_effect(user, bashdir, harmful)
var/list/checking = list(get_step(user, user.dir), get_step(user, turn(user.dir, 45)), get_step(user, turn(user.dir, -45)))
var/list/victims = list()
for(var/i in checking)
var/turf/T = i
for(var/mob/living/L in T.contents)
victims += L
if(length(victims))
for(var/i in victims)
bash_target(user, i, bashdir, harmful)
playsound(src, harmful? "swing_hit" : 'sound/weapons/thudswoosh.ogg', 75, 1)
else
playsound(src, 'sound/weapons/punchmiss.ogg', 75, 1)
return length(victims)
/obj/effect/temp_visual/dir_setting/shield_bash
icon = 'icons/effects/96x96_attack_sweep.dmi'
icon_state = "shield_bash"
duration = 3
/obj/item/shield/riot
name = "riot shield"
desc = "A shield adept at blocking blunt objects from connecting with the torso of the shield wielder."
@@ -25,12 +165,13 @@
var/cooldown = 0 //shield bash cooldown. based on world.time
var/repair_material = /obj/item/stack/sheet/mineral/titanium
transparent = TRUE
shield_flags = SHIELD_FLAGS_DEFAULT | SHIELD_TRANSPARENT
max_integrity = 75
/obj/item/shield/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
if(ismovableatom(object))
var/atom/movable/AM = object
if(transparent && (AM.pass_flags & PASSGLASS))
if(CHECK_BITFIELD(shield_flags, SHIELD_TRANSPARENT) && (AM.pass_flags & PASSGLASS))
return BLOCK_NONE
if(attack_type & ATTACK_TYPE_THROWN)
final_block_chance += 30
@@ -90,7 +231,7 @@
item_state = "riot_laser"
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
transparent = FALSE
shield_flags = SHIELD_FLAGS_DEFAULT
max_integrity = 55 //Weak
obj/item/shield/riot/bullet_proof
@@ -106,8 +247,8 @@ obj/item/shield/riot/bullet_proof
item_state = "roman_shield"
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
transparent = FALSE
repair_material = /obj/item/stack/sheet/mineral/wood
shield_flags = SHIELD_FLAGS_DEFAULT
max_integrity = 65
/obj/item/shield/riot/roman/fake
@@ -131,7 +272,7 @@ obj/item/shield/riot/bullet_proof
resistance_flags = FLAMMABLE
repair_material = /obj/item/stack/sheet/mineral/wood
block_chance = 30
transparent = FALSE
shield_flags = SHIELD_FLAGS_DEFAULT
max_integrity = 55
/obj/item/shield/riot/buckler/shatter(mob/living/carbon/human/owner)
@@ -207,7 +348,7 @@ obj/item/shield/riot/bullet_proof
throwforce = 15 //Massive pice of metal
w_class = WEIGHT_CLASS_HUGE
item_flags = SLOWS_WHILE_IN_HAND
transparent = FALSE
shield_flags = SHIELD_FLAGS_DEFAULT
/obj/item/shield/riot/tower/swat
name = "swat shield"
@@ -223,7 +364,7 @@ obj/item/shield/riot/bullet_proof
icon = 'icons/obj/items_and_weapons.dmi'
block_chance = 30 //May be big but hard to move around to block.
slowdown = 1
transparent = FALSE
shield_flags = SHIELD_FLAGS_DEFAULT
item_flags = SLOWS_WHILE_IN_HAND
/obj/item/shield/riot/implant/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
+3 -3
View File
@@ -101,11 +101,11 @@
icon_state = "random_wallet"
/obj/item/storage/wallet/random/PopulateContents()
var/item1_type = pick( /obj/item/stack/spacecash/c10, /obj/item/stack/spacecash/c100, /obj/item/stack/spacecash/c1000, /obj/item/stack/spacecash/c20, /obj/item/stack/spacecash/c200, /obj/item/stack/spacecash/c50, /obj/item/stack/spacecash/c500)
var/item1_type = /obj/effect/spawner/lootdrop/space_cash/no_turf
var/item2_type
if(prob(50))
item2_type = pick( /obj/item/stack/spacecash/c10, /obj/item/stack/spacecash/c100, /obj/item/stack/spacecash/c1000, /obj/item/stack/spacecash/c20, /obj/item/stack/spacecash/c200, /obj/item/stack/spacecash/c50, /obj/item/stack/spacecash/c500)
var/item3_type = pick( /obj/item/coin/silver, /obj/item/coin/silver, /obj/item/coin/gold, /obj/item/coin/iron, /obj/item/coin/iron, /obj/item/coin/iron )
item2_type = /obj/effect/spawner/lootdrop/space_cash/no_turf
var/item3_type = /obj/effect/spawner/lootdrop/coin/no_turf
spawn(2)
if(item1_type)
@@ -26,7 +26,7 @@
if (prob(40))
new /obj/item/storage/toolbox/emergency(src)
switch (pickweight(list("small" = 40, "aid" = 25, "tank" = 20, "both" = 10, "nothing" = 5)))
switch (pickweight(list("small" = 35, "aid" = 25, "tank" = 20, "both" = 10, "nothing" = 5, "rng" = 5)))
if ("small")
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/tank/internals/emergency_oxygen(src)
@@ -49,6 +49,12 @@
if ("nothing")
// doot
if ("rng")
new /obj/effect/spawner/lootdrop/breathing_tanks/no_turf(src)
new /obj/effect/spawner/lootdrop/breathing_tanks/no_turf(src)
new /obj/effect/spawner/lootdrop/breathing_masks/no_turf(src)
new /obj/effect/spawner/lootdrop/breathing_masks/no_turf(src)
return
/*
@@ -100,13 +106,15 @@
if(prob(70))
new /obj/item/wrench(src)
if(prob(70))
new /obj/item/weldingtool(src)
new /obj/effect/spawner/lootdrop/welder_tools/no_turf(src)
if(prob(70))
new /obj/item/crowbar(src)
if(prob(70))
new /obj/item/wirecutters(src)
if(prob(70))
new /obj/item/t_scanner(src)
if(prob(70))
new /obj/effect/spawner/lootdrop/low_tools/no_turf(src) //Spare random basic tool
if(prob(20))
new /obj/item/storage/belt/utility(src)
if(prob(30))
+17 -4
View File
@@ -158,11 +158,24 @@
H.set_species(newrace, icon_update=0)
if(H.dna.species.use_skintones)
var/new_s_tone = input(user, "Choose your skin tone:", "Race change") as null|anything in GLOB.skin_tones
var/list/choices = GLOB.skin_tones
if(CONFIG_GET(number/allow_custom_skintones))
choices += "custom"
var/new_s_tone = input(H, "Choose your skin tone:", "Race change") as null|anything in choices
if(new_s_tone)
H.skin_tone = new_s_tone
H.dna.update_ui_block(DNA_SKIN_TONE_BLOCK)
if(new_s_tone == "custom")
var/default = H.dna.skin_tone_override || null
var/custom_tone = input(user, "Choose your custom skin tone:", "Race change", default) as color|null
if(custom_tone)
var/temp_hsv = RGBtoHSV(new_s_tone)
if(ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3])
to_chat(H,"<span class='danger'>Invalid color. Your color is not bright enough.</span>")
else
H.skin_tone = custom_tone
H.dna.skin_tone_override = custom_tone
else
H.skin_tone = new_s_tone
H.dna.update_ui_block(DNA_SKIN_TONE_BLOCK)
if(MUTCOLORS in H.dna.species.species_traits)
var/new_mutantcolor = input(user, "Choose your skin color:", "Race change","#"+H.dna.features["mcolor"]) as color|null