Highlander/Bomberman honor overhaul. (#15629)

* Highlander/Bomberman honor overhaul.

* Refactor to use a global is_honorable() proc.
This commit is contained in:
Rob Nelson
2017-08-15 14:37:36 -07:00
committed by Intigracy
parent e3ff511a56
commit 8a7871cfc8
11 changed files with 123 additions and 17 deletions

View File

@@ -1483,6 +1483,12 @@ var/proccalls = 1
#define EVENT_PROC_INDEX "p" #define EVENT_PROC_INDEX "p"
#define HIGHLANDER "highlander" #define HIGHLANDER "highlander"
#define BOMBERMAN "bomberman"
// /proc/is_honorable() flags.
#define HONORABLE_BOMBERMAN 1
#define HONORABLE_HIGHLANDER 2
#define HONORABLE_ALL HONORABLE_BOMBERMAN|HONORABLE_HIGHLANDER
#define SPELL_ANIMATION_TTL 2 MINUTES #define SPELL_ANIMATION_TTL 2 MINUTES

View File

@@ -515,3 +515,4 @@
var/list/randomhexes = list("7","8","9","a","b","c","d","e","f",) var/list/randomhexes = list("7","8","9","a","b","c","d","e","f",)
M.color = "#[pick(randomhexes)][pick(randomhexes)][pick(randomhexes)][pick(randomhexes)][pick(randomhexes)][pick(randomhexes)]" M.color = "#[pick(randomhexes)][pick(randomhexes)][pick(randomhexes)][pick(randomhexes)][pick(randomhexes)][pick(randomhexes)]"
M.name = "Bomberman #[rand(1,999)]" M.name = "Bomberman #[rand(1,999)]"
M.mind.special_role = BOMBERMAN // NEEDED FOR CHEAT CHECKS!

View File

@@ -1,4 +1,5 @@
var/global/list/reagents_to_log = list(FUEL, PLASMA, PACID, SACID, AMUTATIONTOXIN, MINDBREAKER, SPIRITBREAKER, CYANIDE, IMPEDREZENE, LUBE) var/global/list/reagents_to_log = list(FUEL, PLASMA, PACID, SACID, AMUTATIONTOXIN, MINDBREAKER, SPIRITBREAKER, CYANIDE, IMPEDREZENE, LUBE)
/obj /obj
var/origin_tech = null //Used by R&D to determine what research bonuses it grants. var/origin_tech = null //Used by R&D to determine what research bonuses it grants.
var/reliability = 100 //Used by SOME devices to determine how reliable they are. var/reliability = 100 //Used by SOME devices to determine how reliable they are.

View File

@@ -3322,6 +3322,7 @@
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/bomberman(M), slot_wear_suit) M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/bomberman(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/bomberman/(M), slot_s_store) M.equip_to_slot_or_del(new /obj/item/weapon/bomberman/(M), slot_s_store)
M.update_icons() M.update_icons()
M.mind.special_role = BOMBERMAN // CHEAT CHECKS
to_chat(M, "Wait...what?") to_chat(M, "Wait...what?")
spawn(50) spawn(50)
to_chat(M, "<span class='notice'>Tip: Use the BBD in your suit's pocket to place bombs.</span>") to_chat(M, "<span class='notice'>Tip: Use the BBD in your suit's pocket to place bombs.</span>")

View File

@@ -100,9 +100,12 @@
var/mob/living/carbon/human/H = ..(M) var/mob/living/carbon/human/H = ..(M)
ticker.mode.traitors += H.mind ticker.mode.traitors += H.mind
H.mind.special_role = HIGHLANDER H.mind.special_role = HIGHLANDER // NEEDED FOR CHEAT CHECKS!
H.mutations.Add(M_HULK) //all highlanders are permahulks H.mutations.Add(M_HULK) //all highlanders are permahulks
H.set_species("Human", force_organs=TRUE) // No Dionae
H.a_intent = I_HURT
H.update_mutations() H.update_mutations()
H.update_body() H.update_body()
@@ -152,7 +155,7 @@
H.equip_to_slot_or_del(W, slot_wear_id) H.equip_to_slot_or_del(W, slot_wear_id)
return H return H
//MAGIC MISSILE //MAGIC MISSILE
/datum/only_one/wizardwars /datum/only_one/wizardwars

View File

@@ -1008,6 +1008,7 @@ var/global/list/arena_spawnpoints = list()//used by /mob/dead/observer/Logout()
B.destroy_environnement = 0 B.destroy_environnement = 0
M.equip_to_slot_or_del(B, slot_s_store) M.equip_to_slot_or_del(B, slot_s_store)
bombsuit.slowdown = HARDSUIT_SLOWDOWN_LOW bombsuit.slowdown = HARDSUIT_SLOWDOWN_LOW
M.mind.special_role = BOMBERMAN
for(var/obj/item/clothing/C in M) for(var/obj/item/clothing/C in M)
C.canremove = 0 C.canremove = 0
if(violence) if(violence)

View File

@@ -173,6 +173,43 @@
// log_debug("No gloves, [M] is truing to infect [src]") // log_debug("No gloves, [M] is truing to infect [src]")
spread_disease_to(M, src, "Contact") spread_disease_to(M, src, "Contact")
// CHEATER CHECKS
if(M.mind)
var/punishment = FALSE
var/bad_behavior = FALSE
if(M.mind.special_role == HIGHLANDER)
switch(M.a_intent)
if(I_DISARM)
bad_behavior = "disarm"
//if(I_HURT)
// bad_behavior = "punch/kick"
//if(I_GRAB)
// bad_behavior = "grab"
if(bad_behavior)
// In case we change our minds later...
//M.set_species("Tajaran")
//M.Cluwneize()
for(var/datum/organ/external/arm in M.organs)
if(istype(arm, /datum/organ/external/r_arm) || istype(arm, /datum/organ/external/l_arm))
arm.droplimb(1)
M.emote("scream", auto=TRUE)
visible_message("<span class='sinister'>[M] tried to [bad_behavior] [src]! [ticker.Bible_deity_name] has frowned upon the disgrace!</span>")
punishment = "disarmed"
if(M.mind.special_role == BOMBERMAN)
switch(M.a_intent)
if(I_DISARM)
bad_behavior = "disarm"
//if(I_HURT)
// bad_behavior = "punch/kick"
//if(I_GRAB)
// bad_behavior = "grab"
if(bad_behavior)
M.gib()
visible_message("<span class='sinister'>[M] tried to [bad_behavior] [src]! DISQUALIFIED!</span>")
punishment = "gibbed"
if(punishment)
message_admins("[M] tried to disarm [src] as a [M.mind.special_role] and was [punishment].")
return
switch(M.a_intent) switch(M.a_intent)
if(I_HELP) if(I_HELP)

View File

@@ -28,16 +28,16 @@
mob/proc/isincrit() mob/proc/isincrit()
return 0 return 0
mob/proc/get_heart() mob/proc/get_heart()
return null return null
mob/proc/remove_internal_organ() mob/proc/remove_internal_organ()
return null return null
/mob/proc/get_broken_organs() /mob/proc/get_broken_organs()
return list() return list()
/mob/proc/get_bleeding_organs() /mob/proc/get_bleeding_organs()
return list() return list()
@@ -508,4 +508,18 @@ proc/is_blind(A)
M.show_message("<span class='info'>[bicon(I)] [message]</span>", 1) M.show_message("<span class='info'>[bicon(I)] [message]</span>", 1)
/mob/proc/get_survive_objective() /mob/proc/get_survive_objective()
return new /datum/objective/survive return new /datum/objective/survive
/**
* Honor check
* Returns TRUE if user is BOMBERMAN, HIGHLANDER...
* Respects honorable.
*/
/proc/is_honorable(var/mob/living/user, var/honorable = HONORABLE_ALL)
if(istype(user))
if(user.mind)
if(user.mind.special_role == BOMBERMAN && (honorable & HONORABLE_BOMBERMAN))
return TRUE
if(user.mind.special_role == HIGHLANDER && (honorable & HONORABLE_HIGHLANDER))
return TRUE
return FALSE

View File

@@ -31,6 +31,7 @@
var/ejectshell = 1 var/ejectshell = 1
var/clumsy_check = 1 //Whether the gun disallows clumsy users from firing it. var/clumsy_check = 1 //Whether the gun disallows clumsy users from firing it.
var/honor_check = 1 // Same, but highlanders and bombermen.
var/advanced_tool_user_check = 1 //Whether the gun disallows users that cannot use advanced tools from firing it. var/advanced_tool_user_check = 1 //Whether the gun disallows users that cannot use advanced tools from firing it.
var/MoMMI_check = 1 //Whether the gun disallows MoMMIs from firing it. var/MoMMI_check = 1 //Whether the gun disallows MoMMIs from firing it.
var/nymph_check = 1 //Whether the gun disallows diona nymphs from firing it. var/nymph_check = 1 //Whether the gun disallows diona nymphs from firing it.
@@ -55,6 +56,9 @@
var/pai_safety = TRUE //To allow the pAI to activate or deactivate firing capability var/pai_safety = TRUE //To allow the pAI to activate or deactivate firing capability
// Tells is_honorable() which special_roles to respect.
var/honorable = HONORABLE_BOMBERMAN | HONORABLE_HIGHLANDER
/obj/item/weapon/gun/proc/ready_to_fire() /obj/item/weapon/gun/proc/ready_to_fire()
if(world.time >= last_fired + fire_delay) if(world.time >= last_fired + fire_delay)
last_fired = world.time last_fired = world.time
@@ -76,8 +80,8 @@
O.emp_act(severity) O.emp_act(severity)
/obj/item/weapon/gun/proc/can_discharge() //because process_chambered() is an atrocity /obj/item/weapon/gun/proc/can_discharge() //because process_chambered() is an atrocity
return 0 return 0
/obj/item/weapon/gun/afterattack(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params, struggle = 0) /obj/item/weapon/gun/afterattack(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params, struggle = 0)
if(flag) if(flag)
return //we're placing gun on a table or in backpack return //we're placing gun on a table or in backpack
@@ -134,15 +138,27 @@
/obj/item/weapon/gun/proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0, struggle = 0, var/use_shooter_turf = FALSE)//TODO: go over this /obj/item/weapon/gun/proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0, struggle = 0, var/use_shooter_turf = FALSE)//TODO: go over this
//Exclude lasertag guns from the M_CLUMSY check. //Exclude lasertag guns from the M_CLUMSY check.
if(clumsy_check) var/explode = FALSE
if(istype(user, /mob/living)) var/dehand = FALSE
var/mob/living/M = user if(istype(user, /mob/living))
if (clumsy_check(M) && prob(50)) var/mob/living/M = user
if(clumsy_check && clumsy_check(M) && prob(50))
explode = TRUE
if(honor_check && is_honorable(M, honorable))
explode = TRUE
dehand = TRUE
if(explode)
if(dehand)
var/limb_index = user.is_holding_item(src)
var/datum/organ/external/L = M.find_organ_by_grasp_index(limb_index)
visible_message("<span class='sinister'>[src] blows up in [M]'s [L.display_name]!</span>")
L.droplimb(1)
else
to_chat(M, "<span class='danger'>[src] blows up in your face.</span>") to_chat(M, "<span class='danger'>[src] blows up in your face.</span>")
M.take_organ_damage(0,20) M.take_organ_damage(0,20)
M.drop_item(src, force_drop = 1) M.drop_item(src, force_drop = 1)
qdel(src) qdel(src)
return return
if(!can_Fire(user, 1)) if(!can_Fire(user, 1))
return return

View File

@@ -5,6 +5,9 @@
#define REAGENTS_OVERDOSE 30 #define REAGENTS_OVERDOSE 30
#define REM REAGENTS_EFFECT_MULTIPLIER #define REM REAGENTS_EFFECT_MULTIPLIER
// Use in chem.flags.
#define CHEMFLAG_DISHONORABLE 1
//The reaction procs must ALWAYS set src = null, this detaches the proc from the object (the reagent) //The reaction procs must ALWAYS set src = null, this detaches the proc from the object (the reagent)
//so that it can continue working when the reagent is deleted while the proc is still active. //so that it can continue working when the reagent is deleted while the proc is still active.
@@ -33,6 +36,7 @@
var/color = "#000000" //rgb: 0, 0, 0 (does not support alpha channels - yet!) var/color = "#000000" //rgb: 0, 0, 0 (does not support alpha channels - yet!)
var/alpha = 255 var/alpha = 255
var/dupeable = TRUE //whether the reagent can be duplicated by standard reagent duplication methods such as a service borg shaker or odysseus var/dupeable = TRUE //whether the reagent can be duplicated by standard reagent duplication methods such as a service borg shaker or odysseus
var/flags = 0
/datum/reagent/proc/reaction_mob(var/mob/living/M, var/method = TOUCH, var/volume) /datum/reagent/proc/reaction_mob(var/mob/living/M, var/method = TOUCH, var/volume)
set waitfor = 0 set waitfor = 0
@@ -123,6 +127,11 @@
M = holder.my_atom //Try to find the mob through the holder M = holder.my_atom //Try to find the mob through the holder
if(!istype(M)) //Still can't find it, abort if(!istype(M)) //Still can't find it, abort
return 1 return 1
if(M.mind)
if((M.mind.special_role == HIGHLANDER || M.mind.special_role == BOMBERMAN) && src.flags & CHEMFLAG_DISHONORABLE)
// TODO: HONORABLE_* checks.
return 1
if((overdose_am && volume >= overdose_am) || (overdose_tick && tick >= overdose_tick)) //Too much chems, or been in your system too long if((overdose_am && volume >= overdose_am) || (overdose_tick && tick >= overdose_tick)) //Too much chems, or been in your system too long
on_overdose(M) on_overdose(M)
@@ -606,6 +615,7 @@
reagent_state = LIQUID reagent_state = LIQUID
color = "#CF3600" //rgb: 207, 54, 0 color = "#CF3600" //rgb: 207, 54, 0
custom_metabolism = 0.4 custom_metabolism = 0.4
flags = CHEMFLAG_DISHONORABLE // NO CHEATING
/datum/reagent/cyanide/on_mob_life(var/mob/living/M) /datum/reagent/cyanide/on_mob_life(var/mob/living/M)
@@ -3062,9 +3072,9 @@
reagent_state = SOLID reagent_state = SOLID
color = "#000067" //rgb: 0, 0, 103 color = "#000067" //rgb: 0, 0, 103
data = 1 //Used as a tally data = 1 //Used as a tally
flags = CHEMFLAG_DISHONORABLE // NO CHEATING
/datum/reagent/chloralhydrate/on_mob_life(var/mob/living/M) /datum/reagent/chloralhydrate/on_mob_life(var/mob/living/M)
if(..()) if(..())
return 1 return 1
switch(data) switch(data)
@@ -6003,4 +6013,3 @@ var/global/list/tonio_doesnt_remove=list("tonio", "blood")
spawn(volume * 10) spawn(volume * 10)
O.light_color = init_color O.light_color = init_color
O.set_light(0) O.set_light(0)

View File

@@ -0,0 +1,17 @@
# Your name.
author: N3X15
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# There needs to be a space after the - and before the prefix. Don't use tabs anywhere in this file.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# If you're using characters such as # ' : - or the like in your changelog, surround the entire change with quotes as shown in the second example. These quotes don't show up on the changelog once it's merged and prevent errors.
# SCREW ANY OF THIS UP AND IT WON'T WORK.
changes:
- rscadd: Trying to disarm someone as highlander will result in YOU being disarmed.
- rscadd: Trying to disarm someone as bomberman will result in being disqualified.
- rscadd: All humans are changed to the default human race during highlander.
- rscadd: Chemicals can be marked DISHONORABLE to just not work on particular special roles like highlander. This currently includes chloral and cyanide.
- rscadd: Guns with honor_check will blow up if a highlander or bomberman tries to use them, taking their active hand with them.