diff --git a/code/modules/goonchat/browserassets/js/browserOutput.js b/code/modules/goonchat/browserassets/js/browserOutput.js
index 2ef7704625..43092846c2 100644
--- a/code/modules/goonchat/browserassets/js/browserOutput.js
+++ b/code/modules/goonchat/browserassets/js/browserOutput.js
@@ -22,7 +22,7 @@ window.onerror = function(msg, url, line, col, error) {
//Globals
window.status = 'Output';
-var $messages, $subOptions, $subAudio, $selectedSub, $contextMenu, $filterMessages;
+var $messages, $subOptions, $subAudio, $selectedSub, $contextMenu, $filterMessages, $last_message;
var opts = {
//General
'messageCount': 0, //A count...of messages...
@@ -68,6 +68,8 @@ var opts = {
'defaultMusicVolume': 25,
+ 'messageCombining': true,
+
};
function clamp(val, min, max) {
@@ -294,27 +296,54 @@ function output(message, flag) {
opts.messageCount--; //I guess the count should only ever equal the limit
}
- //Actually append the message
- var entry = document.createElement('div');
- entry.className = 'entry';
-
- if (filteredOut) {
- entry.className += ' hidden';
- entry.setAttribute('data-filter', filteredOut);
+ var handled = false;
+ var trimmed_message = message.trim()
+ var lastmessages = $messages.children('div.entry:last-child');
+ if (opts.messageCombining && lastmessages.length && $last_message)
+ {
+ if($last_message == trimmed_message)
+ {
+ if(lastmessages.children('span.r').length)
+ {
+ var current_value = parseInt(lastmessages.children('span.r').text())
+ lastmessages.children('span.r').text(current_value+1)
+ }
+ else
+ {
+ lastmessages.append($('
', { 'class': 'r', 'text': 2}));
+ }
+ if(parseInt(lastmessages.css("font-size")) < 24) //Completely arbitrary max size
+ lastmessages.css("font-size","+=2")
+ opts.messageCount--;
+ handled = true;
+ }
+ }
+
+ if(!handled)
+ {
+ //Actually append the message
+ var entry = document.createElement('div');
+ entry.className = 'entry';
+
+ if (filteredOut) {
+ entry.className += ' hidden';
+ entry.setAttribute('data-filter', filteredOut);
+ }
+
+ $last_message = trimmed_message;
+ entry.innerHTML = trimmed_message;
+ $messages[0].appendChild(entry);
+ $(entry).find("img.icon").error(iconError);
+ //Actually do the snap
+ //Stuff we can do after the message shows can go here, in the interests of responsiveness
+ if (opts.highlightTerms && opts.highlightTerms.length > 0) {
+ highlightTerms(entry);
+ }
}
- entry.innerHTML = message.trim();
- $messages[0].appendChild(entry);
- $(entry).find("img.icon").error(iconError);
- //Actually do the snap
if (!filteredOut && atBottom) {
$('body,html').scrollTop($messages.outerHeight());
}
-
- //Stuff we can do after the message shows can go here, in the interests of responsiveness
- if (opts.highlightTerms && opts.highlightTerms.length > 0) {
- highlightTerms(entry);
- }
}
function internalOutput(message, flag)
@@ -568,6 +597,7 @@ $(function() {
'shighlightTerms': getCookie('highlightterms'),
'shighlightColor': getCookie('highlightcolor'),
'smusicVolume': getCookie('musicVolume'),
+ 'smessagecombining': getCookie('messagecombining'),
};
if (savedConfig.sfontSize) {
@@ -606,7 +636,15 @@ $(function() {
opts.updatedVolume = newVolume;
sendVolumeUpdate();
internalOutput('
Loaded music volume of: '+savedConfig.smusicVolume+'', 'internal');
- } else {
+ }
+ if (savedConfig.smessagecombining) {
+ if (savedConfig.smessagecombining == 'false') {
+ opts.messageCombining = false;
+ } else {
+ opts.messageCombining = true;
+ }
+ }
+ else {
$('#adminMusic').prop('volume', opts.defaultMusicVolume / 100);
}
@@ -922,6 +960,11 @@ $(function() {
}
});
+ $('#toggleCombine').click(function(e) {
+ opts.messageCombining = !opts.messageCombining;
+ setCookie('messagecombining', (opts.messageCombining ? 'true' : 'false'), 365);
+ });
+
$('img.icon').error(iconError);
diff --git a/code/modules/holiday/halloween.dm b/code/modules/holiday/halloween.dm
index f8716870e1..a27db8dd38 100644
--- a/code/modules/holiday/halloween.dm
+++ b/code/modules/holiday/halloween.dm
@@ -146,7 +146,7 @@
timer = rand(1,15)
/mob/living/simple_animal/shade/howling_ghost/proc/EtherealMove(direction)
- loc = get_step(src, direction)
+ forceMove(get_step(src, direction))
setDir(direction)
/mob/living/simple_animal/shade/howling_ghost/proc/roam()
@@ -220,7 +220,7 @@
timer = rand(5,15)
playsound(M.loc, pick('sound/spookoween/scary_horn.ogg','sound/spookoween/scary_horn2.ogg', 'sound/spookoween/scary_horn3.ogg'), 300, 1)
spawn(12)
- loc = M.loc
+ forceMove(M.loc)
/mob/living/simple_animal/hostile/retaliate/clown/insane/MoveToTarget()
stalk(target)
diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm
index 54384753d7..6a8a720366 100644
--- a/code/modules/holodeck/items.dm
+++ b/code/modules/holodeck/items.dm
@@ -113,7 +113,7 @@
if(user.grab_state < GRAB_AGGRESSIVE)
to_chat(user, "
You need a better grip to do that!")
return
- L.loc = src.loc
+ L.forceMove(loc)
L.Knockdown(100)
visible_message("
[user] dunks [L] into \the [src]!")
user.stop_pulling()
diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm
index 482a48edfd..d4269013f7 100644
--- a/code/modules/hydroponics/beekeeping/beebox.dm
+++ b/code/modules/hydroponics/beekeeping/beebox.dm
@@ -178,7 +178,7 @@
bees -= B
B.beehome = null
if(B.loc == src)
- B.loc = get_turf(src)
+ B.forceMove(drop_location())
relocated++
if(relocated)
to_chat(user, "
This queen has a different reagent to some of the bees who live here, those bees will not return to this apiary!")
@@ -201,7 +201,7 @@
if(B.isqueen)
continue
if(B.loc == src)
- B.loc = get_turf(src)
+ B.forceMove(drop_location())
B.target = user
bees = TRUE
if(bees)
@@ -221,7 +221,7 @@
var/obj/item/honey_frame/HF = pick_n_take(honey_frames)
if(HF)
if(!user.put_in_active_hand(HF))
- HF.loc = get_turf(src)
+ HF.forceMove(drop_location())
visible_message("
[user] removes a frame from the apiary.")
var/amtH = HF.honeycomb_capacity
@@ -229,7 +229,7 @@
while(honeycombs.len && amtH) //let's pretend you always grab the frame with the most honeycomb on it
var/obj/item/reagent_containers/honeycomb/HC = pick_n_take(honeycombs)
if(HC)
- HC.loc = get_turf(user)
+ HC.forceMove(drop_location())
amtH--
fallen++
if(fallen)
@@ -241,12 +241,12 @@
to_chat(user, "
There is no queen bee to remove!")
return
var/obj/item/queen_bee/QB = new()
- queen_bee.loc = QB
+ queen_bee.forceMove(QB)
bees -= queen_bee
QB.queen = queen_bee
QB.name = queen_bee.name
if(!user.put_in_active_hand(QB))
- QB.loc = get_turf(src)
+ QB.forceMove(drop_location())
visible_message("
[user] removes the queen from the apiary.")
queen_bee = null
@@ -254,8 +254,8 @@
new /obj/item/stack/sheet/mineral/wood (loc, 20)
for(var/mob/living/simple_animal/hostile/poison/bees/B in bees)
if(B.loc == src)
- B.loc = get_turf(src)
+ B.forceMove(drop_location())
for(var/obj/item/honey_frame/HF in honey_frames)
if(HF.loc == src)
- HF.loc = get_turf(src)
- qdel(src)
\ No newline at end of file
+ HF.forceMove(drop_location())
+ qdel(src)
diff --git a/code/modules/hydroponics/beekeeping/honeycomb.dm b/code/modules/hydroponics/beekeeping/honeycomb.dm
index 737736efc5..8b9d641eac 100644
--- a/code/modules/hydroponics/beekeeping/honeycomb.dm
+++ b/code/modules/hydroponics/beekeeping/honeycomb.dm
@@ -10,6 +10,7 @@
volume = 10
amount_per_transfer_from_this = 0
list_reagents = list("honey" = 5)
+ grind_results = list()
var/honey_color = ""
/obj/item/reagent_containers/honeycomb/New()
diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm
index 324a94128d..8939b60138 100644
--- a/code/modules/hydroponics/biogenerator.dm
+++ b/code/modules/hydroponics/biogenerator.dm
@@ -78,7 +78,7 @@
if(default_deconstruction_screwdriver(user, "biogen-empty-o", "biogen-empty", O))
if(beaker)
var/obj/item/reagent_containers/glass/B = beaker
- B.loc = loc
+ B.forceMove(drop_location())
beaker = null
update_icon()
return
diff --git a/code/modules/hydroponics/gene_modder.dm b/code/modules/hydroponics/gene_modder.dm
index bd0215138a..87c860b50e 100644
--- a/code/modules/hydroponics/gene_modder.dm
+++ b/code/modules/hydroponics/gene_modder.dm
@@ -42,7 +42,7 @@
for(var/obj/item/stock_parts/micro_laser/ML in component_parts)
var/wratemod = ML.rating * 2.5
- min_wrate = Floor(10-wratemod,1) // 7,5,2,0 Clamps at 0 and 10 You want this low
+ min_wrate = FLOOR(10-wratemod,1) // 7,5,2,0 Clamps at 0 and 10 You want this low
min_wchance = 67-(ML.rating*16) // 48,35,19,3 Clamps at 0 and 67 You want this low
for(var/obj/item/circuitboard/machine/plantgenes/vaultcheck in component_parts)
if(istype(vaultcheck, /obj/item/circuitboard/machine/plantgenes/vault)) // DUMB BOTANY TUTS
@@ -260,7 +260,7 @@
if(href_list["eject_seed"] && !operation)
if (seed)
- seed.loc = src.loc
+ seed.forceMove(drop_location())
seed.verb_pickup()
seed = null
update_genes()
@@ -275,7 +275,7 @@
update_icon()
else if(href_list["eject_disk"] && !operation)
if (disk)
- disk.loc = src.loc
+ disk.forceMove(drop_location())
disk.verb_pickup()
disk = null
update_genes()
@@ -368,7 +368,7 @@
/obj/machinery/plantgenes/proc/insert_seed(obj/item/seeds/S)
if(!istype(S) || seed)
return
- S.loc = src
+ S.forceMove(src)
seed = S
update_genes()
update_icon()
diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm
index d003f40d4a..15456c1e34 100644
--- a/code/modules/hydroponics/grown.dm
+++ b/code/modules/hydroponics/grown.dm
@@ -15,6 +15,7 @@
// Saves us from having to define each stupid grown's dried_type as itself.
// If you don't want a plant to be driable (watermelons) set this to null in the time definition.
resistance_flags = FLAMMABLE
+ var/dry_grind = FALSE //If TRUE, this object needs to be dry to be ground up
/obj/item/reagent_containers/food/snacks/grown/Initialize(mapload, obj/item/seeds/new_seed)
. = ..()
@@ -36,7 +37,7 @@
for(var/datum/plant_gene/trait/T in seed.genes)
T.on_new(src, loc)
seed.prepare_result(src)
- transform *= TransformUsingVariable(seed.potency, 100, 0.5) //Makes the resulting produce's sprite larger or smaller based on potency!
+ transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5 //Makes the resulting produce's sprite larger or smaller based on potency!
add_juice()
@@ -137,6 +138,28 @@
return
return ..()
+/obj/item/reagent_containers/food/snacks/grown/grind_requirements()
+ if(dry_grind && !dry)
+ to_chat(usr, "
[src] needs to be dry before it can be ground up!")
+ return
+ return TRUE
+
+/obj/item/reagent_containers/food/snacks/grown/on_grind()
+ var/nutriment = reagents.get_reagent_amount("nutriment")
+ if(grind_results.len)
+ for(var/i in 1 to grind_results.len)
+ grind_results[grind_results[i]] = nutriment
+ reagents.del_reagent("nutriment")
+ reagents.del_reagent("vitamin")
+
+/obj/item/reagent_containers/food/snacks/grown/on_juice()
+ var/nutriment = reagents.get_reagent_amount("nutriment")
+ if(juice_results.len)
+ for(var/i in 1 to juice_results.len)
+ juice_results[juice_results[i]] = nutriment
+ reagents.del_reagent("nutriment")
+ reagents.del_reagent("vitamin")
+
// For item-containing growns such as eggy or gatfruit
/obj/item/reagent_containers/food/snacks/grown/shell/attack_self(mob/user)
var/obj/item/T
diff --git a/code/modules/hydroponics/grown/apple.dm b/code/modules/hydroponics/grown/apple.dm
index 7ec9a730ed..8b35fee872 100644
--- a/code/modules/hydroponics/grown/apple.dm
+++ b/code/modules/hydroponics/grown/apple.dm
@@ -15,6 +15,7 @@
genes = list(/datum/plant_gene/trait/repeated_harvest)
mutatelist = list(/obj/item/seeds/apple/gold)
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
+ juice_results = list("applejuice" = 0)
/obj/item/reagent_containers/food/snacks/grown/apple
seed = /obj/item/seeds/apple
diff --git a/code/modules/hydroponics/grown/banana.dm b/code/modules/hydroponics/grown/banana.dm
index bf71856323..72517e87bc 100644
--- a/code/modules/hydroponics/grown/banana.dm
+++ b/code/modules/hydroponics/grown/banana.dm
@@ -13,6 +13,7 @@
genes = list(/datum/plant_gene/trait/slip, /datum/plant_gene/trait/repeated_harvest)
mutatelist = list(/obj/item/seeds/banana/mime, /obj/item/seeds/banana/bluespace)
reagents_add = list("banana" = 0.1, "potassium" = 0.1, "vitamin" = 0.04, "nutriment" = 0.02)
+ juice_results = list("banana" = 0)
/obj/item/reagent_containers/food/snacks/grown/banana
seed = /obj/item/seeds/banana
diff --git a/code/modules/hydroponics/grown/beans.dm b/code/modules/hydroponics/grown/beans.dm
index 8ca2a5961a..46a7e7979f 100644
--- a/code/modules/hydroponics/grown/beans.dm
+++ b/code/modules/hydroponics/grown/beans.dm
@@ -26,6 +26,7 @@
filling_color = "#F0E68C"
bitesize_mod = 2
foodtype = VEGETABLES
+ grind_results = list("soymilk" = 0)
// Koibean
/obj/item/seeds/soya/koi
diff --git a/code/modules/hydroponics/grown/berries.dm b/code/modules/hydroponics/grown/berries.dm
index 0d8c5d5a9a..541fb1b2a5 100644
--- a/code/modules/hydroponics/grown/berries.dm
+++ b/code/modules/hydroponics/grown/berries.dm
@@ -26,6 +26,7 @@
filling_color = "#FF00FF"
bitesize_mod = 2
foodtype = FRUIT
+ juice_results = list("berryjuice" = 0)
// Poison Berries
/obj/item/seeds/berry/poison
@@ -46,6 +47,7 @@
icon_state = "poisonberrypile"
filling_color = "#C71585"
foodtype = FRUIT | TOXIC
+ juice_results = list("poisonberryjuice" = 0)
// Death Berries
/obj/item/seeds/berry/death
@@ -121,6 +123,7 @@
filling_color = "#FF0000"
bitesize_mod = 2
foodtype = FRUIT
+ grind_results = list("cherryjelly" = 0)
// Blue Cherries
/obj/item/seeds/cherry/blue
@@ -142,6 +145,7 @@
filling_color = "#6495ED"
bitesize_mod = 2
foodtype = FRUIT
+ grind_results = list("bluecherryjelly" = 0)
// Grapes
/obj/item/seeds/grape
@@ -173,6 +177,7 @@
filling_color = "#FF1493"
bitesize_mod = 2
foodtype = FRUIT
+ juice_results = list("grapejuice" = 0)
// Green Grapes
/obj/item/seeds/grape/green
diff --git a/code/modules/hydroponics/grown/cereals.dm b/code/modules/hydroponics/grown/cereals.dm
index 7834ed15e8..d9b724d052 100644
--- a/code/modules/hydroponics/grown/cereals.dm
+++ b/code/modules/hydroponics/grown/cereals.dm
@@ -22,6 +22,7 @@
filling_color = "#F0E68C"
bitesize_mod = 2
foodtype = GRAIN
+ grind_results = list("flour" = 0)
// Oat
/obj/item/seeds/wheat/oat
@@ -42,6 +43,7 @@
filling_color = "#556B2F"
bitesize_mod = 2
foodtype = GRAIN
+ grind_results = list("flour" = 0)
// Rice
/obj/item/seeds/wheat/rice
@@ -63,6 +65,7 @@
filling_color = "#FAFAD2"
bitesize_mod = 2
foodtype = GRAIN
+ grind_results = list("rice" = 0)
//Meatwheat - grows into synthetic meat
/obj/item/seeds/wheat/meat
@@ -83,6 +86,7 @@
bitesize_mod = 2
seed = /obj/item/seeds/wheat/meat
foodtype = MEAT | GRAIN
+ grind_results = list("flour" = 0, "blood" = 0)
/obj/item/reagent_containers/food/snacks/grown/meatwheat/attack_self(mob/living/user)
user.visible_message("
[user] crushes [src] into meat.", "
You crush [src] into something that resembles meat.")
diff --git a/code/modules/hydroponics/grown/citrus.dm b/code/modules/hydroponics/grown/citrus.dm
index 1b0cdc00d2..38f8a40ec3 100644
--- a/code/modules/hydroponics/grown/citrus.dm
+++ b/code/modules/hydroponics/grown/citrus.dm
@@ -30,6 +30,7 @@
desc = "It's so sour, your face will twist."
icon_state = "lime"
filling_color = "#00FF00"
+ juice_results = list("limejuice" = 0)
// Orange
/obj/item/seeds/orange
@@ -56,6 +57,7 @@
desc = "It's a tangy fruit."
icon_state = "orange"
filling_color = "#FFA500"
+ juice_results = list("orangejuice" = 0)
// Lemon
/obj/item/seeds/lemon
@@ -81,6 +83,7 @@
desc = "When life gives you lemons, make lemonade."
icon_state = "lemon"
filling_color = "#FFD700"
+ juice_results = list("lemonjuice" = 0)
// Combustible lemon
/obj/item/seeds/firelemon //combustible lemon is too long so firelemon
diff --git a/code/modules/hydroponics/grown/corn.dm b/code/modules/hydroponics/grown/corn.dm
index 827deaea47..4454c3c52a 100644
--- a/code/modules/hydroponics/grown/corn.dm
+++ b/code/modules/hydroponics/grown/corn.dm
@@ -25,6 +25,7 @@
trash = /obj/item/grown/corncob
bitesize_mod = 2
foodtype = VEGETABLES
+ juice_results = list("corn_starch" = 0)
/obj/item/grown/corncob
name = "corn cob"
diff --git a/code/modules/hydroponics/grown/flowers.dm b/code/modules/hydroponics/grown/flowers.dm
index e0845ffb2a..18eae2f4fd 100644
--- a/code/modules/hydroponics/grown/flowers.dm
+++ b/code/modules/hydroponics/grown/flowers.dm
@@ -182,6 +182,7 @@
throw_speed = 1
throw_range = 3
attack_verb = list("roasted", "scorched", "burned")
+ grind_results = list("capsaicin" = 0, "condensedcapsaicin" = 0)
/obj/item/grown/novaflower/add_juice()
..()
diff --git a/code/modules/hydroponics/grown/melon.dm b/code/modules/hydroponics/grown/melon.dm
index 5e64d716ec..a64fc4b156 100644
--- a/code/modules/hydroponics/grown/melon.dm
+++ b/code/modules/hydroponics/grown/melon.dm
@@ -33,6 +33,7 @@
filling_color = "#008000"
bitesize_mod = 3
foodtype = FRUIT
+ juice_results = list("watermelonjuice" = 0)
// Holymelon
/obj/item/seeds/watermelon/holy
diff --git a/code/modules/hydroponics/grown/nettle.dm b/code/modules/hydroponics/grown/nettle.dm
index 284f962e45..9ec936c1f2 100644
--- a/code/modules/hydroponics/grown/nettle.dm
+++ b/code/modules/hydroponics/grown/nettle.dm
@@ -43,6 +43,7 @@
throw_speed = 1
throw_range = 3
attack_verb = list("stung")
+ grind_results = list("sacid" = 0)
/obj/item/grown/nettle/suicide_act(mob/user)
user.visible_message("
[user] is eating some of [src]! It looks like [user.p_theyre()] trying to commit suicide!")
@@ -91,6 +92,7 @@
icon_state = "deathnettle"
force = 30
throwforce = 15
+ grind_results = list("facid" = 1, "sacid" = 1)
/obj/item/grown/nettle/death/add_juice()
..()
diff --git a/code/modules/hydroponics/grown/potato.dm b/code/modules/hydroponics/grown/potato.dm
index 0a3cbc060c..e127b166ea 100644
--- a/code/modules/hydroponics/grown/potato.dm
+++ b/code/modules/hydroponics/grown/potato.dm
@@ -17,6 +17,7 @@
genes = list(/datum/plant_gene/trait/battery)
mutatelist = list(/obj/item/seeds/potato/sweet)
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
+ juice_results = list("potato" = 0)
/obj/item/reagent_containers/food/snacks/grown/potato
seed = /obj/item/seeds/potato
diff --git a/code/modules/hydroponics/grown/pumpkin.dm b/code/modules/hydroponics/grown/pumpkin.dm
index d5257aeee7..7113a8feab 100644
--- a/code/modules/hydroponics/grown/pumpkin.dm
+++ b/code/modules/hydroponics/grown/pumpkin.dm
@@ -24,6 +24,7 @@
filling_color = "#FFA500"
bitesize_mod = 2
foodtype = VEGETABLES
+ juice_results = list("pumpkinjuice" = 0)
/obj/item/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/W as obj, mob/user as mob, params)
if(W.is_sharp())
@@ -53,4 +54,5 @@
icon_state = "blumpkin"
filling_color = "#87CEFA"
bitesize_mod = 2
- foodtype = VEGETABLES
\ No newline at end of file
+ foodtype = VEGETABLES
+ juice_results = list("blumpkinjuice" = 0)
diff --git a/code/modules/hydroponics/grown/root.dm b/code/modules/hydroponics/grown/root.dm
index 8666db45a8..fd78fa6ffa 100644
--- a/code/modules/hydroponics/grown/root.dm
+++ b/code/modules/hydroponics/grown/root.dm
@@ -22,6 +22,7 @@
filling_color = "#FFA500"
bitesize_mod = 2
foodtype = VEGETABLES
+ juice_results = list("carrotjuice" = 0)
/obj/item/reagent_containers/food/snacks/grown/carrot/attackby(obj/item/I, mob/user, params)
if(I.is_sharp())
diff --git a/code/modules/hydroponics/grown/tea_coffee.dm b/code/modules/hydroponics/grown/tea_coffee.dm
index bd3b182c13..fc2ed221c5 100644
--- a/code/modules/hydroponics/grown/tea_coffee.dm
+++ b/code/modules/hydroponics/grown/tea_coffee.dm
@@ -14,7 +14,6 @@
icon_dead = "tea-dead"
genes = list(/datum/plant_gene/trait/repeated_harvest)
mutatelist = list(/obj/item/seeds/tea/astra)
- reagents_add = list("vitamin" = 0.04, "teapowder" = 0.1)
/obj/item/reagent_containers/food/snacks/grown/tea
seed = /obj/item/seeds/tea
@@ -22,6 +21,8 @@
desc = "These aromatic tips of the tea plant can be dried to make tea."
icon_state = "tea_aspera_leaves"
filling_color = "#008000"
+ grind_results = list("teapowder" = 0)
+ dry_grind = TRUE
// Tea Astra
/obj/item/seeds/tea/astra
@@ -39,6 +40,7 @@
name = "Tea Astra tips"
icon_state = "tea_astra_leaves"
filling_color = "#4582B4"
+ grind_results = list("teapowder" = 0, "salglu_solution" = 0)
// Coffee
@@ -67,6 +69,8 @@
icon_state = "coffee_arabica"
filling_color = "#DC143C"
bitesize_mod = 2
+ dry_grind = TRUE
+ grind_results = list("coffeepowder" = 0)
// Coffee Robusta
/obj/item/seeds/coffee/robusta
@@ -84,4 +88,5 @@
seed = /obj/item/seeds/coffee/robusta
name = "coffee robusta beans"
desc = "Increases robustness by 37 percent!"
- icon_state = "coffee_robusta"
\ No newline at end of file
+ icon_state = "coffee_robusta"
+ grind_results = list("coffeepowder" = 0, "morphine" = 0)
diff --git a/code/modules/hydroponics/grown/tomato.dm b/code/modules/hydroponics/grown/tomato.dm
index 1bc42b45c0..4d066e769e 100644
--- a/code/modules/hydroponics/grown/tomato.dm
+++ b/code/modules/hydroponics/grown/tomato.dm
@@ -23,6 +23,8 @@
filling_color = "#FF6347"
bitesize_mod = 2
foodtype = VEGETABLES
+ grind_results = list("ketchup" = 0)
+ juice_results = list("tomatojuice" = 0)
// Blood Tomato
/obj/item/seeds/tomato/blood
@@ -44,6 +46,7 @@
splat_type = /obj/effect/gibspawner/generic
filling_color = "#FF0000"
foodtype = VEGETABLES | GROSS
+ grind_results = list("ketchup" = 0, "blood" = 0)
// Blue Tomato
diff --git a/code/modules/hydroponics/grown/towercap.dm b/code/modules/hydroponics/grown/towercap.dm
index 59af735b01..1a3db5ef03 100644
--- a/code/modules/hydroponics/grown/towercap.dm
+++ b/code/modules/hydroponics/grown/towercap.dm
@@ -154,8 +154,8 @@
if(!click_params || !click_params["icon-x"] || !click_params["icon-y"])
return
//Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf)
- W.pixel_x = Clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
- W.pixel_y = Clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
+ W.pixel_x = CLAMP(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
+ W.pixel_y = CLAMP(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
else
return ..()
diff --git a/code/modules/hydroponics/growninedible.dm b/code/modules/hydroponics/growninedible.dm
index a77808f006..1c53f296cc 100644
--- a/code/modules/hydroponics/growninedible.dm
+++ b/code/modules/hydroponics/growninedible.dm
@@ -28,7 +28,7 @@
if(istype(src, seed.product)) // no adding reagents if it is just a trash item
seed.prepare_result(src)
- transform *= TransformUsingVariable(seed.potency, 100, 0.5)
+ transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5
add_juice()
@@ -62,3 +62,7 @@
/obj/item/grown/microwave_act(obj/machine/microwave/M)
return
+
+/obj/item/grown/on_grind()
+ for(var/i in 1 to grind_results.len)
+ grind_results[grind_results[i]] = round(seed.potency)
diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm
index 9eafcec71b..d22ca703c2 100644
--- a/code/modules/hydroponics/hydroponics.dm
+++ b/code/modules/hydroponics/hydroponics.dm
@@ -108,7 +108,7 @@
var/needs_update = 0 // Checks if the icon needs updating so we don't redraw empty trays every time
if(myseed && (myseed.loc != src))
- myseed.loc = src
+ myseed.forceMove(src)
if(self_sustaining)
adjustNutri(1)
@@ -881,26 +881,26 @@
/// Tray Setters - The following procs adjust the tray or plants variables, and make sure that the stat doesn't go out of bounds.///
/obj/machinery/hydroponics/proc/adjustNutri(adjustamt)
- nutrilevel = Clamp(nutrilevel + adjustamt, 0, maxnutri)
+ nutrilevel = CLAMP(nutrilevel + adjustamt, 0, maxnutri)
/obj/machinery/hydroponics/proc/adjustWater(adjustamt)
- waterlevel = Clamp(waterlevel + adjustamt, 0, maxwater)
+ waterlevel = CLAMP(waterlevel + adjustamt, 0, maxwater)
if(adjustamt>0)
adjustToxic(-round(adjustamt/4))//Toxicity dilutation code. The more water you put in, the lesser the toxin concentration.
/obj/machinery/hydroponics/proc/adjustHealth(adjustamt)
if(myseed && !dead)
- plant_health = Clamp(plant_health + adjustamt, 0, myseed.endurance)
+ plant_health = CLAMP(plant_health + adjustamt, 0, myseed.endurance)
/obj/machinery/hydroponics/proc/adjustToxic(adjustamt)
- toxic = Clamp(toxic + adjustamt, 0, 100)
+ toxic = CLAMP(toxic + adjustamt, 0, 100)
/obj/machinery/hydroponics/proc/adjustPests(adjustamt)
- pestlevel = Clamp(pestlevel + adjustamt, 0, 10)
+ pestlevel = CLAMP(pestlevel + adjustamt, 0, 10)
/obj/machinery/hydroponics/proc/adjustWeeds(adjustamt)
- weedlevel = Clamp(weedlevel + adjustamt, 0, 10)
+ weedlevel = CLAMP(weedlevel + adjustamt, 0, 10)
/obj/machinery/hydroponics/proc/spawnplant() // why would you put strange reagent in a hydro tray you monster I bet you also feed them blood
var/list/livingplants = list(/mob/living/simple_animal/hostile/tree, /mob/living/simple_animal/hostile/killertomato)
diff --git a/code/modules/hydroponics/seed_extractor.dm b/code/modules/hydroponics/seed_extractor.dm
index 0899a21132..b79d0652aa 100644
--- a/code/modules/hydroponics/seed_extractor.dm
+++ b/code/modules/hydroponics/seed_extractor.dm
@@ -17,7 +17,7 @@
return
while(t_amount < t_max)
var/obj/item/seeds/t_prod = F.seed.Copy()
- t_prod.loc = seedloc
+ t_prod.forceMove(seedloc)
t_amount++
qdel(O)
return 1
@@ -29,7 +29,7 @@
return
while(t_amount < t_max)
var/obj/item/seeds/t_prod = F.seed.Copy()
- t_prod.loc = seedloc
+ t_prod.forceMove(seedloc)
t_amount++
qdel(O)
return 1
@@ -168,7 +168,7 @@
for (var/obj/T in contents)//Now we find the seed we need to vend
var/obj/item/seeds/O = T
if (O.plantname == href_list["name"] && O.lifespan == href_list["li"] && O.endurance == href_list["en"] && O.maturation == href_list["ma"] && O.production == href_list["pr"] && O.yield == href_list["yi"] && O.potency == href_list["pot"])
- O.loc = src.loc
+ O.forceMove(drop_location())
break
src.updateUsrDialog()
diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm
index aa35b4ae07..56f80c548d 100644
--- a/code/modules/hydroponics/seeds.dm
+++ b/code/modules/hydroponics/seeds.dm
@@ -170,7 +170,7 @@
/// Setters procs ///
/obj/item/seeds/proc/adjust_yield(adjustamt)
if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable
- yield = Clamp(yield + adjustamt, 0, 10)
+ yield = CLAMP(yield + adjustamt, 0, 10)
if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
yield = 1 // Mushrooms always have a minimum yield of 1.
@@ -179,39 +179,39 @@
C.value = yield
/obj/item/seeds/proc/adjust_lifespan(adjustamt)
- lifespan = Clamp(lifespan + adjustamt, 10, 100)
+ lifespan = CLAMP(lifespan + adjustamt, 10, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan)
if(C)
C.value = lifespan
/obj/item/seeds/proc/adjust_endurance(adjustamt)
- endurance = Clamp(endurance + adjustamt, 10, 100)
+ endurance = CLAMP(endurance + adjustamt, 10, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance)
if(C)
C.value = endurance
/obj/item/seeds/proc/adjust_production(adjustamt)
if(yield != -1)
- production = Clamp(production + adjustamt, 1, 10)
+ production = CLAMP(production + adjustamt, 1, 10)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production)
if(C)
C.value = production
/obj/item/seeds/proc/adjust_potency(adjustamt)
if(potency != -1)
- potency = Clamp(potency + adjustamt, 0, 100)
+ potency = CLAMP(potency + adjustamt, 0, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency)
if(C)
C.value = potency
/obj/item/seeds/proc/adjust_weed_rate(adjustamt)
- weed_rate = Clamp(weed_rate + adjustamt, 0, 10)
+ weed_rate = CLAMP(weed_rate + adjustamt, 0, 10)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate)
if(C)
C.value = weed_rate
/obj/item/seeds/proc/adjust_weed_chance(adjustamt)
- weed_chance = Clamp(weed_chance + adjustamt, 0, 67)
+ weed_chance = CLAMP(weed_chance + adjustamt, 0, 67)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance)
if(C)
C.value = weed_chance
@@ -220,7 +220,7 @@
/obj/item/seeds/proc/set_yield(adjustamt)
if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable
- yield = Clamp(adjustamt, 0, 10)
+ yield = CLAMP(adjustamt, 0, 10)
if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
yield = 1 // Mushrooms always have a minimum yield of 1.
@@ -229,39 +229,39 @@
C.value = yield
/obj/item/seeds/proc/set_lifespan(adjustamt)
- lifespan = Clamp(adjustamt, 10, 100)
+ lifespan = CLAMP(adjustamt, 10, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan)
if(C)
C.value = lifespan
/obj/item/seeds/proc/set_endurance(adjustamt)
- endurance = Clamp(adjustamt, 10, 100)
+ endurance = CLAMP(adjustamt, 10, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance)
if(C)
C.value = endurance
/obj/item/seeds/proc/set_production(adjustamt)
if(yield != -1)
- production = Clamp(adjustamt, 1, 10)
+ production = CLAMP(adjustamt, 1, 10)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production)
if(C)
C.value = production
/obj/item/seeds/proc/set_potency(adjustamt)
if(potency != -1)
- potency = Clamp(adjustamt, 0, 100)
+ potency = CLAMP(adjustamt, 0, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency)
if(C)
C.value = potency
/obj/item/seeds/proc/set_weed_rate(adjustamt)
- weed_rate = Clamp(adjustamt, 0, 10)
+ weed_rate = CLAMP(adjustamt, 0, 10)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate)
if(C)
C.value = weed_rate
/obj/item/seeds/proc/set_weed_chance(adjustamt)
- weed_chance = Clamp(adjustamt, 0, 67)
+ weed_chance = CLAMP(adjustamt, 0, 67)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance)
if(C)
C.value = weed_chance
diff --git a/code/modules/integrated_electronics/core/special_pins/index_pin.dm b/code/modules/integrated_electronics/core/special_pins/index_pin.dm
index 802a2612d3..51b12a0f3a 100644
--- a/code/modules/integrated_electronics/core/special_pins/index_pin.dm
+++ b/code/modules/integrated_electronics/core/special_pins/index_pin.dm
@@ -14,7 +14,7 @@
new_data = 1
if(isnum(new_data))
- data = Clamp(round(new_data), 1, IC_MAX_LIST_LENGTH)
+ data = CLAMP(round(new_data), 1, IC_MAX_LIST_LENGTH)
holder.on_data_written()
/datum/integrated_io/index/display_pin_type()
diff --git a/code/modules/integrated_electronics/subtypes/converters.dm b/code/modules/integrated_electronics/subtypes/converters.dm
index 272dbef071..d622ea8ca9 100644
--- a/code/modules/integrated_electronics/subtypes/converters.dm
+++ b/code/modules/integrated_electronics/subtypes/converters.dm
@@ -265,7 +265,7 @@
pull_data()
var/incoming = get_pin_data(IC_INPUT, 1)
if(!isnull(incoming))
- result = ToDegrees(incoming)
+ result = TODEGREES(incoming)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -283,7 +283,7 @@
pull_data()
var/incoming = get_pin_data(IC_INPUT, 1)
if(!isnull(incoming))
- result = ToRadians(incoming)
+ result = TORADIANS(incoming)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -320,3 +320,55 @@
push_data()
activate_pin(2)
+
+/obj/item/integrated_circuit/converter/hsv2hex
+ name = "hsv to hexadecimal"
+ desc = "This circuit can convert a HSV (Hue, Saturation, and Value) color to a Hexadecimal RGB color."
+ extended_desc = "The first pin controls tint (0-359), the second pin controls how intense the tint is (0-255), and the third controls how bright the tint is (0 for black, 127 for normal, 255 for white)."
+ icon_state = "hsv-hex"
+ inputs = list(
+ "hue" = IC_PINTYPE_NUMBER,
+ "saturation" = IC_PINTYPE_NUMBER,
+ "value" = IC_PINTYPE_NUMBER
+ )
+ outputs = list("hexadecimal rgb" = IC_PINTYPE_COLOR)
+ spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
+
+/obj/item/integrated_circuit/converter/hsv2hex/do_work()
+ var/result = null
+ pull_data()
+ var/hue = get_pin_data(IC_INPUT, 1)
+ var/saturation = get_pin_data(IC_INPUT, 2)
+ var/value = get_pin_data(IC_INPUT, 3)
+ if(isnum(hue)&&isnum(saturation)&&isnum(value))
+ result = HSVtoRGB(hsv(AngleToHue(hue),saturation,value))
+
+ set_pin_data(IC_OUTPUT, 1, result)
+ push_data()
+ activate_pin(2)
+
+/obj/item/integrated_circuit/converter/rgb2hex
+ name = "rgb to hexadecimal"
+ desc = "This circuit can convert a RGB (Red, Green, Blue) color to a Hexadecimal RGB color."
+ extended_desc = "The first pin controls red amount, the second pin controls green amount, and the third controls blue amount. All go from 0-255."
+ icon_state = "rgb-hex"
+ inputs = list(
+ "red" = IC_PINTYPE_NUMBER,
+ "green" = IC_PINTYPE_NUMBER,
+ "blue" = IC_PINTYPE_NUMBER
+ )
+ outputs = list("hexadecimal rgb" = IC_PINTYPE_COLOR)
+ spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
+
+/obj/item/integrated_circuit/converter/rgb2hex/do_work()
+ var/result = null
+ pull_data()
+ var/red = get_pin_data(IC_INPUT, 1)
+ var/green = get_pin_data(IC_INPUT, 2)
+ var/blue = get_pin_data(IC_INPUT, 3)
+ if(isnum(red)&&isnum(green)&&isnum(blue))
+ result = rgb(red,green,blue)
+
+ set_pin_data(IC_OUTPUT, 1, result)
+ push_data()
+ activate_pin(2)
diff --git a/code/modules/integrated_electronics/subtypes/data_transfer.dm b/code/modules/integrated_electronics/subtypes/data_transfer.dm
index 20b80926c8..a769a16768 100644
--- a/code/modules/integrated_electronics/subtypes/data_transfer.dm
+++ b/code/modules/integrated_electronics/subtypes/data_transfer.dm
@@ -123,7 +123,7 @@
/obj/item/integrated_circuit/transfer/pulsedemultiplexer/do_work()
var/output_index = get_pin_data(IC_INPUT, 1)
- if(output_index == Clamp(output_index, 1, number_of_pins))
+ if(output_index == CLAMP(output_index, 1, number_of_pins))
activate_pin(round(output_index + 1 ,1))
/obj/item/integrated_circuit/transfer/pulsedemultiplexer/medium
diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm
index 276d3d9ca0..c39cfeac44 100644
--- a/code/modules/integrated_electronics/subtypes/input.dm
+++ b/code/modules/integrated_electronics/subtypes/input.dm
@@ -373,7 +373,7 @@
var/rad = get_pin_data(IC_INPUT, 2)
if(isnum(rad))
- rad = Clamp(rad, 0, 8)
+ rad = CLAMP(rad, 0, 8)
radius = rad
/obj/item/integrated_circuit/input/advanced_locator_list/do_work()
@@ -426,7 +426,7 @@
/obj/item/integrated_circuit/input/advanced_locator/on_data_written()
var/rad = get_pin_data(IC_INPUT, 2)
if(isnum(rad))
- rad = Clamp(rad, 0, 8)
+ rad = CLAMP(rad, 0, 8)
radius = rad
/obj/item/integrated_circuit/input/advanced_locator/do_work()
diff --git a/code/modules/integrated_electronics/subtypes/manipulation.dm b/code/modules/integrated_electronics/subtypes/manipulation.dm
index 42a55f1a1d..f32f414fbb 100644
--- a/code/modules/integrated_electronics/subtypes/manipulation.dm
+++ b/code/modules/integrated_electronics/subtypes/manipulation.dm
@@ -93,8 +93,8 @@
yo.data = round(yo.data, 1)
var/turf/T = get_turf(assembly)
- var/target_x = Clamp(T.x + xo.data, 0, world.maxx)
- var/target_y = Clamp(T.y + yo.data, 0, world.maxy)
+ var/target_x = CLAMP(T.x + xo.data, 0, world.maxx)
+ var/target_y = CLAMP(T.y + yo.data, 0, world.maxy)
shootAt(locate(target_x, target_y, T.z))
@@ -210,7 +210,7 @@
var/datum/integrated_io/detonation_time = inputs[1]
var/dt
if(isnum(detonation_time.data) && detonation_time.data > 0)
- dt = Clamp(detonation_time.data, 1, 12)*10
+ dt = CLAMP(detonation_time.data, 1, 12)*10
else
dt = 15
addtimer(CALLBACK(attached_grenade, /obj/item/grenade.proc/prime), dt)
@@ -389,9 +389,9 @@
if(!M.temporarilyRemoveItemFromInventory(A))
return
- var/x_abs = Clamp(T.x + target_x_rel, 0, world.maxx)
- var/y_abs = Clamp(T.y + target_y_rel, 0, world.maxy)
- var/range = round(Clamp(sqrt(target_x_rel*target_x_rel+target_y_rel*target_y_rel),0,8),1)
+ var/x_abs = CLAMP(T.x + target_x_rel, 0, world.maxx)
+ var/y_abs = CLAMP(T.y + target_y_rel, 0, world.maxy)
+ var/range = round(CLAMP(sqrt(target_x_rel*target_x_rel+target_y_rel*target_y_rel),0,8),1)
A.forceMove(drop_location())
A.throw_at(locate(x_abs, y_abs, T.z), range, 3)
diff --git a/code/modules/integrated_electronics/subtypes/output.dm b/code/modules/integrated_electronics/subtypes/output.dm
index ef6cc644d8..6a90ff5f2a 100644
--- a/code/modules/integrated_electronics/subtypes/output.dm
+++ b/code/modules/integrated_electronics/subtypes/output.dm
@@ -88,7 +88,7 @@
var/brightness = get_pin_data(IC_INPUT, 2)
if(new_color && isnum(brightness))
- brightness = Clamp(brightness, 0, 6)
+ brightness = CLAMP(brightness, 0, 6)
light_rgb = new_color
light_brightness = brightness
@@ -146,7 +146,7 @@
var/selected_sound = sounds[ID]
if(!selected_sound)
return
- vol = Clamp(vol ,0 , 100)
+ vol = CLAMP(vol ,0 , 100)
playsound(get_turf(src), selected_sound, vol, freq, -1)
/obj/item/integrated_circuit/output/sound/on_data_written()
diff --git a/code/modules/integrated_electronics/subtypes/reagents.dm b/code/modules/integrated_electronics/subtypes/reagents.dm
index 564c3a4851..78b1e9682e 100644
--- a/code/modules/integrated_electronics/subtypes/reagents.dm
+++ b/code/modules/integrated_electronics/subtypes/reagents.dm
@@ -111,7 +111,7 @@
else
direction_mode = SYRINGE_INJECT
if(isnum(new_amount))
- new_amount = Clamp(new_amount, 0, volume)
+ new_amount = CLAMP(new_amount, 0, volume)
transfer_amount = new_amount
// Hydroponics trays have no reagents holder and handle reagents in their own snowflakey way.
@@ -184,7 +184,7 @@
activate_pin(3)
return
- var/tramount = Clamp(transfer_amount, 0, reagents.total_volume)
+ var/tramount = CLAMP(transfer_amount, 0, reagents.total_volume)
if(isliving(AM))
var/mob/living/L = AM
@@ -235,7 +235,7 @@
else
direction_mode = SYRINGE_INJECT
if(isnum(new_amount))
- new_amount = Clamp(new_amount, 0, 50)
+ new_amount = CLAMP(new_amount, 0, 50)
transfer_amount = new_amount
/obj/item/integrated_circuit/reagent/pump/do_work()
@@ -383,7 +383,7 @@
else
direction_mode = SYRINGE_INJECT
if(isnum(new_amount))
- new_amount = Clamp(new_amount, 0, 50)
+ new_amount = CLAMP(new_amount, 0, 50)
transfer_amount = new_amount
/obj/item/integrated_circuit/reagent/filter/do_work()
diff --git a/code/modules/integrated_electronics/subtypes/time.dm b/code/modules/integrated_electronics/subtypes/time.dm
index 57fc16ccf9..d93aafef58 100644
--- a/code/modules/integrated_electronics/subtypes/time.dm
+++ b/code/modules/integrated_electronics/subtypes/time.dm
@@ -62,7 +62,7 @@
/obj/item/integrated_circuit/time/delay/custom/do_work()
var/delay_input = get_pin_data(IC_INPUT, 1)
if(delay_input && isnum(delay_input) )
- var/new_delay = Clamp(delay_input ,1 ,36000) //An hour.
+ var/new_delay = CLAMP(delay_input ,1 ,36000) //An hour.
delay = new_delay
..()
diff --git a/code/modules/integrated_electronics/subtypes/trig.dm b/code/modules/integrated_electronics/subtypes/trig.dm
index 1d7f660bd4..cefa25e945 100644
--- a/code/modules/integrated_electronics/subtypes/trig.dm
+++ b/code/modules/integrated_electronics/subtypes/trig.dm
@@ -71,7 +71,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
- result = Tan(A)
+ result = TAN(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -91,7 +91,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
- result = Csc(A)
+ result = CSC(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -111,7 +111,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
- result = Sec(A)
+ result = SEC(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -131,7 +131,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
- result = Cot(A)
+ result = COT(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
diff --git a/code/modules/keybindings/bindings_human.dm b/code/modules/keybindings/bindings_human.dm
new file mode 100644
index 0000000000..85aeba5f10
--- /dev/null
+++ b/code/modules/keybindings/bindings_human.dm
@@ -0,0 +1,69 @@
+/mob/living/carbon/human/key_down(_key, client/user)
+ if(client.keys_held["Shift"])
+ switch(_key)
+ if("E") // Put held thing in belt or take out most recent thing from belt
+ var/obj/item/thing = get_active_held_item()
+ var/obj/item/storage/equipped_belt = get_item_by_slot(slot_belt)
+ if(!equipped_belt) // We also let you equip a belt like this
+ if(!thing)
+ to_chat(user, "
You have no belt to take something out of.")
+ return
+ equip_to_slot_if_possible(thing, slot_belt)
+ return
+ if(!istype(equipped_belt)) // not a storage item
+ if(!thing)
+ to_chat(user, "
You have no belt to take something out of.")
+ else
+ to_chat(user, "
You can't fit anything in.")
+ return
+ if(thing) // put thing in belt
+ if(equipped_belt.can_be_inserted(thing))
+ equipped_belt.handle_item_insertion(thing)
+ else
+ to_chat(user, "
You can't fit anything in.")
+ return
+ if(!equipped_belt.contents.len) // nothing to take out
+ to_chat(user, "
There's nothing in your belt to take out.")
+ return
+ var/obj/item/stored = equipped_belt.contents[equipped_belt.contents.len]
+ if(!stored || stored.on_found(src))
+ return
+ stored.attack_hand(src) // take out thing from belt
+ return
+
+ if("B") // Put held thing in backpack or take out most recent thing from backpack
+ var/obj/item/thing = get_active_held_item()
+ var/obj/item/storage/equipped_backpack = get_item_by_slot(slot_back)
+ if(!equipped_backpack) // We also let you equip a backpack like this
+ if(!thing)
+ to_chat(user, "
You have no backpack to take something out of.")
+ return
+ equip_to_slot_if_possible(thing, slot_back)
+ return
+ if(!istype(equipped_backpack)) // not a storage item
+ if(!thing)
+ to_chat(user, "
You have no backpack to take something out of.")
+ else
+ to_chat(user, "
You can't fit anything in.")
+ return
+ if(thing) // put thing in backpack
+ if(equipped_backpack.can_be_inserted(thing))
+ equipped_backpack.handle_item_insertion(thing)
+ else
+ to_chat(user, "
You can't fit anything in.")
+ return
+ if(!equipped_backpack.contents.len) // nothing to take out
+ to_chat(user, "
There's nothing in your backpack to take out.")
+ return
+ var/obj/item/stored = equipped_backpack.contents[equipped_backpack.contents.len]
+ if(!stored || stored.on_found(src))
+ return
+ stored.attack_hand(src) // take out thing from backpack
+ return
+
+ switch(_key)
+ if("E")
+ quick_equip()
+ return
+
+ return ..()
\ No newline at end of file
diff --git a/code/modules/language/aphasia.dm b/code/modules/language/aphasia.dm
new file mode 100644
index 0000000000..070a792ecd
--- /dev/null
+++ b/code/modules/language/aphasia.dm
@@ -0,0 +1,13 @@
+/datum/language/aphasia
+ name = "Gibbering"
+ desc = "It is theorized that any sufficiently brain-damaged person can speak this language."
+ speech_verb = "garbles"
+ ask_verb = "mumbles"
+ whisper_verb = "mutters"
+ exclaim_verb = "screams incoherently"
+ flags_1 = LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD
+ key = "i"
+ syllables = list("m","n","gh","h","l","s","r","a","e","i","o","u")
+ space_chance = 20
+ default_priority = 10
+ icon_state = "aphasia"
diff --git a/code/modules/language/language.dm b/code/modules/language/language.dm
index 67881f7510..598fb41e6c 100644
--- a/code/modules/language/language.dm
+++ b/code/modules/language/language.dm
@@ -49,7 +49,7 @@
for(var/i in 0 to name_count)
new_name = ""
- var/Y = rand(Floor(syllable_count/syllable_divisor), syllable_count)
+ var/Y = rand(FLOOR(syllable_count/syllable_divisor, 1), syllable_count)
for(var/x in Y to 0)
new_name += pick(syllables)
full_name += " [capitalize(lowertext(new_name))]"
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index 711ac4f33a..9cbd04bf42 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -49,7 +49,7 @@
anchored = TRUE
for(var/obj/item/I in loc)
if(istype(I, /obj/item/book))
- I.loc = src
+ I.forceMove(src)
update_icon()
@@ -123,7 +123,7 @@
if(!user.get_active_held_item())
user.put_in_hands(choice)
else
- choice.loc = get_turf(src)
+ choice.forceMove(drop_location())
update_icon()
@@ -289,7 +289,7 @@
user.put_in_hands(B)
return
else
- B.loc = src.loc
+ B.forceMove(drop_location())
qdel(src)
return
return
diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm
index 52077d2367..5aa048a5fd 100644
--- a/code/modules/library/lib_machines.dm
+++ b/code/modules/library/lib_machines.dm
@@ -263,7 +263,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
dat += "
(Order book by SS13BN)"
dat += "
"
dat += "| AUTHOR | TITLE | CATEGORY | |
"
- dat += libcomp_menu[Clamp(page,1,libcomp_menu.len)]
+ dat += libcomp_menu[CLAMP(page,1,libcomp_menu.len)]
dat += "| <<<< | | | >>>> |
"
dat += "
"
dat += "
(Return to main menu)"
@@ -444,7 +444,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
else
var/orderid = input("Enter your order:") as num|null
if(orderid)
- if(isnum(orderid) && IsInteger(orderid))
+ if(isnum(orderid) && ISINTEGER(orderid))
href_list["targetid"] = num2text(orderid)
if(href_list["targetid"])
@@ -541,7 +541,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
cache = null
if(href_list["eject"])
for(var/obj/item/book/B in contents)
- B.loc = src.loc
+ B.forceMove(drop_location())
src.add_fingerprint(usr)
src.updateUsrDialog()
return
@@ -589,4 +589,4 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
B.icon_state = "book[rand(1,7)]"
qdel(P)
else
- P.loc = loc
+ P.forceMove(drop_location())
diff --git a/code/modules/lighting/lighting_source.dm b/code/modules/lighting/lighting_source.dm
index 8e56acc2fb..a6c28b4146 100644
--- a/code/modules/lighting/lighting_source.dm
+++ b/code/modules/lighting/lighting_source.dm
@@ -232,8 +232,8 @@
var/turf/T
if (source_turf)
var/oldlum = source_turf.luminosity
- source_turf.luminosity = Ceiling(light_range)
- for(T in view(Ceiling(light_range), source_turf))
+ source_turf.luminosity = CEILING(light_range, 1)
+ for(T in view(CEILING(light_range, 1), source_turf))
for (thing in T.get_corners(source_turf))
C = thing
corners[C] = 0
diff --git a/code/modules/mapping/reader.dm b/code/modules/mapping/reader.dm
index 862de852bc..559a93b87f 100644
--- a/code/modules/mapping/reader.dm
+++ b/code/modules/mapping/reader.dm
@@ -102,7 +102,7 @@ GLOBAL_DATUM_INIT(_preloader, /dmm_suite/preloader, new)
if(!no_changeturf)
WARNING("Z-level expansion occurred without no_changeturf set, this may cause problems when /turf/AfterChange is called")
- bounds[MAP_MINX] = min(bounds[MAP_MINX], Clamp(xcrdStart, x_lower, x_upper))
+ bounds[MAP_MINX] = min(bounds[MAP_MINX], CLAMP(xcrdStart, x_lower, x_upper))
bounds[MAP_MINZ] = min(bounds[MAP_MINZ], zcrd)
bounds[MAP_MAXZ] = max(bounds[MAP_MAXZ], zcrd)
@@ -119,15 +119,15 @@ GLOBAL_DATUM_INIT(_preloader, /dmm_suite/preloader, new)
if(gridLines.len && gridLines[gridLines.len] == "")
gridLines.Cut(gridLines.len) // Remove only one blank line at the end.
- bounds[MAP_MINY] = min(bounds[MAP_MINY], Clamp(ycrd, y_lower, y_upper))
+ bounds[MAP_MINY] = min(bounds[MAP_MINY], CLAMP(ycrd, y_lower, y_upper))
ycrd += gridLines.len - 1 // Start at the top and work down
if(!cropMap && ycrd > world.maxy)
if(!measureOnly)
world.maxy = ycrd // Expand Y here. X is expanded in the loop below
- bounds[MAP_MAXY] = max(bounds[MAP_MAXY], Clamp(ycrd, y_lower, y_upper))
+ bounds[MAP_MAXY] = max(bounds[MAP_MAXY], CLAMP(ycrd, y_lower, y_upper))
else
- bounds[MAP_MAXY] = max(bounds[MAP_MAXY], Clamp(min(ycrd, world.maxy), y_lower, y_upper))
+ bounds[MAP_MAXY] = max(bounds[MAP_MAXY], CLAMP(min(ycrd, world.maxy), y_lower, y_upper))
var/maxx = xcrdStart
if(measureOnly)
@@ -166,7 +166,7 @@ GLOBAL_DATUM_INIT(_preloader, /dmm_suite/preloader, new)
++xcrd
--ycrd
- bounds[MAP_MAXX] = Clamp(max(bounds[MAP_MAXX], cropMap ? min(maxx, world.maxx) : maxx), x_lower, x_upper)
+ bounds[MAP_MAXX] = CLAMP(max(bounds[MAP_MAXX], cropMap ? min(maxx, world.maxx) : maxx), x_lower, x_upper)
CHECK_TICK
diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm
index 7fdecaaeb6..01d6de85e2 100644
--- a/code/modules/mining/lavaland/necropolis_chests.dm
+++ b/code/modules/mining/lavaland/necropolis_chests.dm
@@ -172,7 +172,7 @@
to_chat(M, "
Your vision returns to normal.")
wisp.stop_orbit()
- wisp.loc = src
+ wisp.forceMove(src)
icon_state = "lantern-blue"
SSblackbox.record_feedback("tally", "wisp_lantern", 1, "Returned")
@@ -412,7 +412,7 @@
/obj/item/device/shared_storage/attackby(obj/item/W, mob/user, params)
if(bag)
- bag.loc = user
+ bag.forceMove(user)
bag.attackby(W, user, params)
@@ -421,7 +421,7 @@
return
if(loc == user && user.back && user.back == src)
if(bag)
- bag.loc = user
+ bag.forceMove(user)
bag.attack_hand(user)
else
..()
@@ -799,13 +799,13 @@
force = 0
var/ghost_counter = ghost_check()
- force = Clamp((ghost_counter * 4), 0, 75)
+ force = CLAMP((ghost_counter * 4), 0, 75)
user.visible_message("
[user] strikes with the force of [ghost_counter] vengeful spirits!")
..()
/obj/item/melee/ghost_sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
var/ghost_counter = ghost_check()
- final_block_chance += Clamp((ghost_counter * 5), 0, 75)
+ final_block_chance += CLAMP((ghost_counter * 5), 0, 75)
owner.visible_message("
[owner] is protected by a ring of [ghost_counter] ghosts!")
return ..()
diff --git a/code/modules/mining/lavaland/ruins/gym.dm b/code/modules/mining/lavaland/ruins/gym.dm
index 2eb30dc711..efda0f9c8f 100644
--- a/code/modules/mining/lavaland/ruins/gym.dm
+++ b/code/modules/mining/lavaland/ruins/gym.dm
@@ -29,7 +29,7 @@
icon_state = "fitnesslifter2"
user.setDir(SOUTH)
user.Stun(80)
- user.loc = src.loc
+ user.forceMove(src.loc)
var/bragmessage = pick("pushing it to the limit","going into overdrive","burning with determination","rising up to the challenge", "getting strong now","getting ripped")
user.visible_message("
[user] is [bragmessage]!")
var/lifts = 0
@@ -67,7 +67,7 @@
icon_state = "fitnessweight-c"
user.setDir(SOUTH)
user.Stun(80)
- user.loc = src.loc
+ user.forceMove(src.loc)
var/mutable_appearance/swole_overlay = mutable_appearance(icon, "fitnessweight-w", WALL_OBJ_LAYER)
add_overlay(swole_overlay)
var/bragmessage = pick("pushing it to the limit","going into overdrive","burning with determination","rising up to the challenge", "getting strong now","getting ripped")
@@ -93,4 +93,4 @@
var/finishmessage = pick("You feel stronger!","You feel like you can take on the world!","You feel robust!","You feel indestructible!")
icon_state = "fitnessweight"
cut_overlay(swole_overlay)
- to_chat(user, "[finishmessage]")
\ No newline at end of file
+ to_chat(user, "[finishmessage]")
diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm
index 60715ef26a..e16eb0e5b2 100644
--- a/code/modules/mining/machine_redemption.dm
+++ b/code/modules/mining/machine_redemption.dm
@@ -82,7 +82,7 @@
if(!M || !redemption_mat)
return FALSE
- var/smeltable_sheets = Floor(redemption_mat.amount / M)
+ var/smeltable_sheets = FLOOR(redemption_mat.amount / M, 1)
if(!smeltable_sheets)
return FALSE
diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm
index 3c7e736105..44f13d0a4f 100644
--- a/code/modules/mining/machine_stacking.dm
+++ b/code/modules/mining/machine_stacking.dm
@@ -88,7 +88,7 @@
stack_list[inp.type] = s
var/obj/item/stack/sheet/storage = stack_list[inp.type]
storage.amount += inp.amount //Stack the sheets
- inp.loc = null //Let the old sheet garbage collect
+ qdel(inp) //Let the old sheet garbage collect
while(storage.amount > stack_amt) //Get rid of excessive stackage
var/obj/item/stack/sheet/out = new inp.type()
out.amount = stack_amt
diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm
index fe4c2fab84..ca21456163 100644
--- a/code/modules/mining/mint.dm
+++ b/code/modules/mining/mint.dm
@@ -68,7 +68,7 @@
if(materials.materials[href_list["choose"]])
chosen = href_list["choose"]
if(href_list["chooseAmt"])
- coinsToProduce = Clamp(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 1000)
+ coinsToProduce = CLAMP(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 1000)
if(href_list["makeCoins"])
var/temp_coins = coinsToProduce
processing = TRUE
diff --git a/code/modules/mob/camera/camera.dm b/code/modules/mob/camera/camera.dm
index e058782be1..9a95bc9a4a 100644
--- a/code/modules/mob/camera/camera.dm
+++ b/code/modules/mob/camera/camera.dm
@@ -1,15 +1,18 @@
-// Camera mob, used by AI camera and blob.
-
-/mob/camera
- name = "camera mob"
+// Camera mob, used by AI camera and blob.
+
+/mob/camera
+ name = "camera mob"
density = FALSE
anchored = TRUE
- status_flags = GODMODE // You can't damage it.
+ status_flags = GODMODE // You can't damage it.
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
- see_in_dark = 7
- invisibility = INVISIBILITY_ABSTRACT // No one can see us
- sight = SEE_SELF
- move_on_shuttle = 0
-
-/mob/camera/experience_pressure_difference()
- return
+ see_in_dark = 7
+ invisibility = INVISIBILITY_ABSTRACT // No one can see us
+ sight = SEE_SELF
+ move_on_shuttle = 0
+
+/mob/camera/experience_pressure_difference()
+ return
+
+/mob/camera/forceMove(atom/destination)
+ loc = destination
diff --git a/code/modules/mob/dead/dead.dm b/code/modules/mob/dead/dead.dm
index 689ef552d9..1142d2d6cb 100644
--- a/code/modules/mob/dead/dead.dm
+++ b/code/modules/mob/dead/dead.dm
@@ -24,6 +24,9 @@ INITIALIZE_IMMEDIATE(/mob/dead)
/mob/dead/ConveyorMove() //lol
return
+/mob/dead/forceMove(atom/destination)
+ loc = destination
+
/mob/dead/Stat()
..()
diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm
index 458a54aa48..573183df96 100644
--- a/code/modules/mob/dead/new_player/new_player.dm
+++ b/code/modules/mob/dead/new_player/new_player.dm
@@ -21,9 +21,9 @@
S.Fade(TRUE)
if(length(GLOB.newplayer_start))
- loc = pick(GLOB.newplayer_start)
+ forceMove(pick(GLOB.newplayer_start))
else
- loc = locate(1,1,1)
+ forceMove(locate(1,1,1))
ComponentInitialize()
@@ -185,7 +185,7 @@
var/pollid = href_list["pollid"]
if(istext(pollid))
pollid = text2num(pollid)
- if(isnum(pollid) && IsInteger(pollid))
+ if(isnum(pollid) && ISINTEGER(pollid))
src.poll_player(pollid)
return
@@ -223,7 +223,7 @@
rating = null
else
rating = text2num(href_list["o[optionid]"])
- if(!isnum(rating) || !IsInteger(rating))
+ if(!isnum(rating) || !ISINTEGER(rating))
return
if(!vote_on_numval_poll(pollid, optionid, rating))
@@ -282,7 +282,7 @@
var/obj/effect/landmark/observer_start/O = locate(/obj/effect/landmark/observer_start) in GLOB.landmarks_list
to_chat(src, "
Now teleporting.")
if (O)
- observer.loc = O.loc
+ observer.forceMove(O.loc)
else
to_chat(src, "
Teleporting failed. Ahelp an admin please")
stack_trace("There's no freaking observer landmark available on this map or you're making observers before the map is initialised")
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index 4ae841cfa5..4ecae3730d 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -109,7 +109,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
else
T = locate(round(world.maxx/2), round(world.maxy/2), ZLEVEL_STATION_PRIMARY) //middle of the station
- loc = T
+ forceMove(T)
if(!name) //To prevent nameless ghosts
name = random_unique_name(gender)
@@ -288,10 +288,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/oldloc = loc
if(NewLoc)
- loc = NewLoc
+ forceMove(NewLoc)
update_parallax_contents()
else
- loc = get_turf(src) //Get out of closets and such as a ghost
+ forceMove(get_turf(src)) //Get out of closets and such as a ghost
if((direct & NORTH) && y < world.maxy)
y++
else if((direct & SOUTH) && y > 1)
@@ -371,7 +371,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!L || !L.len)
to_chat(usr, "No area available.")
- usr.loc = pick(L)
+ usr.forceMove(pick(L))
update_parallax_contents()
/mob/dead/observer/verb/follow()
@@ -445,7 +445,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/turf/T = get_turf(M) //Turf of the destination mob
if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination.
- A.loc = T
+ A.forceMove(T)
A.update_parallax_contents()
else
to_chat(A, "This mob is not located in the game world.")
@@ -462,7 +462,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
views |= i
var/new_view = input("Choose your new view", "Modify view range", 7) as null|anything in views
if(new_view)
- client.change_view(Clamp(new_view, 7, max_view))
+ client.change_view(CLAMP(new_view, 7, max_view))
else
client.change_view(CONFIG_GET(string/default_view))
@@ -471,7 +471,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set hidden = TRUE
var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
if(input)
- client.rescale_view(input, 7, max_view)
+ client.change_view(CLAMP(client.view + input, 7, max_view))
/mob/dead/observer/verb/boo()
set category = "Ghost"
diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm
index e4d49d7b70..e090592ba3 100644
--- a/code/modules/mob/living/brain/MMI.dm
+++ b/code/modules/mob/living/brain/MMI.dm
@@ -57,7 +57,7 @@
brainmob = newbrain.brainmob
newbrain.brainmob = null
- brainmob.loc = src
+ brainmob.forceMove(src)
brainmob.container = src
if(!newbrain.damaged_brain) // the brain organ hasn't been beaten to death.
brainmob.stat = CONSCIOUS //we manually revive the brain mob
@@ -90,7 +90,7 @@
/obj/item/device/mmi/proc/eject_brain(mob/user)
brainmob.container = null //Reset brainmob mmi var.
- brainmob.loc = brain //Throw mob into brain.
+ brainmob.forceMove(brain) //Throw mob into brain.
brainmob.stat = DEAD
brainmob.emp_damage = 0
brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision
@@ -120,7 +120,7 @@
if(ishuman(L))
var/mob/living/carbon/human/H = L
var/obj/item/organ/brain/newbrain = H.getorgan(/obj/item/organ/brain)
- newbrain.loc = src
+ newbrain.forceMove(src)
brain = newbrain
else if(!brain)
brain = new(src)
diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm
index db48302f49..aef5489b04 100644
--- a/code/modules/mob/living/brain/brain_item.dm
+++ b/code/modules/mob/living/brain/brain_item.dm
@@ -154,7 +154,7 @@
var/adjusted_amount
if(amount >= 0 && maximum)
var/brainloss = get_brain_damage()
- var/new_brainloss = Clamp(brainloss + amount, 0, maximum)
+ var/new_brainloss = CLAMP(brainloss + amount, 0, maximum)
if(brainloss > new_brainloss) //brainloss is over the cap already
return 0
adjusted_amount = new_brainloss - brainloss
diff --git a/code/modules/mob/living/brain/posibrain.dm b/code/modules/mob/living/brain/posibrain.dm
index ef704ef136..33a274c762 100644
--- a/code/modules/mob/living/brain/posibrain.dm
+++ b/code/modules/mob/living/brain/posibrain.dm
@@ -157,7 +157,7 @@ GLOBAL_VAR(posibrain_notify_cooldown)
new_name = pick(possible_names)
brainmob.name = "[new_name]-[rand(100, 999)]"
brainmob.real_name = brainmob.name
- brainmob.loc = src
+ brainmob.forceMove(src)
brainmob.container = src
if(autoping)
ping_ghosts("created", TRUE)
diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm
index eb17ecc40a..0760453094 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm
@@ -59,6 +59,14 @@ Doesn't work on other aliens/AI.*/
return 0
return 1
+/obj/effect/proc_holder/alien/proc/check_vent_block(mob/living/user)
+ var/obj/machinery/atmospherics/components/unary/atmos_thing = locate() in user.loc
+ if(atmos_thing)
+ var/rusure = alert(user, "Laying eggs and shaping resin here would block access to [atmos_thing]. Do you want to continue?", "Blocking Atmospheric Component", "Yes", "No")
+ if(rusure != "No")
+ return FALSE
+ return TRUE
+
/obj/effect/proc_holder/alien/plant
name = "Plant Weeds"
desc = "Plants some alien weeds."
@@ -243,7 +251,7 @@ Doesn't work on other aliens/AI.*/
name = "Secrete Resin"
desc = "Secrete tough malleable resin."
plasma_cost = 55
- check_turf = 1
+ check_turf = TRUE
var/list/structures = list(
"resin wall" = /obj/structure/alien/resin/wall,
"resin membrane" = /obj/structure/alien/resin/membrane,
@@ -254,18 +262,22 @@ Doesn't work on other aliens/AI.*/
/obj/effect/proc_holder/alien/resin/fire(mob/living/carbon/user)
if(locate(/obj/structure/alien/resin) in user.loc)
to_chat(user, "
There is already a resin structure there.")
- return 0
+ return FALSE
+
+ if(!check_vent_block(user))
+ return FALSE
+
var/choice = input("Choose what you wish to shape.","Resin building") as null|anything in structures
if(!choice)
- return 0
+ return FALSE
if (!cost_check(check_turf,user))
- return 0
+ return FALSE
to_chat(user, "
You shape a [choice].")
user.visible_message("
[user] vomits up a thick purple substance and begins to shape it.")
choice = structures[choice]
new choice(user.loc)
- return 1
+ return TRUE
/obj/effect/proc_holder/alien/regurgitate
name = "Regurgitate"
@@ -277,7 +289,7 @@ Doesn't work on other aliens/AI.*/
if(user.stomach_contents.len)
for(var/atom/movable/A in user.stomach_contents)
user.stomach_contents.Remove(A)
- A.loc = user.loc
+ A.forceMove(user.drop_location())
if(isliving(A))
var/mob/M = A
M.reset_perspective()
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index fdca497bc3..fc759ec827 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -106,7 +106,7 @@
for(var/atom/movable/A in stomach_contents)
stomach_contents.Remove(A)
new_xeno.stomach_contents.Add(A)
- A.loc = new_xeno
+ A.forceMove(new_xeno)
..()
//For alien evolution/promotion/queen finder procs. Checks for an active alien of that type
diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm
index 4f79ed7d25..5a48e1c6d1 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm
@@ -79,16 +79,20 @@
name = "Lay Egg"
desc = "Lay an egg to produce huggers to impregnate prey with."
plasma_cost = 75
- check_turf = 1
+ check_turf = TRUE
action_icon_state = "alien_egg"
/obj/effect/proc_holder/alien/lay_egg/fire(mob/living/carbon/user)
if(locate(/obj/structure/alien/egg) in get_turf(user))
- to_chat(user, "There's already an egg here.")
- return 0
+ to_chat(user, "
There's already an egg here.")
+ return FALSE
+
+ if(!check_vent_block(user))
+ return FALSE
+
user.visible_message("
[user] has laid an egg!")
new /obj/structure/alien/egg(user.loc)
- return 1
+ return TRUE
//Button to let queen choose her praetorian.
/obj/effect/proc_holder/alien/royal/queen/promote
diff --git a/code/modules/mob/living/carbon/alien/status_procs.dm b/code/modules/mob/living/carbon/alien/status_procs.dm
index 61de87b6cb..33ba8fea1d 100644
--- a/code/modules/mob/living/carbon/alien/status_procs.dm
+++ b/code/modules/mob/living/carbon/alien/status_procs.dm
@@ -17,4 +17,4 @@
/mob/living/carbon/alien/AdjustStun(amount, updating = 1, ignore_canstun = 0)
. = ..()
if(!.)
- move_delay_add = Clamp(move_delay_add + round(amount/2), 0, 10)
+ move_delay_add = CLAMP(move_delay_add + round(amount/2), 0, 10)
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index e2ae973d43..819ed8072f 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -38,7 +38,7 @@
if(prob(src.getBruteLoss() - 50))
for(var/atom/movable/A in stomach_contents)
- A.loc = loc
+ A.forceMove(drop_location())
stomach_contents.Remove(A)
src.gib()
@@ -157,6 +157,8 @@
if(!throwable_mob.buckled)
thrown_thing = throwable_mob
stop_pulling()
+ if(disabilities & PACIFISM)
+ to_chat(src, "
You gently let go of [throwable_mob].")
var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors
var/turf/end_T = get_turf(target)
if(start_T && end_T)
@@ -168,6 +170,10 @@
thrown_thing = I
dropItemToGround(I)
+ if(disabilities & PACIFISM && I.throwforce)
+ to_chat(src, "
You set [I] down gently on the ground.")
+ return
+
if(thrown_thing)
visible_message("
[src] has thrown [thrown_thing].")
add_logs(src, thrown_thing, "has thrown")
@@ -332,7 +338,7 @@
if (client)
client.screen -= W
if (W)
- W.loc = loc
+ W.forceMove(drop_location())
W.dropped(src)
if (W)
W.layer = initial(W.layer)
@@ -345,7 +351,7 @@
if (client)
client.screen -= W
if (W)
- W.loc = loc
+ W.forceMove(drop_location())
W.dropped(src)
if (W)
W.layer = initial(W.layer)
@@ -372,7 +378,7 @@
else
if(I == handcuffed)
- handcuffed.loc = loc
+ handcuffed.forceMove(drop_location())
handcuffed.dropped(src)
handcuffed = null
if(buckled && buckled.buckle_requires_restraints)
@@ -380,7 +386,7 @@
update_handcuffed()
return
if(I == legcuffed)
- legcuffed.loc = loc
+ legcuffed.forceMove(drop_location())
legcuffed.dropped()
legcuffed = null
update_inv_legcuffed()
@@ -786,7 +792,7 @@
if(prob(50))
organs_amt++
O.Remove(src)
- O.loc = get_turf(src)
+ O.forceMove(drop_location())
if(organs_amt)
to_chat(user, "
You retrieve some of [src]\'s internal organs!")
diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm
index 4e409391da..d601fde492 100644
--- a/code/modules/mob/living/carbon/carbon_defines.dm
+++ b/code/modules/mob/living/carbon/carbon_defines.dm
@@ -2,6 +2,7 @@
gender = MALE
pressure_resistance = 15
possible_a_intents = list(INTENT_HELP, INTENT_HARM)
+ hud_possible = list(HEALTH_HUD,STATUS_HUD,ANTAG_HUD,GLAND_HUD)
var/list/stomach_contents = list()
var/list/internal_organs = list() //List of /obj/item/organ in the mob. They don't go in the contents for some reason I don't want to know.
var/list/internal_organs_slot= list() //Same as above, but stores "slot ID" - "organ" pairs for easy access.
diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm
index aecf966350..9ba1dcc033 100644
--- a/code/modules/mob/living/carbon/damage_procs.dm
+++ b/code/modules/mob/living/carbon/damage_procs.dm
@@ -185,7 +185,7 @@
/mob/living/carbon/adjustStaminaLoss(amount, updating_stamina = 1)
if(status_flags & GODMODE)
return 0
- staminaloss = Clamp(staminaloss + amount, 0, maxHealth*2)
+ staminaloss = CLAMP(staminaloss + amount, 0, maxHealth*2)
if(updating_stamina)
update_stamina()
@@ -198,7 +198,7 @@
update_stamina()
/mob/living/carbon/getBrainLoss()
- . = BRAIN_DAMAGE_DEATH
+ . = 0
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
if(B)
. = B.get_brain_damage()
@@ -207,6 +207,7 @@
/mob/living/carbon/adjustBrainLoss(amount, maximum = BRAIN_DAMAGE_DEATH)
if(status_flags & GODMODE)
return 0
+ var/prev_brainloss = getBrainLoss()
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
if(!B)
return
@@ -224,6 +225,13 @@
else
gain_trauma_type(BRAIN_TRAUMA_SEVERE)
+ if(prev_brainloss < 40 && brainloss >= 40)
+ to_chat(src, "
You feel lightheaded.")
+ else if(prev_brainloss < 120 && brainloss >= 120)
+ to_chat(src, "
You feel less in control of your thoughts.")
+ else if(prev_brainloss < 180 && brainloss >= 180)
+ to_chat(src, "
You can feel your mind flickering on and off...")
+
/mob/living/carbon/setBrainLoss(amount)
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
if(B)
diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm
index 8c97bc71a3..b8d9d510fd 100644
--- a/code/modules/mob/living/carbon/examine.dm
+++ b/code/modules/mob/living/carbon/examine.dm
@@ -43,31 +43,32 @@
msg += "
"
var/temp = getBruteLoss()
- if(temp)
- if (temp < 25)
- msg += "[t_He] [t_has] minor bruising.\n"
- else if (temp < 50)
- msg += "[t_He] [t_has] moderate bruising!\n"
- else
- msg += "[t_He] [t_has] severe bruising!\n"
+ if(!(user == src && src.hal_screwyhud == SCREWYHUD_HEALTHY)) //fake healthy
+ if(temp)
+ if (temp < 25)
+ msg += "[t_He] [t_has] minor bruising.\n"
+ else if (temp < 50)
+ msg += "[t_He] [t_has] moderate bruising!\n"
+ else
+ msg += "[t_He] [t_has] severe bruising!\n"
- temp = getFireLoss()
- if(temp)
- if (temp < 25)
- msg += "[t_He] [t_has] minor burns.\n"
- else if (temp < 50)
- msg += "[t_He] [t_has] moderate burns!\n"
- else
- msg += "[t_He] [t_has] severe burns!\n"
+ temp = getFireLoss()
+ if(temp)
+ if (temp < 25)
+ msg += "[t_He] [t_has] minor burns.\n"
+ else if (temp < 50)
+ msg += "[t_He] [t_has] moderate burns!\n"
+ else
+ msg += "[t_He] [t_has] severe burns!\n"
- temp = getCloneLoss()
- if(temp)
- if(temp < 25)
- msg += "[t_He] [t_is] slightly deformed.\n"
- else if (temp < 50)
- msg += "[t_He] [t_is] moderately deformed!\n"
- else
- msg += "[t_He] [t_is] severely deformed!\n"
+ temp = getCloneLoss()
+ if(temp)
+ if(temp < 25)
+ msg += "[t_He] [t_is] slightly deformed.\n"
+ else if (temp < 50)
+ msg += "[t_He] [t_is] moderately deformed!\n"
+ else
+ msg += "[t_He] [t_is] severely deformed!\n"
if(disabilities & DUMB)
msg += "[t_He] seem[p_s()] to be clumsy and unable to think.\n"
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index 6ed9291b83..39caec803b 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -187,31 +187,32 @@
else if(l_limbs_missing >= 2 && r_limbs_missing >= 2)
msg += "[t_He] [p_do()]n't seem all there.\n"
- if(temp)
- if(temp < 25)
- msg += "[t_He] [t_has] minor bruising.\n"
- else if(temp < 50)
- msg += "[t_He] [t_has] moderate bruising!\n"
- else
- msg += "[t_He] [t_has] severe bruising!\n"
+ if(!(user == src && src.hal_screwyhud == SCREWYHUD_HEALTHY)) //fake healthy
+ if(temp)
+ if(temp < 25)
+ msg += "[t_He] [t_has] minor bruising.\n"
+ else if(temp < 50)
+ msg += "[t_He] [t_has] moderate bruising!\n"
+ else
+ msg += "[t_He] [t_has] severe bruising!\n"
- temp = getFireLoss()
- if(temp)
- if(temp < 25)
- msg += "[t_He] [t_has] minor burns.\n"
- else if (temp < 50)
- msg += "[t_He] [t_has] moderate burns!\n"
- else
- msg += "[t_He] [t_has] severe burns!\n"
+ temp = getFireLoss()
+ if(temp)
+ if(temp < 25)
+ msg += "[t_He] [t_has] minor burns.\n"
+ else if (temp < 50)
+ msg += "[t_He] [t_has] moderate burns!\n"
+ else
+ msg += "[t_He] [t_has] severe burns!\n"
- temp = getCloneLoss()
- if(temp)
- if(temp < 25)
- msg += "[t_He] [t_has] minor cellular damage.\n"
- else if(temp < 50)
- msg += "[t_He] [t_has] moderate cellular damage!\n"
- else
- msg += "[t_He] [t_has] severe cellular damage!\n"
+ temp = getCloneLoss()
+ if(temp)
+ if(temp < 25)
+ msg += "[t_He] [t_has] minor cellular damage.\n"
+ else if(temp < 50)
+ msg += "[t_He] [t_has] moderate cellular damage!\n"
+ else
+ msg += "[t_He] [t_has] severe cellular damage!\n"
if(fire_stacks > 0)
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index e8d4baba63..e3e1271132 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -89,15 +89,15 @@
for(var/obj/item/I in held_items)
if(!istype(I, /obj/item/clothing))
- var/final_block_chance = I.block_chance - (Clamp((armour_penetration-I.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
+ var/final_block_chance = I.block_chance - (CLAMP((armour_penetration-I.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
if(I.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
return 1
if(wear_suit)
- var/final_block_chance = wear_suit.block_chance - (Clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
+ var/final_block_chance = wear_suit.block_chance - (CLAMP((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
if(wear_suit.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
return 1
if(w_uniform)
- var/final_block_chance = w_uniform.block_chance - (Clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier
+ var/final_block_chance = w_uniform.block_chance - (CLAMP((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier
if(w_uniform.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
return 1
return 0
@@ -131,7 +131,7 @@
var/obj/item/bodypart/L = pick(bodyparts)
L.embedded_objects |= I
I.add_mob_blood(src)//it embedded itself in you, of course it's bloody!
- I.loc = src
+ I.forceMove(src)
L.receive_damage(I.w_class*I.embedded_impact_pain_multiplier)
visible_message("[I] embeds itself in [src]'s [L.name]!","[I] embeds itself in your [L.name]!")
hitpush = FALSE
diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm
index 8e72b26419..716373061d 100644
--- a/code/modules/mob/living/carbon/human/human_defines.dm
+++ b/code/modules/mob/living/carbon/human/human_defines.dm
@@ -1,5 +1,5 @@
/mob/living/carbon/human
- hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,IMPCHEM_HUD,IMPTRACK_HUD,ANTAG_HUD)
+ hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,IMPCHEM_HUD,IMPTRACK_HUD,ANTAG_HUD,GLAND_HUD)
possible_a_intents = list(INTENT_HELP, INTENT_DISARM, INTENT_GRAB, INTENT_HARM)
pressure_resistance = 25
//Hair colour and style
diff --git a/code/modules/mob/living/carbon/human/interactive.dm b/code/modules/mob/living/carbon/human/interactive.dm
index 9fd2cbf8de..38dfad5787 100644
--- a/code/modules/mob/living/carbon/human/interactive.dm
+++ b/code/modules/mob/living/carbon/human/interactive.dm
@@ -219,7 +219,7 @@
if(prob(25))
var/cType = pick(list(SNPC_BRUTE,SNPC_STEALTH,SNPC_MARTYR,SNPC_PSYCHO))
T.makeTraitor(cType)
- T.loc = pick(get_area_turfs(T.job2area(T.myjob)))
+ T.forceMove(pick(get_area_turfs(T.job2area(T.myjob))))
if(choice == "Custom")
var/cjob = input("Choose Job") as null|anything in SSjob.occupations
if(cjob)
@@ -256,7 +256,7 @@
var/doTele = input("Place the SNPC in their department?") as null|anything in list("Yes","No")
if(doTele)
if(doTele == "Yes")
- T.loc = pick(get_area_turfs(T.job2area(T.myjob)))
+ T.forceMove(pick(get_area_turfs(T.job2area(T.myjob))))
/mob/living/carbon/human/interactive/proc/doSetup()
Path_ID = new /obj/item/card/id(src)
@@ -506,7 +506,7 @@
var/list/slots = list ("left pocket" = slot_l_store,"right pocket" = slot_r_store,"left hand" = slot_hands,"right hand" = slot_hands)
if(hands)
slots = list ("left hand" = slot_hands,"right hand" = slot_hands)
- G.loc = src
+ G.forceMove(src)
if(G.force && G.force > best_force)
best_force = G.force
equip_in_one_of_slots(G, slots)
@@ -931,7 +931,7 @@
/mob/living/carbon/human/interactive/proc/npcDrop(var/obj/item/A,var/blacklist = 0)
if(blacklist)
blacklistItems += A
- A.loc = get_turf(src) // drop item works inconsistently
+ A.forceMove(drop_location()) // drop item works inconsistently
enforce_hands()
update_icons()
@@ -956,7 +956,7 @@
retal_target = traitorTarget
else
var/obj/item/I = traitorTarget
- I.loc = get_turf(traitorTarget) // pull it outta them
+ I.forceMove(get_turf(I)) // pull it outta them
else
take_to_slot(traitorTarget)
if(SNPC_MARTYR)
@@ -1315,7 +1315,7 @@
customEmote("[src] [pick("gibbers","drools","slobbers","claps wildly","spits")], grabbing various foodstuffs from [SF] and sticking them in it's mouth!")
for(var/obj/item/A in SF.contents)
if(prob(smartness/2))
- A.loc = src
+ A.forceMove(src)
if(foundCustom)
@@ -1398,7 +1398,7 @@
if(!Adjacent(toGrab))
tryWalk(toGrab)
else
- toGrab.loc = src
+ toGrab.forceMove(src)
if(finishedList.len > 0)
var/obj/structure/table/reinforced/RT
@@ -1563,7 +1563,7 @@
var/obj/item/W = main_hand
W.attack(TARGET,src)
else
- G.loc = get_turf(src) // drop item works inconsistently
+ G.forceMove(drop_location()) // drop item works inconsistently
enforce_hands()
update_icons()
else
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index cca672d3d8..a84683c5ae 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -314,7 +314,7 @@
if(prob(I.embedded_fall_chance))
BP.receive_damage(I.w_class*I.embedded_fall_pain_multiplier)
BP.embedded_objects -= I
- I.loc = get_turf(src)
+ I.forceMove(drop_location())
visible_message("[I] falls out of [name]'s [BP.name]!","[I] falls out of your [BP.name]!")
if(!has_embedded_objects())
clear_alert("embeddedobject")
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index 0b02a2c711..866c14242f 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -1315,11 +1315,14 @@ GLOBAL_LIST_EMPTY(roundstart_races)
/datum/species/proc/harm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
+ if(user.disabilities & PACIFISM)
+ to_chat(user, "You don't want to harm [target]!")
+ return FALSE
if(target.check_block())
target.visible_message("[target] blocks [user]'s attack!")
- return 0
+ return FALSE
if(attacker_style && attacker_style.harm_act(user,target))
- return 1
+ return TRUE
else
var/atk_verb = user.dna.species.attack_verb
@@ -1344,7 +1347,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
playsound(target.loc, user.dna.species.miss_sound, 25, 1, -1)
target.visible_message("[user] has attempted to [atk_verb] [target]!",\
"[user] has attempted to [atk_verb] [target]!", null, COMBAT_MESSAGE_RANGE)
- return 0
+ return FALSE
var/armor_block = target.run_armor_check(affecting, "melee")
@@ -1366,8 +1369,6 @@ GLOBAL_LIST_EMPTY(roundstart_races)
else if(target.lying)
target.forcesay(GLOB.hit_appends)
-
-
/datum/species/proc/disarm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
var/aim_for_mouth = user.zone_selected == "mouth"
var/target_on_help_and_unarmed = target.a_intent == INTENT_HELP && !target.get_active_held_item()
@@ -1387,10 +1388,12 @@ GLOBAL_LIST_EMPTY(roundstart_races)
return 1
else
user.do_attack_animation(target, ATTACK_EFFECT_DISARM)
-
+
if(target.w_uniform)
target.w_uniform.add_fingerprint(user)
- var/obj/item/bodypart/affecting = target.get_bodypart(ran_zone(user.zone_selected))
+ var/randomized_zone = ran_zone(user.zone_selected)
+ target.SendSignal(COMSIG_HUMAN_DISARM_HIT, user, user.zone_selected)
+ var/obj/item/bodypart/affecting = target.get_bodypart(randomized_zone)
var/randn = rand(1, 100)
if(randn <= 25)
playsound(target, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
@@ -1511,8 +1514,11 @@ GLOBAL_LIST_EMPTY(roundstart_races)
H.confused = max(H.confused, 20)
H.adjustBrainLoss(20)
H.adjust_blurriness(10)
- if(prob(20))
+ if(prob(10))
H.gain_trauma(/datum/brain_trauma/mild/concussion)
+ else
+ if(!I.is_sharp())
+ H.adjustBrainLoss(I.force / 5)
if(prob(I.force + ((100 - H.health)/2)) && H != user)
var/datum/antagonist/rev/rev = H.mind.has_antag_datum(/datum/antagonist/rev)
diff --git a/code/modules/mob/living/carbon/human/species_types/abductors.dm b/code/modules/mob/living/carbon/human/species_types/abductors.dm
index cf03d12130..cd273ec98e 100644
--- a/code/modules/mob/living/carbon/human/species_types/abductors.dm
+++ b/code/modules/mob/living/carbon/human/species_types/abductors.dm
@@ -9,3 +9,13 @@
/datum/species/abductor/copy_properties_from(datum/species/abductor/old_species)
scientist = old_species.scientist
+
+/datum/species/abductor/on_species_gain(mob/living/carbon/C, datum/species/old_species)
+ . = ..()
+ var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR]
+ abductor_hud.add_hud_to(C)
+
+/datum/species/abductor/on_species_loss(mob/living/carbon/C)
+ . = ..()
+ var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR]
+ abductor_hud.remove_hud_from(C)
diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm
index d2c83fa39f..2b86d2945d 100644
--- a/code/modules/mob/living/carbon/human/species_types/golems.dm
+++ b/code/modules/mob/living/carbon/human/species_types/golems.dm
@@ -369,7 +369,7 @@
var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2)
var/turf/target = get_turf(P.starting)
// redirect the projectile
- P.preparePixelProjectile(locate(Clamp(target.x + new_x, 1, world.maxx), Clamp(target.y + new_y, 1, world.maxy), H.z), H)
+ P.preparePixelProjectile(locate(CLAMP(target.x + new_x, 1, world.maxx), CLAMP(target.y + new_y, 1, world.maxy), H.z), H)
return -1
return 0
diff --git a/code/modules/mob/living/carbon/human/species_types/humans.dm b/code/modules/mob/living/carbon/human/species_types/humans.dm
index fe0acc4feb..31883b4dcd 100644
--- a/code/modules/mob/living/carbon/human/species_types/humans.dm
+++ b/code/modules/mob/living/carbon/human/species_types/humans.dm
@@ -19,6 +19,11 @@
if(H)
H.endTailWag()
+/datum/species/human/spec_stun(mob/living/carbon/human/H,amount)
+ if(H)
+ H.endTailWag()
+ . = ..()
+
/datum/species/human/space_move(mob/living/carbon/human/H)
var/obj/item/device/flightpack/F = H.get_flightpack()
if(istype(F) && (F.flight) && F.allow_thrust(0.01, src))
diff --git a/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm b/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm
index 257abf63d0..0d006196aa 100644
--- a/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm
@@ -42,6 +42,11 @@
if(H)
H.endTailWag()
+/datum/species/lizard/spec_stun(mob/living/carbon/human/H,amount)
+ if(H)
+ H.endTailWag()
+ . = ..()
+
/*
Lizard subspecies: ASHWALKERS
*/
diff --git a/code/modules/mob/living/carbon/human/species_types/vampire.dm b/code/modules/mob/living/carbon/human/species_types/vampire.dm
index 6d1384f12f..aff8440930 100644
--- a/code/modules/mob/living/carbon/human/species_types/vampire.dm
+++ b/code/modules/mob/living/carbon/human/species_types/vampire.dm
@@ -94,8 +94,8 @@
to_chat(victim, "[H] is draining your blood!")
to_chat(H, "You drain some blood!")
playsound(H, 'sound/items/drink.ogg', 30, 1, -2)
- victim.blood_volume = Clamp(victim.blood_volume - drained_blood, 0, BLOOD_VOLUME_MAXIMUM)
- H.blood_volume = Clamp(H.blood_volume + drained_blood, 0, BLOOD_VOLUME_MAXIMUM)
+ victim.blood_volume = CLAMP(victim.blood_volume - drained_blood, 0, BLOOD_VOLUME_MAXIMUM)
+ H.blood_volume = CLAMP(H.blood_volume + drained_blood, 0, BLOOD_VOLUME_MAXIMUM)
if(!victim.blood_volume)
to_chat(H, "You finish off [victim]'s blood supply!")
diff --git a/code/modules/mob/living/carbon/human/species_types/zombies.dm b/code/modules/mob/living/carbon/human/species_types/zombies.dm
index 2fe526368a..792485960e 100644
--- a/code/modules/mob/living/carbon/human/species_types/zombies.dm
+++ b/code/modules/mob/living/carbon/human/species_types/zombies.dm
@@ -25,7 +25,7 @@
limbs_id = "zombie"
mutanthands = /obj/item/zombie_hand
armor = 20 // 120 damage to KO a zombie, which kills it
- speedmod = 2
+ speedmod = 1.6
mutanteyes = /obj/item/organ/eyes/night_vision/zombie
var/regen_cooldown = 0
@@ -34,7 +34,7 @@
/datum/species/zombie/infectious/spec_stun(mob/living/carbon/human/H,amount)
- . = min(2, amount)
+ . = min(20, amount)
/datum/species/zombie/infectious/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H)
. = ..()
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index 5eb09a8d83..4399607984 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -182,7 +182,7 @@
//TOXINS/PLASMA
if(Toxins_partialpressure > safe_tox_max)
var/ratio = (breath_gases[/datum/gas/plasma][MOLES]/safe_tox_max) * 10
- adjustToxLoss(Clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
+ adjustToxLoss(CLAMP(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
else
clear_alert("too_much_tox")
diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm
index d6afdbdbc2..09d00465ee 100644
--- a/code/modules/mob/living/carbon/monkey/combat.dm
+++ b/code/modules/mob/living/carbon/monkey/combat.dm
@@ -120,16 +120,19 @@
/mob/living/carbon/monkey/proc/should_target(var/mob/living/L)
if(L == src)
- return 0
+ return FALSE
+
+ if(disabilities & PACIFISM)
+ return FALSE
if(enemies[L])
- return 1
+ return TRUE
// target non-monkey mobs when aggressive, with a small probability of monkey v monkey
if(aggressive && (!istype(L, /mob/living/carbon/monkey/) || prob(MONKEY_AGGRESSIVE_MVM_PROB)))
- return 1
+ return TRUE
- return 0
+ return FALSE
/mob/living/carbon/monkey/proc/handle_combat()
// Don't do any AI if inside another mob (devoured)
diff --git a/code/modules/mob/living/carbon/status_procs.dm b/code/modules/mob/living/carbon/status_procs.dm
index e46ae2f8e6..7c40b6f144 100644
--- a/code/modules/mob/living/carbon/status_procs.dm
+++ b/code/modules/mob/living/carbon/status_procs.dm
@@ -59,10 +59,10 @@
clear_alert("high")
/mob/living/carbon/adjust_disgust(amount)
- disgust = Clamp(disgust+amount, 0, DISGUST_LEVEL_MAXEDOUT)
+ disgust = CLAMP(disgust+amount, 0, DISGUST_LEVEL_MAXEDOUT)
/mob/living/carbon/set_disgust(amount)
- disgust = Clamp(amount, 0, DISGUST_LEVEL_MAXEDOUT)
+ disgust = CLAMP(amount, 0, DISGUST_LEVEL_MAXEDOUT)
/mob/living/carbon/cure_blind()
if(disabilities & BLIND)
diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm
index dbc8da5a05..9517e1b705 100644
--- a/code/modules/mob/living/damage_procs.dm
+++ b/code/modules/mob/living/damage_procs.dm
@@ -157,7 +157,7 @@
/mob/living/proc/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
- bruteloss = Clamp((bruteloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
+ bruteloss = CLAMP((bruteloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
@@ -168,7 +168,7 @@
/mob/living/proc/adjustOxyLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
- oxyloss = Clamp((oxyloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
+ oxyloss = CLAMP((oxyloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
@@ -187,7 +187,7 @@
/mob/living/proc/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
- toxloss = Clamp((toxloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
+ toxloss = CLAMP((toxloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
@@ -206,7 +206,7 @@
/mob/living/proc/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
- fireloss = Clamp((fireloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
+ fireloss = CLAMP((fireloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
@@ -217,7 +217,7 @@
/mob/living/proc/adjustCloneLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
- cloneloss = Clamp((cloneloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
+ cloneloss = CLAMP((cloneloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm
index 0aafef753f..3ae022cdcc 100644
--- a/code/modules/mob/living/life.dm
+++ b/code/modules/mob/living/life.dm
@@ -137,6 +137,9 @@
eye_blurry = max(eye_blurry-1, 0)
if(client && !eye_blurry)
clear_fullscreen("blurry")
+ if(disabilities & PACIFISM && a_intent == INTENT_HARM)
+ to_chat(src, "You don't feel like harming anybody.")
+ a_intent_change(INTENT_HELP)
/mob/living/proc/update_damage_hud()
return
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index f589ecbb20..6ee1ed5229 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -809,9 +809,12 @@
to_chat(src, "You don't have the dexterity to do this!")
return
/mob/living/proc/can_use_guns(obj/item/G)
- if (G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser())
+ if(G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser())
to_chat(src, "You don't have the dexterity to do this!")
return FALSE
+ if(disabilities & PACIFISM)
+ to_chat(src, "You don't want to risk harming anyone!")
+ return FALSE
return TRUE
/mob/living/carbon/proc/update_stamina()
@@ -918,7 +921,7 @@
update_fire()
/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person
- fire_stacks = Clamp(fire_stacks + add_fire_stacks, -20, 20)
+ fire_stacks = CLAMP(fire_stacks + add_fire_stacks, -20, 20)
if(on_fire && fire_stacks <= 0)
ExtinguishMob()
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index f77c65225f..ed07313862 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -55,9 +55,9 @@
/obj/item/proc/get_volume_by_throwforce_and_or_w_class()
if(throwforce && w_class)
- return Clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
+ return CLAMP((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
else if(w_class)
- return Clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
+ return CLAMP(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
else
return 0
@@ -127,14 +127,19 @@
/mob/living/proc/grabbedby(mob/living/carbon/user, supress_message = 0)
if(user == src || anchored || !isturf(user.loc))
- return 0
+ return FALSE
if(!user.pulling || user.pulling != src)
user.start_pulling(src, supress_message)
return
if(!(status_flags & CANPUSH))
to_chat(user, "[src] can't be grabbed more aggressively!")
- return 0
+ return FALSE
+
+ if(user.disabilities & PACIFISM)
+ to_chat(user, "You don't want to risk hurting [src]!")
+ return FALSE
+
grippedby(user)
//proc to upgrade a simple pull into a more aggressive grab.
@@ -188,83 +193,101 @@
M.Feedstop()
return // can't attack while eating!
+ if(disabilities & PACIFISM)
+ to_chat(M, "You don't want to hurt anyone!")
+ return FALSE
+
if (stat != DEAD)
add_logs(M, src, "attacked")
M.do_attack_animation(src)
visible_message("The [M.name] glomps [src]!", \
"The [M.name] glomps [src]!", null, COMBAT_MESSAGE_RANGE)
- return 1
+ return TRUE
/mob/living/attack_animal(mob/living/simple_animal/M)
M.face_atom(src)
if(M.melee_damage_upper == 0)
M.visible_message("\The [M] [M.friendly] [src]!")
- return 0
+ return FALSE
else
+ if(M.disabilities & PACIFISM)
+ to_chat(M, "You don't want to hurt anyone!")
+ return FALSE
+
if(M.attack_sound)
playsound(loc, M.attack_sound, 50, 1, 1)
M.do_attack_animation(src)
visible_message("\The [M] [M.attacktext] [src]!", \
"\The [M] [M.attacktext] [src]!", null, COMBAT_MESSAGE_RANGE)
add_logs(M, src, "attacked")
- return 1
+ return TRUE
/mob/living/attack_paw(mob/living/carbon/monkey/M)
if(isturf(loc) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
- return 0
+ return FALSE
if (M.a_intent == INTENT_HARM)
+ if(M.disabilities & PACIFISM)
+ to_chat(M, "You don't want to hurt anyone!")
+ return FALSE
+
if(M.is_muzzled() || (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSMOUTH))
to_chat(M, "You can't bite with your mouth covered!")
- return 0
+ return FALSE
M.do_attack_animation(src, ATTACK_EFFECT_BITE)
if (prob(75))
add_logs(M, src, "attacked")
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
visible_message("[M.name] bites [src]!", \
"[M.name] bites [src]!", null, COMBAT_MESSAGE_RANGE)
- return 1
+ return TRUE
else
visible_message("[M.name] has attempted to bite [src]!", \
"[M.name] has attempted to bite [src]!", null, COMBAT_MESSAGE_RANGE)
- return 0
+ return FALSE
/mob/living/attack_larva(mob/living/carbon/alien/larva/L)
switch(L.a_intent)
if("help")
visible_message("[L.name] rubs its head against [src].")
- return 0
+ return FALSE
else
+ if(L.disabilities & PACIFISM)
+ to_chat(L, "You don't want to hurt anyone!")
+ return
+
L.do_attack_animation(src)
if(prob(90))
add_logs(L, src, "attacked")
visible_message("[L.name] bites [src]!", \
"[L.name] bites [src]!", null, COMBAT_MESSAGE_RANGE)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
- return 1
+ return TRUE
else
visible_message("[L.name] has attempted to bite [src]!", \
"[L.name] has attempted to bite [src]!", null, COMBAT_MESSAGE_RANGE)
- return 0
+ return FALSE
/mob/living/attack_alien(mob/living/carbon/alien/humanoid/M)
switch(M.a_intent)
if ("help")
visible_message("[M] caresses [src] with its scythe like arm.")
- return 0
-
+ return FALSE
if ("grab")
grabbedby(M)
- return 0
+ return FALSE
if("harm")
+ if(M.disabilities & PACIFISM)
+ to_chat(M, "You don't want to hurt anyone!")
+ return FALSE
M.do_attack_animation(src)
- return 1
+ return TRUE
if("disarm")
M.do_attack_animation(src, ATTACK_EFFECT_DISARM)
- return 1
+ return TRUE
/mob/living/ex_act(severity, target, origin)
if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm
index ffdd37bdca..611d9dbc4c 100644
--- a/code/modules/mob/living/login.dm
+++ b/code/modules/mob/living/login.dm
@@ -13,8 +13,8 @@
update_damage_hud()
update_health_hud()
- if (loc)
- var/turf/T = get_turf(src)
+ var/turf/T = get_turf(src)
+ if (isturf(T))
update_z(T.z)
//Vents
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 47d5a0ffd8..86314e33d7 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -117,7 +117,7 @@
job = "AI"
eyeobj.ai = src
- eyeobj.loc = src.loc
+ eyeobj.forceMove(src.loc)
rename_self("ai")
holo_icon = getHologramIcon(icon('icons/mob/ai.dmi',"default"))
diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm
index b12430d26d..924ab615b8 100644
--- a/code/modules/mob/living/silicon/pai/pai.dm
+++ b/code/modules/mob/living/silicon/pai/pai.dm
@@ -138,7 +138,7 @@
/mob/living/silicon/pai/proc/process_hack()
if(cable && cable.machine && istype(cable.machine, /obj/machinery/door) && cable.machine == hackdoor && get_dist(src, hackdoor) <= 1)
- hackprogress = Clamp(hackprogress + 4, 0, 100)
+ hackprogress = CLAMP(hackprogress + 4, 0, 100)
else
temp = "Door Jack: Connection to airlock has been lost. Hack aborted."
hackprogress = 0
@@ -283,8 +283,8 @@
/mob/living/silicon/pai/process()
- emitterhealth = Clamp((emitterhealth + emitterregen), -50, emittermaxhealth)
- hit_slowdown = Clamp((hit_slowdown - 1), 0, 100)
+ emitterhealth = CLAMP((emitterhealth + emitterregen), -50, emittermaxhealth)
+ hit_slowdown = CLAMP((hit_slowdown - 1), 0, 100)
/mob/living/silicon/pai/generateStaticOverlay()
return
diff --git a/code/modules/mob/living/silicon/pai/pai_defense.dm b/code/modules/mob/living/silicon/pai/pai_defense.dm
index 83da7d9087..2c6c42e3bb 100644
--- a/code/modules/mob/living/silicon/pai/pai_defense.dm
+++ b/code/modules/mob/living/silicon/pai/pai_defense.dm
@@ -57,7 +57,7 @@
return FALSE //No we're not flammable
/mob/living/silicon/pai/proc/take_holo_damage(amount)
- emitterhealth = Clamp((emitterhealth - amount), -50, emittermaxhealth)
+ emitterhealth = CLAMP((emitterhealth - amount), -50, emittermaxhealth)
if(emitterhealth < 0)
fold_in(force = TRUE)
to_chat(src, "The impact degrades your holochassis!")
diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm
index aab1f204f6..ce0571ca4e 100644
--- a/code/modules/mob/living/silicon/robot/life.dm
+++ b/code/modules/mob/living/silicon/robot/life.dm
@@ -23,7 +23,7 @@
if(cell && cell.charge)
if(cell.charge <= 100)
uneq_all()
- var/amt = Clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
+ var/amt = CLAMP((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
cell.use(amt) //Usage table: 1/tick if off/lowest setting, 4 = 4/tick, 6 = 8/tick, 8 = 12/tick, 10 = 16/tick
else
uneq_all()
diff --git a/code/modules/mob/living/simple_animal/damage_procs.dm b/code/modules/mob/living/simple_animal/damage_procs.dm
index 5405ee03c6..bb6794a36a 100644
--- a/code/modules/mob/living/simple_animal/damage_procs.dm
+++ b/code/modules/mob/living/simple_animal/damage_procs.dm
@@ -2,7 +2,7 @@
/mob/living/simple_animal/proc/adjustHealth(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
- bruteloss = Clamp(bruteloss + amount, 0, maxHealth)
+ bruteloss = CLAMP(bruteloss + amount, 0, maxHealth)
if(updating_health)
updatehealth()
return amount
diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm
index 6ea4d2ef94..adc88c5633 100644
--- a/code/modules/mob/living/simple_animal/friendly/dog.dm
+++ b/code/modules/mob/living/simple_animal/friendly/dog.dm
@@ -135,7 +135,7 @@
switch(remove_from)
if("head")
if(inventory_head)
- inventory_head.loc = src.loc
+ inventory_head.forceMove(drop_location())
inventory_head = null
update_corgi_fluff()
regenerate_icons()
@@ -144,7 +144,7 @@
return
if("back")
if(inventory_back)
- inventory_back.loc = src.loc
+ inventory_back.forceMove(drop_location())
inventory_back = null
update_corgi_fluff()
regenerate_icons()
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
index e4de4387be..ea159a5749 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
@@ -48,6 +48,7 @@
faction = list("neutral","silicon","turret")
dextrous = TRUE
dextrous_hud_type = /datum/hud/dextrous/drone
+ lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
var/staticChoice = "static"
var/list/staticChoices = list("static", "blank", "letter", "animal")
var/picked = FALSE //Have we picked our visual appearence (+ colour if applicable)
@@ -57,7 +58,6 @@
"1. You may not involve yourself in the matters of another being, even if such matters conflict with Law Two or Law Three, unless the other being is another Drone.\n"+\
"2. You may not harm any being, regardless of intent or circumstance.\n"+\
"3. Your goals are to build, maintain, repair, improve, and provide power to the best of your abilities, You must never actively work against these goals."
- var/light_on = 0
var/heavy_emp_damage = 25 //Amount of damage sustained if hit by a heavy EMP pulse
var/alarms = list("Atmosphere" = list(), "Fire" = list(), "Power" = list())
var/obj/item/internal_storage //Drones can store one item, of any size/type in their body
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm b/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm
index 7a2c9e6b39..c0a57e3739 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm
@@ -67,7 +67,7 @@
L.dropItemToGround(src)
contents -= drone
- drone.loc = get_turf(src)
+ drone.forceMove(drop_location())
drone.reset_perspective()
drone.setDir(SOUTH )//Looks better
drone.visible_message("[drone] uncurls!")
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
index 3aa1153133..fa899aec0f 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
@@ -148,7 +148,6 @@
qdel(access_card) //we don't have free access
access_card = null
verbs -= /mob/living/simple_animal/drone/verb/check_laws
- verbs -= /mob/living/simple_animal/drone/verb/toggle_light
verbs -= /mob/living/simple_animal/drone/verb/drone_ping
/mob/living/simple_animal/drone/cogscarab/Login()
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/verbs.dm b/code/modules/mob/living/simple_animal/friendly/drone/verbs.dm
index 49faea14b3..86bc3b69e5 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/verbs.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/verbs.dm
@@ -11,23 +11,7 @@
to_chat(src, "Drone Laws")
to_chat(src, laws)
-
-/mob/living/simple_animal/drone/verb/toggle_light()
- set category = "Drone"
- set name = "Toggle drone light"
- if(stat == DEAD)
- to_chat(src, "There's no light in your life... by that I mean you're dead.")
- return
- if(light_on)
- set_light(0)
- else
- set_light(8)
-
- light_on = !light_on
-
- to_chat(src, "Your light is now [light_on ? "on" : "off"].")
-
/mob/living/simple_animal/drone/verb/drone_ping()
set category = "Drone"
set name = "Drone ping"
diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm
index 85ec19bfb9..809681ed6b 100644
--- a/code/modules/mob/living/simple_animal/friendly/mouse.dm
+++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm
@@ -110,3 +110,7 @@
eatverb = "devours"
list_reagents = list("nutriment" = 3, "vitamin" = 2)
foodtype = GROSS | MEAT | RAW
+ grind_results = list("blood" = 20, "liquidgibs" = 5)
+
+/obj/item/reagent_containers/food/snacks/deadmouse/on_grind()
+ reagents.clear_reagents()
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm
index a977338008..c6f0f6a91c 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm
@@ -79,10 +79,10 @@ Difficulty: Hard
/mob/living/simple_animal/hostile/megafauna/bubblegum/Life()
..()
- move_to_delay = Clamp((health/maxHealth) * 10, 5, 10)
+ move_to_delay = CLAMP((health/maxHealth) * 10, 5, 10)
/mob/living/simple_animal/hostile/megafauna/bubblegum/OpenFire()
- anger_modifier = Clamp(((maxHealth - health)/60),0,20)
+ anger_modifier = CLAMP(((maxHealth - health)/60),0,20)
if(charging)
return
ranged_cooldown = world.time + ranged_cooldown_time
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
index 58e3e0837b..d47385efc3 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
@@ -57,7 +57,7 @@ Difficulty: Very Hard
L.dust()
/mob/living/simple_animal/hostile/megafauna/colossus/OpenFire()
- anger_modifier = Clamp(((maxHealth - health)/50),0,20)
+ anger_modifier = CLAMP(((maxHealth - health)/50),0,20)
ranged_cooldown = world.time + 120
if(enrage(target))
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm
index 7f12e684e8..724e4fc5c7 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm
@@ -101,7 +101,7 @@ Difficulty: Medium
/mob/living/simple_animal/hostile/megafauna/dragon/OpenFire()
if(swooping)
return
- anger_modifier = Clamp(((maxHealth - health)/50),0,20)
+ anger_modifier = CLAMP(((maxHealth - health)/50),0,20)
ranged_cooldown = world.time + ranged_cooldown_time
if(prob(15 + anger_modifier) && !client)
@@ -227,10 +227,10 @@ Difficulty: Medium
//ensure swoop direction continuity.
if(negative)
- if(IsInRange(x, initial_x + 1, initial_x + DRAKE_SWOOP_DIRECTION_CHANGE_RANGE))
+ if(ISINRANGE(x, initial_x + 1, initial_x + DRAKE_SWOOP_DIRECTION_CHANGE_RANGE))
negative = FALSE
else
- if(IsInRange(x, initial_x - DRAKE_SWOOP_DIRECTION_CHANGE_RANGE, initial_x - 1))
+ if(ISINRANGE(x, initial_x - DRAKE_SWOOP_DIRECTION_CHANGE_RANGE, initial_x - 1))
negative = TRUE
new /obj/effect/temp_visual/dragon_flight/end(loc, negative)
new /obj/effect/temp_visual/dragon_swoop(loc)
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
index 02fb81a1ed..8dc1780e5e 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
@@ -187,7 +187,7 @@ Difficulty: Hard
/mob/living/simple_animal/hostile/megafauna/hierophant/proc/calculate_rage() //how angry we are overall
did_reset = FALSE //oh hey we're doing SOMETHING, clearly we might need to heal if we recall
- anger_modifier = Clamp(((maxHealth - health) / 42),0,50)
+ anger_modifier = CLAMP(((maxHealth - health) / 42),0,50)
burst_range = initial(burst_range) + round(anger_modifier * 0.08)
beam_range = initial(beam_range) + round(anger_modifier * 0.12)
diff --git a/code/modules/mob/living/simple_animal/hostile/netherworld.dm b/code/modules/mob/living/simple_animal/hostile/netherworld.dm
new file mode 100644
index 0000000000..67a565f945
--- /dev/null
+++ b/code/modules/mob/living/simple_animal/hostile/netherworld.dm
@@ -0,0 +1,103 @@
+/mob/living/simple_animal/hostile/netherworld
+ name = "creature"
+ desc = "A sanity-destroying otherthing from the netherworld."
+ icon_state = "otherthing"
+ icon_living = "otherthing"
+ icon_dead = "otherthing-dead"
+ health = 80
+ maxHealth = 80
+ obj_damage = 100
+ melee_damage_lower = 25
+ melee_damage_upper = 50
+ attacktext = "slashes"
+ attack_sound = 'sound/weapons/bladeslice.ogg'
+ faction = list("creature")
+ speak_emote = list("screams")
+ gold_core_spawnable = HOSTILE_SPAWN
+ atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
+ minbodytemp = 0
+ faction = list("nether")
+
+/mob/living/simple_animal/hostile/netherworld/migo
+ name = "mi-go"
+ desc = "A pinkish, fungoid crustacean-like creature with numerous pairs of clawed appendages and a head covered with waving antennae."
+ speak_emote = list("screams", "clicks", "chitters", "barks", "moans", "growls", "meows", "reverberates", "roars", "squeaks", "rattles", "exclaims", "yells", "remarks", "mumbles", "jabbers", "stutters", "seethes")
+ icon_state = "mi-go"
+ icon_living = "mi-go"
+ icon_dead = "mi-go-dead"
+ attacktext = "lacerates"
+ speed = -0.5
+ var/static/list/migo_sounds
+ deathmessage = "wails as its form turns into a pulpy mush."
+ death_sound = 'sound/voice/hiss6.ogg'
+
+/mob/living/simple_animal/hostile/netherworld/migo/Initialize()
+ . = ..()
+ migo_sounds = list('sound/items/bubblewrap.ogg', 'sound/items/change_jaws.ogg', 'sound/items/crowbar.ogg', 'sound/items/drink.ogg', 'sound/items/deconstruct.ogg', 'sound/items/carhorn.ogg', 'sound/items/change_drill.ogg', 'sound/items/dodgeball.ogg', 'sound/items/eatfood.ogg', 'sound/items/megaphone.ogg', 'sound/items/screwdriver.ogg', 'sound/items/weeoo1.ogg', 'sound/items/wirecutter.ogg', 'sound/items/welder.ogg', 'sound/items/zip.ogg', 'sound/items/rped.ogg', 'sound/items/ratchet.ogg', 'sound/items/polaroid1.ogg', 'sound/items/pshoom.ogg', 'sound/items/airhorn.ogg', 'sound/items/geiger/high1.ogg', 'sound/items/geiger/high2.ogg', 'sound/voice/bcreep.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/ed209_20sec.ogg', 'sound/voice/hiss3.ogg', 'sound/voice/hiss6.ogg', 'sound/voice/mpatchedup.ogg', 'sound/voice/mfeelbetter.ogg', 'sound/voice/human/manlaugh1.ogg', 'sound/voice/human/womanlaugh.ogg', 'sound/weapons/sear.ogg', 'sound/ambience/antag/clockcultalr.ogg', 'sound/ambience/antag/ling_aler.ogg', 'sound/ambience/antag/tatoralert.ogg', 'sound/ambience/antag/monkey.ogg', 'sound/mecha/nominal.ogg', 'sound/mecha/weapdestr.ogg', 'sound/mecha/critdestr.ogg', 'sound/mecha/imag_enh.ogg', 'sound/effects/adminhelp.ogg', 'sound/effects/alert.ogg', 'sound/effects/attackblob.ogg', 'sound/effects/bamf.ogg', 'sound/effects/blobattack.ogg', 'sound/effects/break_stone.ogg', 'sound/effects/bubbles.ogg', 'sound/effects/bubbles2.ogg', 'sound/effects/clang.ogg', 'sound/effects/clockcult_gateway_disrupted.ogg', 'sound/effects/clownstep2.ogg', 'sound/effects/curse1.ogg', 'sound/effects/dimensional_rend.ogg', 'sound/effects/doorcreaky.ogg', 'sound/effects/empulse.ogg', 'sound/effects/explosion_distant.ogg', 'sound/effects/explosionfar.ogg', 'sound/effects/explosion1.ogg', 'sound/effects/grillehit.ogg', 'sound/effects/genetics.ogg', 'sound/effects/heart_beat.ogg', 'sound/effects/hyperspace_begin.ogg', 'sound/effects/hyperspace_end.ogg', 'sound/effects/his_grace_awaken.ogg', 'sound/effects/pai_boot.ogg', 'sound/effects/phasein.ogg', 'sound/effects/picaxe1.ogg', 'sound/effects/ratvar_reveal.ogg', 'sound/effects/sparks1.ogg', 'sound/effects/smoke.ogg', 'sound/effects/splat.ogg', 'sound/effects/snap.ogg', 'sound/effects/tendril_destroyed.ogg', 'sound/effects/supermatter.ogg', 'sound/misc/desceration-01.ogg', 'sound/misc/desceration-02.ogg', 'sound/misc/desceration-03.ogg', 'sound/misc/bloblarm.ogg', 'sound/misc/airraid.ogg', 'sound/misc/bang.ogg', 'sound/misc/disco.ogg', 'sound/misc/highlander.ogg', 'sound/misc/interference.ogg', 'sound/misc/notice1.ogg', 'sound/misc/notice2.ogg', 'sound/misc/sadtrombone.ogg', 'sound/misc/slip.ogg', 'sound/misc/splort.ogg', 'sound/weapons/armbomb.ogg', 'sound/weapons/beam_sniper.ogg', 'sound/weapons/chainsawhit.ogg', 'sound/weapons/emitter.ogg', 'sound/weapons/emitter2.ogg', 'sound/weapons/blade1.ogg', 'sound/weapons/bladeslice.ogg', 'sound/weapons/blastcannon.ogg', 'sound/weapons/blaster.ogg', 'sound/weapons/bulletflyby3.ogg', 'sound/weapons/circsawhit.ogg', 'sound/weapons/cqchit2.ogg', 'sound/weapons/drill.ogg', 'sound/weapons/genhit1.ogg', 'sound/weapons/gunshot_silenced.ogg', 'sound/weapons/gunshot2.ogg', 'sound/weapons/handcuffs.ogg', 'sound/weapons/homerun.ogg', 'sound/weapons/kenetic_accel.ogg', 'sound/machines/clockcult/steam_whoosh.ogg', 'sound/machines/fryer/deep_fryer_emerge.ogg', 'sound/machines/airlock.ogg', 'sound/machines/airlock_alien_prying.ogg', 'sound/machines/airlockclose.ogg', 'sound/machines/airlockforced.ogg', 'sound/machines/airlockopen.ogg', 'sound/machines/alarm.ogg', 'sound/machines/blender.ogg', 'sound/machines/boltsdown.ogg', 'sound/machines/boltsup.ogg', 'sound/machines/buzz-sigh.ogg', 'sound/machines/buzz-two.ogg', 'sound/machines/chime.ogg', 'sound/machines/cryo_warning.ogg', 'sound/machines/defib_charge.ogg', 'sound/machines/defib_failed.ogg', 'sound/machines/defib_ready.ogg', 'sound/machines/defib_zap.ogg', 'sound/machines/deniedbeep.ogg', 'sound/machines/ding.ogg', 'sound/machines/disposalflush.ogg', 'sound/machines/door_close.ogg', 'sound/machines/door_open.ogg', 'sound/machines/engine_alert1.ogg', 'sound/machines/engine_alert2.ogg', 'sound/machines/hiss.ogg', 'sound/machines/honkbot_evil_laugh.ogg', 'sound/machines/juicer.ogg', 'sound/machines/ping.ogg', 'sound/machines/signal.ogg', 'sound/machines/synth_no.ogg', 'sound/machines/synth_yes.ogg', 'sound/machines/terminal_alert.ogg', 'sound/machines/triple_beep.ogg', 'sound/machines/twobeep.ogg', 'sound/machines/ventcrawl.ogg', 'sound/machines/warning-buzzer.ogg', 'sound/ai/outbreak5.ogg', 'sound/ai/outbreak7.ogg', 'sound/ai/poweroff.ogg', 'sound/ai/radiation.ogg', 'sound/ai/shuttlecalled.ogg', 'sound/ai/shuttledock.ogg', 'sound/ai/shuttlerecalled.ogg', 'sound/ai/aimalf.ogg') //hahahaha fuck you code divers
+
+/mob/living/simple_animal/hostile/netherworld/migo/say(message)
+ ..()
+ if(stat)
+ return
+ var/chosen_sound = pick(migo_sounds)
+ playsound(src, chosen_sound, 100, TRUE)
+
+/mob/living/simple_animal/hostile/netherworld/migo/Life()
+ ..()
+ if(stat)
+ return
+ if(prob(10))
+ var/chosen_sound = pick(migo_sounds)
+ playsound(src, chosen_sound, 100, TRUE)
+
+/mob/living/simple_animal/hostile/netherworld/blankbody
+ name = "blank body"
+ desc = "This looks human enough, but its flesh has an ashy texture, and it's face is featureless save an eerie smile."
+ icon_state = "blank-body"
+ icon_living = "blank-body"
+ icon_dead = "blank-dead"
+ gold_core_spawnable = NO_SPAWN
+ health = 100
+ maxHealth = 100
+ melee_damage_lower = 5
+ melee_damage_upper = 10
+ attacktext = "punches"
+ deathmessage = "falls apart into a fine dust."
+
+/mob/living/simple_animal/hostile/spawner/nether
+ name = "netherworld link"
+ desc = "A direct link to another dimension full of creatures not very happy to see you. Entering the link would be a very bad idea."
+ icon_state = "nether"
+ icon_living = "nether"
+ health = 50
+ maxHealth = 50
+ spawn_time = 50 //5 seconds
+ max_mobs = 15
+ icon = 'icons/mob/nest.dmi'
+ spawn_text = "crawls through"
+ mob_type = /mob/living/simple_animal/hostile/netherworld/migo
+ atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
+ faction = list("nether")
+ deathmessage = "shatters into oblivion."
+ del_on_death = TRUE
+
+/mob/living/simple_animal/hostile/spawner/nether/attack_hand(mob/user)
+ user.visible_message("[user] is violently pulled into the link!", \
+ "Touching the portal, you are quickly pulled through into a world of unimaginable horror!")
+ contents.Add(user)
+
+/mob/living/simple_animal/hostile/spawner/nether/Life()
+ ..()
+ var/list/C = src.get_contents()
+ for(var/mob/living/M in C)
+ if(M)
+ playsound(src, 'sound/magic/demon_consume.ogg', 50, 1)
+ M.adjustBruteLoss(60)
+ new /obj/effect/gibspawner/human(get_turf(M))
+ if(M.stat == DEAD)
+ var/mob/living/simple_animal/hostile/netherworld/blankbody/blank
+ blank = new(loc)
+ blank.name = "[M]"
+ blank.desc = "It's [M], but their flesh has an ashy texture, and their face is featureless save an eerie smile."
+ src.visible_message("[M] reemerges from the link!")
+ qdel(M)
diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm
index 681f36e6d9..e4de22b2a7 100644
--- a/code/modules/mob/living/simple_animal/parrot.dm
+++ b/code/modules/mob/living/simple_animal/parrot.dm
@@ -127,7 +127,7 @@
/mob/living/simple_animal/parrot/death(gibbed)
if(held_item)
- held_item.loc = src.loc
+ held_item.forceMove(drop_location())
held_item = null
walk(src,0)
@@ -702,7 +702,7 @@
continue
held_item = I
- I.loc = src
+ I.forceMove(src)
visible_message("[src] grabs [held_item]!", "You grab [held_item]!", "You hear the sounds of wings flapping furiously.")
return held_item
@@ -777,7 +777,7 @@
if(!drop_gently)
if(istype(held_item, /obj/item/grenade))
var/obj/item/grenade/G = held_item
- G.loc = src.loc
+ G.forceMove(drop_location())
G.prime()
to_chat(src, "You let go of [held_item]!")
held_item = null
@@ -785,7 +785,7 @@
to_chat(src, "You drop [held_item].")
- held_item.loc = src.loc
+ held_item.forceMove(drop_location())
held_item = null
return 1
@@ -801,7 +801,7 @@
for(var/atom/movable/AM in view(src,1))
for(var/perch_path in desired_perches)
if(istype(AM, perch_path))
- src.loc = AM.loc
+ src.forceMove(AM.loc)
icon_state = icon_sit
return
to_chat(src, "There is no perch nearby to sit on!")
@@ -838,7 +838,7 @@
/mob/living/simple_animal/parrot/proc/perch_on_human(mob/living/carbon/human/H)
if(!H)
return
- loc = get_turf(H)
+ forceMove(get_turf(H))
H.buckle_mob(src, force=1)
pixel_y = 9
pixel_x = pick(-8,8) //pick left or right shoulder
@@ -996,7 +996,7 @@
return
var/datum/disease/parrot_possession/P = new
P.parrot = src
- loc = H
+ forceMove(H)
H.ForceContractDisease(P)
parrot_interest = null
H.visible_message("[src] dive bombs into [H]'s chest and vanishes!", "[src] dive bombs into your chest, vanishing! This can't be good!")
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index a4851bb432..4c5b94f2e3 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -111,7 +111,7 @@
/mob/living/simple_animal/updatehealth()
..()
- health = Clamp(health, 0, maxHealth)
+ health = CLAMP(health, 0, maxHealth)
/mob/living/simple_animal/update_stat()
if(status_flags & GODMODE)
diff --git a/code/modules/mob/living/simple_animal/slime/powers.dm b/code/modules/mob/living/simple_animal/slime/powers.dm
index e7e71bf091..9654f91b6c 100644
--- a/code/modules/mob/living/simple_animal/slime/powers.dm
+++ b/code/modules/mob/living/simple_animal/slime/powers.dm
@@ -166,7 +166,7 @@
step_away(M,src)
M.Friends = Friends.Copy()
babies += M
- M.mutation_chance = Clamp(mutation_chance+(rand(5,-5)),0,100)
+ M.mutation_chance = CLAMP(mutation_chance+(rand(5,-5)),0,100)
SSblackbox.record_feedback("tally", "slime_babies_born", 1, M.colour)
var/mob/living/simple_animal/slime/new_slime = pick(babies)
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index 3dc56c936b..747d589c05 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -363,7 +363,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
if(M.mind in SSticker.mode.cult)
return 2
if("nuclear")
- if(M.mind in SSticker.mode.syndicates)
+ if(M.mind.has_antag_datum(/datum/antagonist/nukeop,TRUE))
return 2
if("changeling")
if(M.mind.has_antag_datum(/datum/antagonist/changeling,TRUE))
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index 9885d1c4d6..94431a9a7c 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -107,7 +107,7 @@
return
mob.control_object.setDir(direct)
else
- mob.control_object.loc = get_step(mob.control_object,direct)
+ mob.control_object.forceMove(get_step(mob.control_object,direct))
return
#define MOVEMENT_DELAY_BUFFER 0.75
@@ -186,7 +186,7 @@
if(LAZYLEN(mob.user_movement_hooks))
for(var/obj/O in mob.user_movement_hooks)
O.intercept_user_move(direct, mob, n, oldloc)
-
+
var/atom/movable/P = mob.pulling
if(P && !ismob(P) && P.density)
mob.dir = turn(mob.dir, 180)
diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm
index 534307f727..42a1ce725f 100644
--- a/code/modules/mob/transform_procs.dm
+++ b/code/modules/mob/transform_procs.dm
@@ -58,7 +58,6 @@
O.suiciding = suiciding
if(hellbound)
O.hellbound = hellbound
- O.loc = loc
O.a_intent = INTENT_HARM
//keep viruses?
@@ -113,7 +112,7 @@
var/obj/item/bodypart/chest/torso = O.get_bodypart("chest")
if(cavity_object)
torso.cavity_item = cavity_object //cavity item is given to the new chest
- cavity_object.loc = O
+ cavity_object.forceMove(O)
for(var/missing_zone in missing_bodyparts_zones)
var/obj/item/bodypart/BP = O.get_bodypart(missing_zone)
@@ -220,8 +219,6 @@
if(hellbound)
O.hellbound = hellbound
- O.loc = loc
-
//keep viruses?
if (tr_flags & TR_KEEPVIRUS)
O.viruses = viruses
@@ -276,7 +273,7 @@
var/obj/item/bodypart/chest/torso = get_bodypart("chest")
if(cavity_object)
torso.cavity_item = cavity_object //cavity item is given to the new chest
- cavity_object.loc = O
+ cavity_object.forceMove(O)
for(var/missing_zone in missing_bodyparts_zones)
var/obj/item/bodypart/BP = O.get_bodypart(missing_zone)
@@ -401,7 +398,6 @@
R.mmi.brainmob.real_name = real_name //the name of the brain inside the cyborg is the robotized human's name.
R.mmi.brainmob.name = real_name
- R.loc = loc
R.job = "Cyborg"
R.notify_ai(NEW_BORG)
diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm
index d9d220b0ef..e8487b3344 100644
--- a/code/modules/paperwork/clipboard.dm
+++ b/code/modules/paperwork/clipboard.dm
@@ -73,7 +73,7 @@
if(href_list["pen"])
if(haspen)
- haspen.loc = usr.loc
+ haspen.forceMove(usr.loc)
usr.put_in_hands(haspen)
haspen = null
@@ -96,7 +96,7 @@
if(href_list["remove"])
var/obj/item/P = locate(href_list["remove"])
if(istype(P) && P.loc == src)
- P.loc = usr.loc
+ P.forceMove(usr.loc)
usr.put_in_hands(P)
if(P == toppaper)
toppaper = null
diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm
index 3221a2c8db..c81ab37591 100644
--- a/code/modules/paperwork/folders.dm
+++ b/code/modules/paperwork/folders.dm
@@ -62,7 +62,7 @@
if(href_list["remove"])
var/obj/item/I = locate(href_list["remove"])
if(istype(I) && I.loc == src)
- I.loc = usr.loc
+ I.forceMove(usr.loc)
usr.put_in_hands(I)
if(href_list["read"])
diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm
index 0826a49c7c..fd52d8f0ac 100644
--- a/code/modules/paperwork/pen.dm
+++ b/code/modules/paperwork/pen.dm
@@ -23,6 +23,7 @@
throw_range = 7
materials = list(MAT_METAL=10)
pressure_resistance = 2
+ grind_results = list("iron" = 2, "iodine" = 1)
var/colour = "black" //what colour the ink is!
var/traitor_unlock_degrees = 0
var/degrees = 0
@@ -174,7 +175,8 @@
reagents.trans_to(M, reagents.total_volume)
-/obj/item/pen/sleepy/New()
+/obj/item/pen/sleepy/Initialize()
+ . = ..()
create_reagents(45)
reagents.add_reagent("chloralhydrate2", 20)
reagents.add_reagent("mutetoxin", 15)
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index 20038f5745..e065fd8c03 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -247,10 +247,10 @@
/obj/machinery/photocopier/proc/remove_photocopy(obj/item/O, mob/user)
if(!issilicon(user)) //surprised this check didn't exist before, putting stuff in AI's hand is bad
- O.loc = user.loc
+ O.forceMove(user.loc)
user.put_in_hands(O)
else
- O.loc = src.loc
+ O.forceMove(drop_location())
to_chat(user, "You take [O] out of [src].")
/obj/machinery/photocopier/attackby(obj/item/O, mob/user, params)
@@ -338,16 +338,16 @@
else
user.visible_message("[user] puts [target] onto the photocopier!", "You put [target] onto the photocopier.")
- target.loc = get_turf(src)
+ target.forceMove(drop_location())
ass = target
if(photocopy)
- photocopy.loc = src.loc
+ photocopy.forceMove(drop_location())
visible_message("[photocopy] is shoved out of the way by [ass]!")
photocopy = null
else if(copy)
- copy.loc = src.loc
+ copy.forceMove(drop_location())
visible_message("[copy] is shoved out of the way by [ass]!")
copy = null
updateUsrDialog()
@@ -391,5 +391,6 @@
/obj/item/device/toner
name = "toner cartridge"
icon_state = "tonercartridge"
+ grind_results = list("iodine" = 40, "iron" = 10)
var/charges = 5
var/max_charges = 5
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index 48b045f680..6e908c0f6a 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -33,6 +33,7 @@
w_class = WEIGHT_CLASS_TINY
resistance_flags = FLAMMABLE
max_integrity = 50
+ grind_results = list("iodine" = 4)
var/icon/img //Big photo image
var/scribble //Scribble on the back.
var/blueprints = 0 //Does it include the blueprints?
diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm
index a37344d635..f8b8cae22a 100644
--- a/code/modules/power/antimatter/control.dm
+++ b/code/modules/power/antimatter/control.dm
@@ -339,7 +339,7 @@
if(href_list["ejectjar"])
if(fueljar)
- fueljar.loc = src.loc
+ fueljar.forceMove(drop_location())
fueljar = null
//fueljar.control_unit = null currently it does not care where it is
//update_icon() when we have the icon for it
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 7f3b428978..548651f9c8 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -153,7 +153,7 @@
GLOB.apcs_list -= src
if(malfai && operating)
- malfai.malf_picker.processing_time = Clamp(malfai.malf_picker.processing_time - 10,0,1000)
+ malfai.malf_picker.processing_time = CLAMP(malfai.malf_picker.processing_time - 10,0,1000)
area.power_light = FALSE
area.power_equip = FALSE
area.power_environ = FALSE
@@ -972,7 +972,7 @@
else
to_chat(occupier, "Primary core damaged, unable to return core processes.")
if(forced)
- occupier.loc = src.loc
+ occupier.forceMove(drop_location())
occupier.death()
occupier.gib()
for(var/obj/item/pinpointer/nuke/P in GLOB.pinpointer_list)
@@ -1253,7 +1253,7 @@
/obj/machinery/power/apc/proc/set_broken()
if(malfai && operating)
- malfai.malf_picker.processing_time = Clamp(malfai.malf_picker.processing_time - 10,0,1000)
+ malfai.malf_picker.processing_time = CLAMP(malfai.malf_picker.processing_time - 10,0,1000)
stat |= BROKEN
operating = FALSE
if(occupier)
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 9e4e29ceb5..ca424cb80d 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -427,7 +427,7 @@ By design, d1 is the smallest direction and d2 is the highest
var/obj/O = P_list[1]
// remove the cut cable from its turf and powernet, so that it doesn't get count in propagate_network worklist
if(remove)
- loc = null
+ moveToNullspace()
powernet.remove_cable(src) //remove the cut cable from its powernet
addtimer(CALLBACK(O, .proc/auto_propogate_cut_cable, O), 0) //so we don't rebuild the network X times when singulo/explosion destroys a line of X cables
@@ -472,6 +472,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
attack_verb = list("whipped", "lashed", "disciplined", "flogged")
singular_name = "cable piece"
full_w_class = WEIGHT_CLASS_SMALL
+ grind_results = list("copper" = 2) //2 copper per cable in the coil
/obj/item/stack/cable_coil/cyborg
is_cyborg = 1
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index 1e1407e852..cd24dbb928 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -14,6 +14,7 @@
var/charge = 0 // note %age conveted to actual charge in New
var/maxcharge = 1000
materials = list(MAT_METAL=700, MAT_GLASS=50)
+ grind_results = list("lithium" = 15, "iron" = 5, "silicon" = 5)
var/rigged = 0 // true if rigged to explode
var/chargerate = 100 //how much power is given every tick in a recharger
var/self_recharge = 0 //does it self recharge, over time, or not?
@@ -107,6 +108,7 @@
to_chat(user, "You inject the solution into the power cell.")
if(S.reagents.has_reagent("plasma", 5))
rigged = 1
+ grind_results["plasma"] = 5
S.reagents.clear_reagents()
@@ -155,7 +157,7 @@
/obj/item/stock_parts/cell/proc/get_electrocute_damage()
if(charge >= 1000)
- return Clamp(round(charge/10000), 10, 90) + rand(-5,5)
+ return CLAMP(round(charge/10000), 10, 90) + rand(-5,5)
else
return 0
@@ -334,7 +336,7 @@
return
/obj/item/stock_parts/cell/beam_rifle/emp_act(severity)
- charge = Clamp((charge-(10000/severity)),0,maxcharge)
+ charge = CLAMP((charge-(10000/severity)),0,maxcharge)
/obj/item/stock_parts/cell/emergency_light
name = "miniature power cell"
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index 3acac6cee5..749dcb463e 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -680,6 +680,7 @@
var/base_state
var/switchcount = 0 // number of times switched
materials = list(MAT_GLASS=100)
+ grind_results = list("silicon" = 5, "nitrogen" = 10) //Nitrogen is used as a cheaper alternative to argon in incandescent lighbulbs
var/rigged = 0 // true if rigged to explode
var/brightness = 2 //how much light it gives off
diff --git a/code/modules/power/powernet.dm b/code/modules/power/powernet.dm
index b6f61103ca..c34edc53f3 100644
--- a/code/modules/power/powernet.dm
+++ b/code/modules/power/powernet.dm
@@ -94,6 +94,6 @@
/datum/powernet/proc/get_electrocute_damage()
if(avail >= 1000)
- return Clamp(round(avail/10000), 10, 90) + rand(-5,5)
+ return CLAMP(round(avail/10000), 10, 90) + rand(-5,5)
else
return 0
\ No newline at end of file
diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm
index 0ede336ef6..a5e9db1fde 100644
--- a/code/modules/power/singularity/collector.dm
+++ b/code/modules/power/singularity/collector.dm
@@ -37,7 +37,7 @@
eject()
else
loaded_tank.air_contents.gases[/datum/gas/plasma][MOLES] -= 0.001*drainratio
- ASSERT_GAS(/datum/gas/tritium,loaded_tank.air_contents)
+ loaded_tank.air_contents.assert_gas(/datum/gas/tritium)
loaded_tank.air_contents.gases[/datum/gas/tritium][MOLES] += 0.001*drainratio
loaded_tank.air_contents.garbage_collect()
@@ -132,7 +132,7 @@
var/obj/item/tank/internals/plasma/Z = src.loaded_tank
if (!Z)
return
- Z.loc = get_turf(src)
+ Z.forceMove(drop_location())
Z.layer = initial(Z.layer)
Z.plane = initial(Z.plane)
src.loaded_tank = null
diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm
index 74aa140721..cdfbb35b34 100644
--- a/code/modules/power/singularity/field_generator.dm
+++ b/code/modules/power/singularity/field_generator.dm
@@ -285,9 +285,8 @@ field_generator power level display
var/field_dir = get_dir(T,get_step(G.loc, NSEW))
T = get_step(T, NSEW)
if(!locate(/obj/machinery/field/containment) in T)
- var/obj/machinery/field/containment/CF = new/obj/machinery/field/containment()
+ var/obj/machinery/field/containment/CF = new(T)
CF.set_master(src,G)
- CF.loc = T
CF.setDir(field_dir)
fields += CF
G.fields += CF
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 70776b5c05..95b78ff0b5 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -227,7 +227,7 @@
/obj/machinery/power/smes/proc/chargedisplay()
- return Clamp(round(5.5*charge/capacity),0,5)
+ return CLAMP(round(5.5*charge/capacity),0,5)
/obj/machinery/power/smes/process()
if(stat & BROKEN)
@@ -382,7 +382,7 @@
target = text2num(target)
. = TRUE
if(.)
- input_level = Clamp(target, 0, input_level_max)
+ input_level = CLAMP(target, 0, input_level_max)
log_smes(usr.ckey)
if("output")
var/target = params["target"]
@@ -404,7 +404,7 @@
target = text2num(target)
. = TRUE
if(.)
- output_level = Clamp(target, 0, output_level_max)
+ output_level = CLAMP(target, 0, output_level_max)
log_smes(usr.ckey)
/obj/machinery/power/smes/proc/log_smes(user = "")
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index fb530f128f..af81b632d7 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -378,14 +378,14 @@
if("direction")
var/adjust = text2num(params["adjust"])
if(adjust)
- currentdir = Clamp((360 + adjust + currentdir) % 360, 0, 359)
+ currentdir = CLAMP((360 + adjust + currentdir) % 360, 0, 359)
targetdir = currentdir
set_panels(currentdir)
. = TRUE
if("rate")
var/adjust = text2num(params["adjust"])
if(adjust)
- trackrate = Clamp(trackrate + adjust, -7200, 7200)
+ trackrate = CLAMP(trackrate + adjust, -7200, 7200)
if(trackrate)
nexttime = world.time + 36000 / abs(trackrate)
. = TRUE
@@ -419,7 +419,7 @@
new /obj/item/shard( src.loc )
var/obj/item/circuitboard/computer/solar_control/M = new /obj/item/circuitboard/computer/solar_control( A )
for (var/obj/C in src)
- C.loc = src.loc
+ C.forceMove(drop_location())
A.circuit = M
A.state = 3
A.icon_state = "3"
@@ -430,7 +430,7 @@
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer( src.loc )
var/obj/item/circuitboard/computer/solar_control/M = new /obj/item/circuitboard/computer/solar_control( A )
for (var/obj/C in src)
- C.loc = src.loc
+ C.forceMove(drop_location())
A.circuit = M
A.state = 4
A.icon_state = "4"
diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm
index 02cc80291e..5f9f6042d3 100644
--- a/code/modules/power/supermatter/supermatter.dm
+++ b/code/modules/power/supermatter/supermatter.dm
@@ -317,10 +317,10 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
mole_heat_penalty = max(combined_gas / MOLE_HEAT_PENALTY, 0.25)
if (combined_gas > POWERLOSS_INHIBITION_MOLE_THRESHOLD && co2comp > POWERLOSS_INHIBITION_GAS_THRESHOLD)
- powerloss_dynamic_scaling = Clamp(powerloss_dynamic_scaling + Clamp(co2comp - powerloss_dynamic_scaling, -0.02, 0.02), 0, 1)
+ powerloss_dynamic_scaling = CLAMP(powerloss_dynamic_scaling + CLAMP(co2comp - powerloss_dynamic_scaling, -0.02, 0.02), 0, 1)
else
- powerloss_dynamic_scaling = Clamp(powerloss_dynamic_scaling - 0.05,0, 1)
- powerloss_inhibitor = Clamp(1-(powerloss_dynamic_scaling * Clamp(combined_gas/POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD,1 ,1.5)),0 ,1)
+ powerloss_dynamic_scaling = CLAMP(powerloss_dynamic_scaling - 0.05,0, 1)
+ powerloss_inhibitor = CLAMP(1-(powerloss_dynamic_scaling * CLAMP(combined_gas/POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD,1 ,1.5)),0 ,1)
if(matter_power)
var/removed_matter = max(matter_power/MATTER_POWER_CONVERSION, 40)
@@ -368,7 +368,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
var/D = sqrt(1 / max(1, get_dist(l, src)))
l.hallucination += power * config_hallucination_power * D
- l.hallucination = Clamp(0, 200, l.hallucination)
+ l.hallucination = CLAMP(0, 200, l.hallucination)
for(var/mob/living/l in range(src, round((power / 100) ** 0.25)))
var/rads = (power / 10) * sqrt( 1 / max(get_dist(l, src),1) )
@@ -386,7 +386,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
supermatter_zap(src, 5, min(power*2, 20000))
else if (damage > damage_penalty_point && prob(20))
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
- supermatter_zap(src, 5, Clamp(power*2, 4000, 20000))
+ supermatter_zap(src, 5, CLAMP(power*2, 4000, 20000))
if(prob(15) && power > POWER_PENALTY_THRESHOLD)
supermatter_pull(src, power/750)
diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm
index 4a26950217..51cb99a34f 100644
--- a/code/modules/power/tesla/energy_ball.dm
+++ b/code/modules/power/tesla/energy_ball.dm
@@ -62,7 +62,7 @@
pixel_x = -32
pixel_y = -32
for (var/ball in orbiting_balls)
- var/range = rand(1, Clamp(orbiting_balls.len, 3, 7))
+ var/range = rand(1, CLAMP(orbiting_balls.len, 3, 7))
tesla_zap(ball, range, TESLA_MINI_POWER/7*range, TRUE)
else
energy = 0 // ensure we dont have miniballs of miniballs
@@ -268,7 +268,7 @@
closest_grounding_rod.tesla_act(power, explosive, stun_mobs)
else if(closest_mob)
- var/shock_damage = Clamp(round(power/400), 10, 90) + rand(-5, 5)
+ var/shock_damage = CLAMP(round(power/400), 10, 90) + rand(-5, 5)
closest_mob.electrocute_act(shock_damage, source, 1, tesla_shock = 1, stun = stun_mobs)
if(issilicon(closest_mob))
var/mob/living/silicon/S = closest_mob
diff --git a/code/modules/power/tracker.dm b/code/modules/power/tracker.dm
index 5e129acf8f..a46627b7ca 100644
--- a/code/modules/power/tracker.dm
+++ b/code/modules/power/tracker.dm
@@ -47,7 +47,7 @@
S.glass_type = /obj/item/stack/sheet/glass
S.tracker = 1
S.anchored = TRUE
- S.loc = src
+ S.forceMove(src)
update_icon()
//updates the tracker icon and the facing angle for the control computer
@@ -94,4 +94,4 @@
// Tracker Electronic
/obj/item/electronics/tracker
- name = "tracker electronics"
\ No newline at end of file
+ name = "tracker electronics"
diff --git a/code/modules/projectiles/ammunition/caseless.dm b/code/modules/projectiles/ammunition/caseless.dm
index e5b905019d..7432f9f8e7 100644
--- a/code/modules/projectiles/ammunition/caseless.dm
+++ b/code/modules/projectiles/ammunition/caseless.dm
@@ -7,7 +7,7 @@
/obj/item/ammo_casing/caseless/fire_casing(atom/target, mob/living/user, params, distro, quiet, zone_override, spread)
if (..()) //successfully firing
- loc = null
+ moveToNullspace()
return 1
else
return 0
diff --git a/code/modules/projectiles/box_magazine.dm b/code/modules/projectiles/box_magazine.dm
index 324470ede4..0e6ab6c23f 100644
--- a/code/modules/projectiles/box_magazine.dm
+++ b/code/modules/projectiles/box_magazine.dm
@@ -87,7 +87,7 @@
if(num_loaded)
if(!silent)
to_chat(user, "You load [num_loaded] shell\s into \the [src]!")
- playsound(user, 'sound/weapons/bulletinsert.ogg', 60, 1)
+ playsound(src, 'sound/weapons/bulletinsert.ogg', 60, 1)
A.update_icon()
update_icon()
@@ -98,7 +98,7 @@
if(A)
user.put_in_hands(A)
to_chat(user, "You remove a round from \the [src]!")
- playsound(user, 'sound/weapons/bulletremove.ogg', 60, 1)
+ playsound(A, 'sound/weapons/bulletremove.ogg', 60, 1)
update_icon()
/obj/item/ammo_box/update_icon()
diff --git a/code/modules/projectiles/boxes_magazines/external_mag.dm b/code/modules/projectiles/boxes_magazines/external_mag.dm
index 09ae7cb905..b7b3a3e286 100644
--- a/code/modules/projectiles/boxes_magazines/external_mag.dm
+++ b/code/modules/projectiles/boxes_magazines/external_mag.dm
@@ -176,7 +176,7 @@
/obj/item/ammo_box/magazine/m12g/update_icon()
..()
- icon_state = "[initial(icon_state)]-[Ceiling(ammo_count(0)/8)*8]"
+ icon_state = "[initial(icon_state)]-[CEILING(ammo_count(0)/8, 1)*8]"
/obj/item/ammo_box/magazine/m12g/buckshot
name = "shotgun magazine (12g buckshot slugs)"
diff --git a/code/modules/projectiles/boxes_magazines/internal_mag.dm b/code/modules/projectiles/boxes_magazines/internal_mag.dm
index 3a8b4e6f2f..f486be732d 100644
--- a/code/modules/projectiles/boxes_magazines/internal_mag.dm
+++ b/code/modules/projectiles/boxes_magazines/internal_mag.dm
@@ -51,10 +51,10 @@
var/obj/item/ammo_casing/bullet = stored_ammo[i]
if(!bullet || !bullet.BB) // found a spent ammo
stored_ammo[i] = R
- R.loc = src
+ R.forceMove(src)
if(bullet)
- bullet.loc = get_turf(src.loc)
+ bullet.forceMove(drop_location())
return 1
return 0
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 37e868462e..ff7ed7653e 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -77,9 +77,8 @@
..()
var/obj/item/gun/G = locate(/obj/item/gun) in contents
if(G)
- G.loc = loc
- qdel(G.pin)
- G.pin = null
+ G.forceMove(loc)
+ QDEL_NULL(G.pin)
visible_message("[G] can now fit a new pin, but the old one was destroyed in the process.", null, null, 3)
qdel(src)
@@ -108,7 +107,7 @@
/obj/item/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
to_chat(user, "*click*")
- playsound(src, "gun_dry_fire", 50, 1)
+ playsound(src, "gun_dry_fire", 30, 1)
/obj/item/gun/proc/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm
index bfc9ceac64..c4ba7a33b7 100644
--- a/code/modules/projectiles/guns/ballistic.dm
+++ b/code/modules/projectiles/guns/ballistic.dm
@@ -30,8 +30,9 @@
var/obj/item/ammo_casing/AC = chambered //Find chambered round
if(istype(AC)) //there's a chambered round
if(casing_ejector)
- AC.forceMove(get_turf(src)) //Eject casing onto ground.
+ AC.forceMove(drop_location()) //Eject casing onto ground.
AC.SpinAnimation(10, 1) //next gen special effects
+ addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, AC, 'sound/weapons/bulletremove.ogg', 60, 1), 3)
chambered = null
else if(empty_chamber)
chambered = null
@@ -58,7 +59,13 @@
if(user.transferItemToLoc(AM, src))
magazine = AM
to_chat(user, "You load a new magazine into \the [src].")
- chamber_round()
+ if(magazine.ammo_count())
+ playsound(src, "gun_insert_full_magazine", 70, 1)
+ if(!chambered)
+ chamber_round()
+ addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, src, 'sound/weapons/gun_chamber_round.ogg', 100, 1), 3)
+ else
+ playsound(src, "gun_insert_empty_magazine", 70, 1)
A.update_icon()
update_icon()
return 1
@@ -107,16 +114,22 @@
/obj/item/gun/ballistic/attack_self(mob/living/user)
var/obj/item/ammo_casing/AC = chambered //Find chambered round
if(magazine)
- magazine.loc = get_turf(src.loc)
+ magazine.forceMove(drop_location())
user.put_in_hands(magazine)
magazine.update_icon()
+ if(magazine.ammo_count())
+ playsound(src, "sound/weapons/gun_magazine_remove_full.ogg", 70, 1)
+ else
+ playsound(src, "gun_remove_empty_magazine", 70, 1)
magazine = null
to_chat(user, "You pull the magazine out of \the [src].")
else if(chambered)
- AC.loc = get_turf(src)
+ AC.forceMove(drop_location())
AC.SpinAnimation(10, 1)
+ addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, AC, 'sound/weapons/bulletremove.ogg', 60, 1), 3)
chambered = null
to_chat(user, "You unload the round from \the [src]'s chamber.")
+ playsound(src, "gun_slide_lock", 70, 1)
else
to_chat(user, "There's no magazine in \the [src].")
update_icon()
@@ -162,7 +175,7 @@
return(OXYLOSS)
else
user.visible_message("[user] is pretending to blow [user.p_their()] brain[user.p_s()] out with [src]! It looks like [user.p_theyre()] trying to commit suicide!")
- playsound(src, "gun_dry_fire", 50, 1)
+ playsound(src, "gun_dry_fire", 30, 1)
return (OXYLOSS)
#undef BRAINS_BLOWN_THROW_SPEED
#undef BRAINS_BLOWN_THROW_RANGE
@@ -216,4 +229,3 @@
desc = "A foreign knock-off suppressor, it feels flimsy, cheap, and brittle. Still fits all weapons."
icon = 'icons/obj/guns/projectile.dmi'
icon_state = "suppressor"
-
diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm
index eb36608e77..9724f9be01 100644
--- a/code/modules/projectiles/guns/ballistic/automatic.dm
+++ b/code/modules/projectiles/guns/ballistic/automatic.dm
@@ -108,7 +108,7 @@
/obj/item/gun/ballistic/automatic/c20r/update_icon()
..()
- icon_state = "c20r[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
+ icon_state = "c20r[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
/obj/item/gun/ballistic/automatic/wt550
name = "security auto rifle"
@@ -123,7 +123,7 @@
/obj/item/gun/ballistic/automatic/wt550/update_icon()
..()
- icon_state = "wt550[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
+ icon_state = "wt550[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""]"
/obj/item/gun/ballistic/automatic/mini_uzi
name = "\improper Type U3 Uzi"
@@ -304,7 +304,7 @@
/obj/item/gun/ballistic/automatic/l6_saw/update_icon()
- icon_state = "l6[cover_open ? "open" : "closed"][magazine ? Ceiling(get_ammo(0)/12.5)*25 : "-empty"][suppressed ? "-suppressed" : ""]"
+ icon_state = "l6[cover_open ? "open" : "closed"][magazine ? CEILING(get_ammo(0)/12.5, 1)*25 : "-empty"][suppressed ? "-suppressed" : ""]"
item_state = "l6[cover_open ? "openmag" : "closedmag"]"
@@ -325,7 +325,7 @@
else if(cover_open && magazine)
//drop the mag
magazine.update_icon()
- magazine.loc = get_turf(src.loc)
+ magazine.forceMove(drop_location())
user.put_in_hands(magazine)
magazine = null
update_icon()
@@ -415,5 +415,5 @@
/obj/item/gun/ballistic/automatic/laser/update_icon()
..()
- icon_state = "oldrifle[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
+ icon_state = "oldrifle[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""]"
return
diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm
index 42f4fb8a05..f642a94284 100644
--- a/code/modules/projectiles/guns/ballistic/revolver.dm
+++ b/code/modules/projectiles/guns/ballistic/revolver.dm
@@ -39,13 +39,13 @@
var/obj/item/ammo_casing/CB
CB = magazine.get_round(0)
if(CB)
- CB.loc = get_turf(src.loc)
+ CB.forceMove(drop_location())
CB.SpinAnimation(10, 1)
CB.update_icon()
+ addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, CB, 'sound/weapons/bulletremove.ogg', 60, 1), 3)
num_unloaded++
if (num_unloaded)
to_chat(user, "You unload [num_unloaded] shell\s from [src].")
- playsound(user, 'sound/weapons/bulletremove.ogg', 60, 1)
else
to_chat(user, "[src] is empty!")
@@ -229,7 +229,7 @@
return
user.visible_message("*click*")
- playsound(src, "gun_dry_fire", 50, 1)
+ playsound(src, "gun_dry_fire", 30, 1)
/obj/item/gun/ballistic/revolver/russian/proc/shoot_self(mob/living/carbon/human/user, affecting = "head")
user.apply_damage(300, BRUTE, affecting)
@@ -289,7 +289,7 @@
var/obj/item/ammo_casing/CB
CB = magazine.get_round(0)
chambered = null
- CB.loc = get_turf(src.loc)
+ CB.forceMove(drop_location())
CB.update_icon()
num_unloaded++
if (num_unloaded)
diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm
index 650e5ec81f..d3b1815d0b 100644
--- a/code/modules/projectiles/guns/ballistic/shotgun.dm
+++ b/code/modules/projectiles/guns/ballistic/shotgun.dm
@@ -56,8 +56,9 @@
/obj/item/gun/ballistic/shotgun/proc/pump_unload(mob/M)
if(chambered)//We have a shell in the chamber
- chambered.loc = get_turf(src)//Eject casing
- chambered.SpinAnimation(5, 1)
+ chambered.forceMove(drop_location())//Eject casing
+ chambered.SpinAnimation(10, 1)
+ addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, chambered, 'sound/weapons/bulletremove.ogg', 60, 1), 3)
chambered = null
/obj/item/gun/ballistic/shotgun/proc/pump_reload(mob/M)
diff --git a/code/modules/projectiles/guns/beam_rifle.dm b/code/modules/projectiles/guns/beam_rifle.dm
index e1069a6bce..ee8036bf44 100644
--- a/code/modules/projectiles/guns/beam_rifle.dm
+++ b/code/modules/projectiles/guns/beam_rifle.dm
@@ -365,7 +365,7 @@
AC.sync_stats()
/obj/item/gun/energy/beam_rifle/proc/delay_penalty(amount)
- aiming_time_left = Clamp(aiming_time_left + amount, 0, aiming_time)
+ aiming_time_left = CLAMP(aiming_time_left + amount, 0, aiming_time)
/obj/item/ammo_casing/energy/beam_rifle
name = "particle acceleration lens"
@@ -416,11 +416,11 @@
HS_BB.stun = projectile_stun
HS_BB.impact_structure_damage = impact_structure_damage
HS_BB.aoe_mob_damage = aoe_mob_damage
- HS_BB.aoe_mob_range = Clamp(aoe_mob_range, 0, 15) //Badmin safety lock
+ HS_BB.aoe_mob_range = CLAMP(aoe_mob_range, 0, 15) //Badmin safety lock
HS_BB.aoe_fire_chance = aoe_fire_chance
HS_BB.aoe_fire_range = aoe_fire_range
HS_BB.aoe_structure_damage = aoe_structure_damage
- HS_BB.aoe_structure_range = Clamp(aoe_structure_range, 0, 15) //Badmin safety lock
+ HS_BB.aoe_structure_range = CLAMP(aoe_structure_range, 0, 15) //Badmin safety lock
HS_BB.wall_devastate = wall_devastate
HS_BB.wall_pierce_amount = wall_pierce_amount
HS_BB.structure_pierce_amount = structure_piercing
@@ -502,11 +502,11 @@
if(!do_pierce)
return FALSE
if(pierced[target]) //we already pierced them go away
- loc = get_turf(target)
+ forceMove(get_turf(target))
return TRUE
if(isclosedturf(target))
if(wall_pierce++ < wall_pierce_amount)
- loc = target
+ forceMove(target)
if(prob(wall_devastate))
if(iswallturf(target))
var/turf/closed/wall/W = target
@@ -522,7 +522,7 @@
var/obj/O = AM
O.take_damage((impact_structure_damage + aoe_structure_damage) * structure_bleed_coeff * get_damage_coeff(AM), BURN, "energy", FALSE)
pierced[AM] = TRUE
- loc = get_turf(AM)
+ forceMove(AM.drop_location())
structure_pierce++
return TRUE
return FALSE
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 3adadb90eb..b52a56426b 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -130,7 +130,7 @@
..()
if(!automatic_charge_overlays)
return
- var/ratio = Ceiling((cell.charge / cell.maxcharge) * charge_sections)
+ var/ratio = CEILING((cell.charge / cell.maxcharge) * charge_sections, 1)
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
var/iconState = "[icon_state]_charge"
var/itemState = null
@@ -175,7 +175,7 @@
return(OXYLOSS)
else
user.visible_message("[user] is pretending to blow [user.p_their()] brains out with [src]! It looks like [user.p_theyre()] trying to commit suicide!")
- playsound(src, "gun_dry_fire", 50, 1)
+ playsound(src, "gun_dry_fire", 30, 1)
return (OXYLOSS)
diff --git a/code/modules/projectiles/guns/magic/wand.dm b/code/modules/projectiles/guns/magic/wand.dm
index 27fb040de4..bf3ade0748 100644
--- a/code/modules/projectiles/guns/magic/wand.dm
+++ b/code/modules/projectiles/guns/magic/wand.dm
@@ -12,9 +12,9 @@
/obj/item/gun/magic/wand/Initialize()
if(prob(75) && variable_charges) //25% chance of listed max charges, 50% chance of 1/2 max charges, 25% chance of 1/3 max charges
if(prob(33))
- max_charges = Ceiling(max_charges / 3)
+ max_charges = CEILING(max_charges / 3, 1)
else
- max_charges = Ceiling(max_charges / 2)
+ max_charges = CEILING(max_charges / 2, 1)
return ..()
/obj/item/gun/magic/wand/examine(mob/user)
diff --git a/code/modules/projectiles/guns/syringe_gun.dm b/code/modules/projectiles/guns/syringe_gun.dm
index b8e3c97e81..ac9f7daedf 100644
--- a/code/modules/projectiles/guns/syringe_gun.dm
+++ b/code/modules/projectiles/guns/syringe_gun.dm
@@ -42,7 +42,7 @@
if(!S)
return 0
- S.loc = user.loc
+ S.forceMove(user.loc)
syringes.Remove(S)
to_chat(user, "You unload [S] from \the [src].")
@@ -101,4 +101,4 @@
return TRUE
else
to_chat(user, "[src] cannot hold more syringes!")
- return FALSE
\ No newline at end of file
+ return FALSE
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index 0e3bd98c68..79e2fdf903 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -168,7 +168,7 @@
/obj/item/projectile/proc/vol_by_damage()
if(src.damage)
- return Clamp((src.damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then clamp the value between 30 and 100
+ return CLAMP((src.damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then clamp the value between 30 and 100
else
return 50 //if the projectile doesn't do damage, play its hitsound at 50% volume
@@ -188,7 +188,7 @@
def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use.
if(isturf(A) && hitsound_wall)
- var/volume = Clamp(vol_by_damage() + 20, 0, 100)
+ var/volume = CLAMP(vol_by_damage() + 20, 0, 100)
if(suppressed)
volume = 5
playsound(loc, hitsound_wall, volume, 1, -1)
@@ -259,7 +259,7 @@
return
var/elapsed_time_deciseconds = (world.time - last_projectile_move) + time_offset
time_offset = 0
- var/required_moves = speed > 0? Floor(elapsed_time_deciseconds / speed) : MOVES_HITSCAN //Would be better if a 0 speed made hitscan but everyone hates those so I can't make it a universal system :<
+ var/required_moves = speed > 0? FLOOR(elapsed_time_deciseconds / speed, 1) : MOVES_HITSCAN //Would be better if a 0 speed made hitscan but everyone hates those so I can't make it a universal system :<
if(required_moves == MOVES_HITSCAN)
required_moves = SSprojectiles.global_max_tick_moves
else
@@ -267,7 +267,7 @@
var/overrun = required_moves - SSprojectiles.global_max_tick_moves
required_moves = SSprojectiles.global_max_tick_moves
time_offset += overrun * speed
- time_offset += Modulus(elapsed_time_deciseconds, speed)
+ time_offset += MODULUS(elapsed_time_deciseconds, speed)
for(var/i in 1 to required_moves)
pixel_move(required_moves)
@@ -287,7 +287,7 @@
setAngle(Angle + ((rand() - 0.5) * spread))
if(isnull(Angle)) //Try to resolve through offsets if there's no angle set.
var/turf/starting = get_turf(src)
- var/turf/target = locate(Clamp(starting + xo, 1, world.maxx), Clamp(starting + yo, 1, world.maxy), starting.z)
+ var/turf/target = locate(CLAMP(starting + xo, 1, world.maxx), CLAMP(starting + yo, 1, world.maxy), starting.z)
setAngle(Get_Angle(src, target))
if(!nondirectional_sprite)
var/matrix/M = new
@@ -403,7 +403,7 @@
var/ox = round(screenviewX/2) - user.client.pixel_x //"origin" x
var/oy = round(screenviewY/2) - user.client.pixel_y //"origin" y
- angle = Atan2(y - oy, x - ox)
+ angle = ATAN2(y - oy, x - ox)
return list(angle, p_x, p_y)
/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it.
diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm
index 5a650ff2c3..152cff6c74 100644
--- a/code/modules/projectiles/projectile/special.dm
+++ b/code/modules/projectiles/projectile/special.dm
@@ -100,7 +100,7 @@
/obj/item/projectile/meteor/Collide(atom/A)
if(A == firer)
- loc = A.loc
+ forceMove(A.loc)
return
A.ex_act(EXPLODE_HEAVY)
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
@@ -612,4 +612,3 @@
knockdown = 0
nodamage = TRUE
return ..()
-
diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm
index 9c4bff72cb..ef609696a2 100644
--- a/code/modules/reagents/chemistry/holder.dm
+++ b/code/modules/reagents/chemistry/holder.dm
@@ -580,7 +580,7 @@
if (R.id == reagent)
//clamp the removal amount to be between current reagent amount
//and zero, to prevent removing more than the holder has stored
- amount = Clamp(amount, 0, R.volume)
+ amount = CLAMP(amount, 0, R.volume)
R.volume -= amount
update_total()
if(!safety)//So it does not handle reactions when it need not to
diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
index 745843474e..51ddf549e0 100644
--- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
@@ -211,7 +211,7 @@
/obj/machinery/chem_dispenser/emp_act(severity)
var/list/datum/reagents/R = list()
- var/total = min(rand(7,15), Floor(cell.charge*powerefficiency))
+ var/total = min(rand(7,15), FLOOR(cell.charge*powerefficiency, 1))
var/datum/reagents/Q = new(total*10)
if(beaker && beaker.reagents)
R += beaker.reagents
diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm
index a6d958220a..722ddbf15f 100644
--- a/code/modules/reagents/chemistry/machinery/chem_heater.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm
@@ -126,7 +126,7 @@
target = text2num(target)
. = TRUE
if(.)
- target_temperature = Clamp(target, 0, 1000)
+ target_temperature = CLAMP(target, 0, 1000)
if("eject")
on = FALSE
eject_beaker()
diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm
index 3e06449e3a..631a027d9a 100644
--- a/code/modules/reagents/chemistry/machinery/chem_master.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_master.dm
@@ -215,7 +215,7 @@
var/amount = 1
var/vol_each = min(reagents.total_volume, 50)
if(text2num(many))
- amount = Clamp(round(input(usr, "Max 10. Buffer content will be split evenly.", "How many pills?", amount) as num|null), 0, 10)
+ amount = CLAMP(round(input(usr, "Max 10. Buffer content will be split evenly.", "How many pills?", amount) as num|null), 0, 10)
if(!amount)
return
vol_each = min(reagents.total_volume / amount, 50)
@@ -251,7 +251,7 @@
var/amount = 1
var/vol_each = min(reagents.total_volume, 40)
if(text2num(many))
- amount = Clamp(round(input(usr, "Max 10. Buffer content will be split evenly.", "How many patches?", amount) as num|null), 0, 10)
+ amount = CLAMP(round(input(usr, "Max 10. Buffer content will be split evenly.", "How many patches?", amount) as num|null), 0, 10)
if(!amount)
return
vol_each = min(reagents.total_volume / amount, 40)
diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
index 77fcd50306..c98024471b 100644
--- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
+++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
@@ -2,7 +2,7 @@
#define MILK_TO_BUTTER_COEFF 15
/obj/machinery/reagentgrinder
- name = "All-In-One Grinder"
+ name = "\improper All-In-One Grinder"
desc = "From BlenderTech. Will It Blend? Let's test it out!"
icon = 'icons/obj/kitchen.dmi'
icon_state = "juicer1"
@@ -16,97 +16,6 @@
var/operating = FALSE
var/obj/item/reagent_containers/beaker = null
var/limit = 10
-
- var/static/list/blend_items = list(
- //Sheets
- /obj/item/stack/sheet/mineral/plasma = list("plasma" = 20),
- /obj/item/stack/sheet/metal = list("iron" = 20),
- /obj/item/stack/sheet/plasteel = list("iron" = 20, "plasma" = 20),
- /obj/item/stack/sheet/mineral/wood = list("carbon" = 20),
- /obj/item/stack/sheet/glass = list("silicon" = 20),
- /obj/item/stack/sheet/rglass = list("silicon" = 20, "iron" = 20),
- /obj/item/stack/sheet/mineral/uranium = list("uranium" = 20),
- /obj/item/stack/sheet/mineral/bananium = list("banana" = 20),
- /obj/item/stack/sheet/mineral/silver = list("silver" = 20),
- /obj/item/stack/sheet/mineral/gold = list("gold" = 20),
- /obj/item/stack/sheet/bluespace_crystal = list("bluespace" = 20),
- /obj/item/stack/cable_coil = list ("copper" = 5),
- /obj/item/ore/bluespace_crystal = list("bluespace" = 20),
- /obj/item/grown/nettle/basic = list("sacid" = 0),
- /obj/item/grown/nettle/death = list("facid" = 0, "sacid" = 0),
- /obj/item/grown/novaflower = list("capsaicin" = 0, "condensedcapsaicin" = 0),
- //Blender Stuff
- /obj/item/reagent_containers/food/snacks/donkpocket/warm = list("omnizine" = 3),
- /obj/item/reagent_containers/food/snacks/grown/soybeans = list("soymilk" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tomato = list("ketchup" = 0),
- /obj/item/reagent_containers/food/snacks/grown/wheat = list("flour" = -5),
- /obj/item/reagent_containers/food/snacks/grown/oat = list("flour" = -5),
- /obj/item/reagent_containers/food/snacks/grown/rice = list("rice" = -5),
- /obj/item/reagent_containers/food/snacks/donut = list("sprinkles" = -2, "sugar" = 1),
- /obj/item/reagent_containers/food/snacks/grown/cherries = list("cherryjelly" = 0),
- /obj/item/reagent_containers/food/snacks/grown/bluecherries = list("bluecherryjelly" = 0),
- /obj/item/reagent_containers/food/snacks/egg = list("eggyolk" = -5),
- /obj/item/reagent_containers/food/snacks/deadmouse = list ("blood" = 20, "gibs" = 5), // You monster
- //Grinder stuff, but only if dry
- /obj/item/reagent_containers/food/snacks/grown/coffee/robusta = list("coffeepowder" = 0, "morphine" = 0),
- /obj/item/reagent_containers/food/snacks/grown/coffee = list("coffeepowder" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tea/astra = list("teapowder" = 0, "salglu_solution" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tea = list("teapowder" = 0),
- //Stuff that doesn't quite fit in the other categories
- /obj/item/electronics = list ("iron" = 10, "silicon" = 10),
- /obj/item/circuitboard = list ("silicon" = 20, "sacid" = 0.5), // Retrieving acid this way is extremely inefficient
- /obj/item/match = list ("phosphorus" = 2),
- /obj/item/device/toner = list ("iodine" = 40, "iron" = 10),
- /obj/item/photo = list ("iodine" = 4),
- /obj/item/pen = list ("iodine" = 2, "iron" = 1),
- /obj/item/reagent_containers/food/drinks/soda_cans = list ("aluminium" = 10),
- /obj/item/trash/can = list ("aluminium" = 10),
- /obj/item/device/flashlight/flare = list ("sulfur" = 15),
- /obj/item/device/flashlight/glowstick = list ("phenol" = 15, "hydrodgen" = 10, "oxygen" = 5),
- /obj/item/stock_parts/cell = list ("lithium" = 15, "iron" = 5, "silicon" = 5),
- /obj/item/soap = list ("lye" = 10),
- /obj/item/device/analyzer = list ("mercury" = 5, "iron" = 5, "silicon" = 5),
- /obj/item/lighter = list ("iron" = 1, "weldingfuel" = 5, "oil" = 5),
- /obj/item/light = list ("silicon" = 5, "nitrogen" = 10), //Nitrogen is used as a cheaper alternative to argon in incandescent lighbulbs
- /obj/item/cigbutt/ = list ("carbon" = 2),
- /obj/item/trash/coal = list ("carbon" = 20),
- /obj/item/stack/medical/bruise_pack = list ("styptic_powder" = 5),
- /obj/item/stack/medical/ointment = list ("silver_sulfadiazine" = 5),
- //All types that you can put into the grinder to transfer the reagents to the beaker. !Put all recipes above this.!
- /obj/item/slime_extract = list(),
- /obj/item/reagent_containers/pill = list(),
- /obj/item/reagent_containers/food = list(),
- /obj/item/reagent_containers/honeycomb = list(),
- /obj/item/toy/crayon = list(),
- /obj/item/clothing/mask/cigarette = list())
-
- var/static/list/juice_items = list(
- //Juicer Stuff
- /obj/item/reagent_containers/food/snacks/grown/corn = list("corn_starch" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tomato = list("tomatojuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/carrot = list("carrotjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/berries = list("berryjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/banana = list("banana" = 0),
- /obj/item/reagent_containers/food/snacks/grown/potato = list("potato" = 0),
- /obj/item/reagent_containers/food/snacks/grown/citrus/lemon = list("lemonjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/citrus/orange = list("orangejuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/citrus/lime = list("limejuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/watermelon = list("watermelonjuice" = 0),
- /obj/item/reagent_containers/food/snacks/watermelonslice = list("watermelonjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/berries/poison = list("poisonberryjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/pumpkin = list("pumpkinjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/blumpkin = list("blumpkinjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/apple = list("applejuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/grapes = list("grapejuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/grapes/green = list("grapejuice" = 0))
-
- var/static/list/dried_items = list(
- //Grinder stuff, but only if dry,
- /obj/item/reagent_containers/food/snacks/grown/coffee/robusta = list("coffeepowder" = 0, "morphine" = 0),
- /obj/item/reagent_containers/food/snacks/grown/coffee = list("coffeepowder" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tea/astra = list("teapowder" = 0, "salglu_solution" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tea = list("teapowder" = 0))
-
var/list/holdingitems
/obj/machinery/reagentgrinder/Initialize()
@@ -158,6 +67,7 @@
if(!user.transferItemToLoc(I, src))
to_chat(user, "[I] is stuck to your hand!")
return TRUE
+ to_chat(user, "You slide [I] into [src].")
beaker = I
update_icon()
updateUsrDialog()
@@ -165,15 +75,8 @@
to_chat(user, "There's already a container inside [src].")
return TRUE //no afterattack
- if(is_type_in_list(I, dried_items))
- if(istype(I, /obj/item/reagent_containers/food/snacks/grown))
- var/obj/item/reagent_containers/food/snacks/grown/G = I
- if(!G.dry)
- to_chat(user, "You must dry [G] first!")
- return TRUE
-
- if(length(holdingitems) >= limit)
- to_chat(user, "The machine cannot hold anymore items.")
+ if(holdingitems.len >= limit)
+ to_chat(user, "[src] is filled to capacity!")
return TRUE
//Fill machine with a bag!
@@ -192,14 +95,18 @@
updateUsrDialog()
return TRUE
- if (!is_type_in_list(I, blend_items) && !is_type_in_list(I, juice_items))
+ if(!I.grind_results && !I.juice_results)
if(user.a_intent == INTENT_HARM)
return ..()
else
- to_chat(user, "Cannot refine into a reagent!")
+ to_chat(user, "You cannot grind [I] into reagents!")
return TRUE
+ if(!I.grind_requirements(src)) //Error messages should be in the objects' definitions
+ return
+
if(user.transferItemToLoc(I, src))
+ to_chat(user, "You add [I] to [src].")
holdingitems[I] = TRUE
updateUsrDialog()
return FALSE
@@ -214,7 +121,7 @@
user.set_machine(src)
interact(user)
-/obj/machinery/reagentgrinder/interact(mob/user) // The microwave Menu
+/obj/machinery/reagentgrinder/interact(mob/user) // The microwave Menu //I am reasonably certain that this is not a microwave
var/is_chamber_empty = FALSE
var/is_beaker_ready = FALSE
var/processing_chamber = ""
@@ -307,60 +214,10 @@
holdingitems -= O
updateUsrDialog()
-/obj/machinery/reagentgrinder/proc/get_allowed_by_obj(obj/item/O)
- for (var/i in blend_items)
- if (istype(O, i))
- return blend_items[i]
-
-/obj/machinery/reagentgrinder/proc/get_allowed_juice_by_obj(obj/item/reagent_containers/food/snacks/O)
- for(var/i in juice_items)
- if(istype(O, i))
- return juice_items[i]
-
-/obj/machinery/reagentgrinder/proc/get_grownweapon_amount(obj/item/grown/O)
- if (!istype(O) || !O.seed)
- return 5
- else if (O.seed.potency == -1)
- return 5
- else
- return round(O.seed.potency)
-
-/obj/machinery/reagentgrinder/proc/get_juice_amount(obj/item/reagent_containers/food/snacks/grown/O)
- if (!istype(O) || !O.seed)
- return 5
- else if (O.seed.potency == -1)
- return 5
- else
- return round(5*sqrt(O.seed.potency))
-
/obj/machinery/reagentgrinder/proc/remove_object(obj/item/O)
holdingitems -= O
qdel(O)
-/obj/machinery/reagentgrinder/proc/juice()
- power_change()
- if(!beaker || (beaker && (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)))
- return
- operate_for(50, juicing = TRUE)
-
- //Snacks
- for(var/obj/item/i in holdingitems)
- var/obj/item/I = i
- if(istype(I, /obj/item/reagent_containers/food/snacks))
- var/obj/item/reagent_containers/food/snacks/O = I
- if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
- break
- var/list/allowed = get_allowed_juice_by_obj(O)
- if(isnull(allowed))
- break
- for(var/r_id in allowed)
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- var/amount = get_juice_amount(O)
- beaker.reagents.add_reagent(r_id, min(amount, space))
- if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
- break
- remove_object(O)
-
/obj/machinery/reagentgrinder/proc/shake_for(duration)
var/offset = prob(50) ? -2 : 2
var/old_pixel_x = pixel_x
@@ -386,8 +243,26 @@
operating = FALSE
updateUsrDialog()
-/obj/machinery/reagentgrinder/proc/grind()
+/obj/machinery/reagentgrinder/proc/juice()
+ power_change()
+ if(!beaker || (beaker && (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)))
+ return
+ operate_for(50, juicing = TRUE)
+ for(var/obj/item/i in holdingitems)
+ if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
+ break
+ var/obj/item/I = i
+ if(I.juice_results)
+ juice_item(I)
+/obj/machinery/reagentgrinder/proc/juice_item(obj/item/I) //Juicing results can be found in respective object definitions
+ if(I.on_juice(src) == -1)
+ to_chat(usr, "[src] shorts out as it tries to juice up [I], and transfers it back to storage.")
+ return
+ beaker.reagents.add_reagent_list(I.juice_results)
+ remove_object(I)
+
+/obj/machinery/reagentgrinder/proc/grind()
power_change()
if(!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
return
@@ -396,82 +271,17 @@
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
var/obj/item/I = i
- //Snacks
- if(istype(I, /obj/item/reagent_containers/food/snacks))
- var/obj/item/reagent_containers/food/snacks/O = I
- var/list/allowed = get_allowed_by_obj(O)
- if(isnull(allowed))
- continue
- for(var/r_id in allowed)
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- var/amount = allowed[r_id]
- if(amount <= 0)
- if(amount == 0)
- if (O.reagents != null && O.reagents.has_reagent("nutriment"))
- beaker.reagents.add_reagent(r_id, min(O.reagents.get_reagent_amount("nutriment"), space))
- O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
- else
- if (O.reagents != null && O.reagents.has_reagent("nutriment"))
- beaker.reagents.add_reagent(r_id, min(round(O.reagents.get_reagent_amount("nutriment")*abs(amount)), space))
- O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
- else
- O.reagents.trans_id_to(beaker, r_id, min(amount, space))
- if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
- break
- if(O.reagents.reagent_list.len == 0)
- remove_object(O)
- //Sheets
- else if(istype(I, /obj/item/stack/sheet))
- var/obj/item/stack/sheet/O = I
- var/list/allowed = get_allowed_by_obj(O)
- for(var/t in 1 to round(O.amount, 1))
- for(var/r_id in allowed)
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- var/amount = allowed[r_id]
- beaker.reagents.add_reagent(r_id,min(amount, space))
- if (space < amount)
- break
- if(t == round(O.amount, 1))
- remove_object(O)
- break
- //Plants
- else if(istype(I, /obj/item/grown))
- var/obj/item/grown/O = I
- var/list/allowed = get_allowed_by_obj(O)
- for (var/r_id in allowed)
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- var/amount = allowed[r_id]
- if (amount == 0)
- if (O.reagents != null && O.reagents.has_reagent(r_id))
- beaker.reagents.add_reagent(r_id,min(O.reagents.get_reagent_amount(r_id), space))
- else
- beaker.reagents.add_reagent(r_id,min(amount, space))
- if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
- break
- remove_object(O)
- else if(istype(I, /obj/item/slime_extract))
- var/obj/item/slime_extract/O = I
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- if (O.reagents != null)
- var/amount = O.reagents.total_volume
- O.reagents.trans_to(beaker, min(amount, space))
- if (O.Uses > 0)
- beaker.reagents.add_reagent("slimejelly",min(20, space))
- remove_object(O)
- if(istype(I, /obj/item/reagent_containers))
- var/obj/item/reagent_containers/O = I
- var/amount = O.reagents.total_volume
- O.reagents.trans_to(beaker, amount)
- if(!O.reagents.total_volume)
- remove_object(O)
- else if(istype(I, /obj/item/toy/crayon))
- var/obj/item/toy/crayon/O = I
- for (var/r_id in O.reagent_contents)
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- if(!space)
- break
- beaker.reagents.add_reagent(r_id, min(O.reagent_contents[r_id], space))
- remove_object(O)
+ if(I.grind_results)
+ grind_item(i)
+
+/obj/machinery/reagentgrinder/proc/grind_item(obj/item/I) //Grind results can be found in respective object definitions
+ if(I.on_grind(src) == -1) //Call on_grind() to change amount as needed, and stop grinding the item if it returns -1
+ to_chat(usr, "[src] shorts out as it tries to grind up [I], and transfers it back to storage.")
+ return
+ beaker.reagents.add_reagent_list(I.grind_results)
+ if(I.reagents)
+ I.reagents.trans_to(beaker, I.reagents.total_volume)
+ remove_object(I)
/obj/machinery/reagentgrinder/proc/mix(mob/user)
//For butter and other things that would change upon shaking or mixing
@@ -484,7 +294,7 @@
/obj/machinery/reagentgrinder/proc/mix_complete()
if(beaker && beaker.reagents.total_volume)
//Recipe to make Butter
- var/butter_amt = Floor(beaker.reagents.get_reagent_amount("milk") / MILK_TO_BUTTER_COEFF)
+ var/butter_amt = FLOOR(beaker.reagents.get_reagent_amount("milk") / MILK_TO_BUTTER_COEFF, 1)
beaker.reagents.remove_reagent("milk", MILK_TO_BUTTER_COEFF * butter_amt)
for(var/i in 1 to butter_amt)
new /obj/item/reagent_containers/food/snacks/butter(drop_location())
diff --git a/code/modules/reagents/chemistry/machinery/smoke_machine.dm b/code/modules/reagents/chemistry/machinery/smoke_machine.dm
index dc92dd3b52..86205caba5 100644
--- a/code/modules/reagents/chemistry/machinery/smoke_machine.dm
+++ b/code/modules/reagents/chemistry/machinery/smoke_machine.dm
@@ -1,3 +1,5 @@
+#define REAGENTS_BASE_VOLUME 100 // actual volume is REAGENTS_BASE_VOLUME plus REAGENTS_BASE_VOLUME * rating for each matterbin
+
/obj/machinery/smoke_machine
name = "smoke machine"
desc = "A machine with a centrifuge installed into it. It produces smoke with any reagents you put into the machine."
@@ -11,14 +13,13 @@
var/cooldown = 0
var/screen = "home"
var/useramount = 30 // Last used amount
- var/volume = 300
- var/setting = 3
- var/list/possible_settings = list(3,6,9)
+ var/setting = 1 // displayed range is 3 * setting
+ var/max_range = 3 // displayed max range is 3 * max range
-/datum/effect_system/smoke_spread/chem/smoke_machine/set_up(datum/reagents/carry, setting = 3, efficiency = 10, loc)
- amount = setting
+/datum/effect_system/smoke_spread/chem/smoke_machine/set_up(datum/reagents/carry, setting=1, efficiency=10, loc)
+ amount = setting * 3
carry.copy_to(chemholder, 20)
- carry.remove_any(setting * 16 / efficiency)
+ carry.remove_any(amount * 16 / efficiency)
location = loc
/datum/effect_system/smoke_spread/chem/smoke_machine
@@ -28,10 +29,11 @@
opaque = FALSE
alpha = 100
-
/obj/machinery/smoke_machine/Initialize()
. = ..()
- create_reagents(volume)
+ create_reagents(REAGENTS_BASE_VOLUME)
+ for(var/obj/item/stock_parts/matter_bin/B in component_parts)
+ reagents.maximum_volume += REAGENTS_BASE_VOLUME * B.rating
/obj/machinery/smoke_machine/update_icon()
if((!is_operational()) || (!on) || (reagents.total_volume == 0))
@@ -41,13 +43,20 @@
. = ..()
/obj/machinery/smoke_machine/RefreshParts()
- efficiency = 6
+ var/new_volume = REAGENTS_BASE_VOLUME
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
- efficiency += B.rating
+ new_volume += REAGENTS_BASE_VOLUME * B.rating
+ reagents.maximum_volume = new_volume
+ if(new_volume < reagents.total_volume)
+ reagents.reaction(loc, TOUCH) // if someone manages to downgrade it without deconstructing
+ reagents.clear_reagents()
+ efficiency = 9
for(var/obj/item/stock_parts/capacitor/C in component_parts)
efficiency += C.rating
+ max_range = 1
for(var/obj/item/stock_parts/manipulator/M in component_parts)
- efficiency += M.rating
+ max_range += M.rating
+ max_range = max(3, max_range)
/obj/machinery/smoke_machine/process()
..()
@@ -78,6 +87,11 @@
return
return ..()
+/obj/machinery/smoke_machine/deconstruct()
+ reagents.reaction(loc, TOUCH)
+ reagents.clear_reagents()
+ return ..()
+
/obj/machinery/smoke_machine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
@@ -99,6 +113,7 @@
data["active"] = on
data["setting"] = setting
data["screen"] = screen
+ data["maxSetting"] = max_range
return data
/obj/machinery/smoke_machine/ui_act(action, params)
@@ -110,7 +125,7 @@
. = TRUE
if("setting")
var/amount = text2num(params["amount"])
- if (locate(amount) in possible_settings)
+ if(amount in 1 to max_range)
setting = amount
. = TRUE
if("power")
@@ -122,3 +137,5 @@
if("goScreen")
screen = params["screen"]
. = TRUE
+
+#undef REAGENTS_BASE_VOLUME
diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm
index 5f76a87654..9f8e129420 100644
--- a/code/modules/reagents/chemistry/reagents.dm
+++ b/code/modules/reagents/chemistry/reagents.dm
@@ -41,7 +41,7 @@
return 0
if(method == VAPOR) //smoke, foam, spray
if(M.reagents)
- var/modifier = Clamp((1 - touch_protection), 0, 1)
+ var/modifier = CLAMP((1 - touch_protection), 0, 1)
var/amount = round(reac_volume*modifier, 0.1)
if(amount >= 0.5)
M.reagents.add_reagent(id, amount)
diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
index 6a3b1a1637..00fd7d56a3 100644
--- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
@@ -961,7 +961,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
var/datum/antagonist/changeling/changeling = M.mind.has_antag_datum(/datum/antagonist/changeling)
if(changeling)
changeling.chem_charges += metabolization_rate
- changeling.chem_charges = Clamp(changeling.chem_charges, 0, changeling.chem_storage)
+ changeling.chem_charges = CLAMP(changeling.chem_charges, 0, changeling.chem_storage)
return ..()
/datum/reagent/consumable/ethanol/irishcarbomb
diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
index 711c333896..7bee2ef958 100644
--- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
@@ -850,9 +850,9 @@
/datum/reagent/toxin/peaceborg/confuse/on_mob_life(mob/living/M)
if(M.confused < 6)
- M.confused = Clamp(M.confused + 3, 0, 5)
+ M.confused = CLAMP(M.confused + 3, 0, 5)
if(M.dizziness < 6)
- M.dizziness = Clamp(M.dizziness + 3, 0, 5)
+ M.dizziness = CLAMP(M.dizziness + 3, 0, 5)
if(prob(20))
to_chat(M, "You feel confused and disorientated.")
..()
diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
index 0e645e3798..b77dcc435a 100644
--- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
+++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
@@ -168,7 +168,7 @@
return
holder.remove_reagent("sorium", created_volume*4)
var/turf/T = get_turf(holder.my_atom)
- var/range = Clamp(sqrt(created_volume*4), 1, 6)
+ var/range = CLAMP(sqrt(created_volume*4), 1, 6)
goonchem_vortex(T, 1, range)
/datum/chemical_reaction/sorium_vortex
@@ -179,7 +179,7 @@
/datum/chemical_reaction/sorium_vortex/on_reaction(datum/reagents/holder, created_volume)
var/turf/T = get_turf(holder.my_atom)
- var/range = Clamp(sqrt(created_volume), 1, 6)
+ var/range = CLAMP(sqrt(created_volume), 1, 6)
goonchem_vortex(T, 1, range)
/datum/chemical_reaction/liquid_dark_matter
@@ -193,7 +193,7 @@
return
holder.remove_reagent("liquid_dark_matter", created_volume*3)
var/turf/T = get_turf(holder.my_atom)
- var/range = Clamp(sqrt(created_volume*3), 1, 6)
+ var/range = CLAMP(sqrt(created_volume*3), 1, 6)
goonchem_vortex(T, 0, range)
/datum/chemical_reaction/ldm_vortex
@@ -204,7 +204,7 @@
/datum/chemical_reaction/ldm_vortex/on_reaction(datum/reagents/holder, created_volume)
var/turf/T = get_turf(holder.my_atom)
- var/range = Clamp(sqrt(created_volume/2), 1, 6)
+ var/range = CLAMP(sqrt(created_volume/2), 1, 6)
goonchem_vortex(T, 0, range)
/datum/chemical_reaction/flash_powder
diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm
index 324623edbd..5a2e888210 100644
--- a/code/modules/reagents/reagent_containers/pill.dm
+++ b/code/modules/reagents/reagent_containers/pill.dm
@@ -1,154 +1,155 @@
-/obj/item/reagent_containers/pill
- name = "pill"
- desc = "A tablet or capsule."
- icon = 'icons/obj/chemical.dmi'
- icon_state = "pill"
- item_state = "pill"
- lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
- righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
- possible_transfer_amounts = list()
- volume = 50
- var/apply_type = INGEST
- var/apply_method = "swallow"
- var/roundstart = 0
- var/self_delay = 0 //pills are instant, this is because patches inheret their aplication from pills
-
-/obj/item/reagent_containers/pill/Initialize()
- . = ..()
- if(!icon_state)
- icon_state = "pill[rand(1,20)]"
- if(reagents.total_volume && roundstart)
- name += " ([reagents.total_volume]u)"
-
-
-/obj/item/reagent_containers/pill/attack_self(mob/user)
- return
-
-
-/obj/item/reagent_containers/pill/attack(mob/M, mob/user, def_zone)
- if(!canconsume(M, user))
- return 0
-
- if(M == user)
- M.visible_message("[user] attempts to [apply_method] [src].")
- if(self_delay)
- if(!do_mob(user, M, self_delay))
- return 0
- to_chat(M, "You [apply_method] [src].")
-
- else
- M.visible_message("[user] attempts to force [M] to [apply_method] [src].", \
- "[user] attempts to force [M] to [apply_method] [src].")
- if(!do_mob(user, M))
- return 0
- M.visible_message("[user] forces [M] to [apply_method] [src].", \
- "[user] forces [M] to [apply_method] [src].")
-
-
- add_logs(user, M, "fed", reagentlist(src))
- if(reagents.total_volume)
- reagents.reaction(M, apply_type)
- reagents.trans_to(M, reagents.total_volume)
- qdel(src)
- return 1
-
-
-/obj/item/reagent_containers/pill/afterattack(obj/target, mob/user , proximity)
- if(!proximity)
- return
- if(target.is_open_container() != 0 && target.reagents)
- if(!target.reagents.total_volume)
- to_chat(user, "[target] is empty! There's nothing to dissolve [src] in.")
- return
- to_chat(user, "You dissolve [src] in [target].")
- for(var/mob/O in viewers(2, user)) //viewers is necessary here because of the small radius
- to_chat(O, "[user] slips something into [target]!")
- reagents.trans_to(target, reagents.total_volume)
- qdel(src)
-
-/obj/item/reagent_containers/pill/tox
- name = "toxins pill"
- desc = "Highly toxic."
- icon_state = "pill5"
- list_reagents = list("toxin" = 50)
- roundstart = 1
-/obj/item/reagent_containers/pill/cyanide
- name = "cyanide pill"
- desc = "Don't swallow this."
- icon_state = "pill5"
- list_reagents = list("cyanide" = 50)
- roundstart = 1
-/obj/item/reagent_containers/pill/adminordrazine
- name = "adminordrazine pill"
- desc = "It's magic. We don't have to explain it."
- icon_state = "pill16"
- list_reagents = list("adminordrazine" = 50)
- roundstart = 1
-/obj/item/reagent_containers/pill/morphine
- name = "morphine pill"
- desc = "Commonly used to treat insomnia."
- icon_state = "pill8"
- list_reagents = list("morphine" = 30)
- roundstart = 1
-/obj/item/reagent_containers/pill/stimulant
- name = "stimulant pill"
- desc = "Often taken by overworked employees, athletes, and the inebriated. You'll snap to attention immediately!"
- icon_state = "pill19"
- list_reagents = list("ephedrine" = 10, "antihol" = 10, "coffee" = 30)
- roundstart = 1
-/obj/item/reagent_containers/pill/salbutamol
- name = "salbutamol pill"
- desc = "Used to treat oxygen deprivation."
- icon_state = "pill16"
- list_reagents = list("salbutamol" = 30)
- roundstart = 1
-/obj/item/reagent_containers/pill/charcoal
- name = "charcoal pill"
- desc = "Neutralizes many common toxins."
- icon_state = "pill17"
- list_reagents = list("charcoal" = 10)
- roundstart = 1
-/obj/item/reagent_containers/pill/epinephrine
- name = "epinephrine pill"
- desc = "Used to stabilize patients."
- icon_state = "pill5"
- list_reagents = list("epinephrine" = 15)
- roundstart = 1
-/obj/item/reagent_containers/pill/mannitol
- name = "mannitol pill"
- desc = "Used to treat brain damage."
- icon_state = "pill17"
- list_reagents = list("mannitol" = 50)
- roundstart = 1
-/obj/item/reagent_containers/pill/mutadone
- name = "mutadone pill"
- desc = "Used to treat genetic damage."
- icon_state = "pill20"
- list_reagents = list("mutadone" = 50)
- roundstart = 1
-/obj/item/reagent_containers/pill/salicyclic
- name = "salicylic acid pill"
- desc = "Used to dull pain."
- icon_state = "pill9"
- list_reagents = list("sal_acid" = 24)
- roundstart = 1
-/obj/item/reagent_containers/pill/oxandrolone
- name = "oxandrolone pill"
- desc = "Used to stimulate burn healing."
- icon_state = "pill11"
- list_reagents = list("oxandrolone" = 24)
- roundstart = 1
-
-/obj/item/reagent_containers/pill/insulin
- name = "insulin pill"
- desc = "Handles hyperglycaemic coma."
- icon_state = "pill18"
- list_reagents = list("insulin" = 50)
- roundstart = 1
-
-/obj/item/reagent_containers/pill/shadowtoxin
- name = "black pill"
- desc = "I wouldn't eat this if I were you."
- icon_state = "pill9"
- color = "#454545"
- list_reagents = list("shadowmutationtoxin" = 1)
+/obj/item/reagent_containers/pill
+ name = "pill"
+ desc = "A tablet or capsule."
+ icon = 'icons/obj/chemical.dmi'
+ icon_state = "pill"
+ item_state = "pill"
+ lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
+ righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
+ possible_transfer_amounts = list()
+ volume = 50
+ grind_results = list()
+ var/apply_type = INGEST
+ var/apply_method = "swallow"
+ var/roundstart = 0
+ var/self_delay = 0 //pills are instant, this is because patches inheret their aplication from pills
+
+/obj/item/reagent_containers/pill/Initialize()
+ . = ..()
+ if(!icon_state)
+ icon_state = "pill[rand(1,20)]"
+ if(reagents.total_volume && roundstart)
+ name += " ([reagents.total_volume]u)"
+
+
+/obj/item/reagent_containers/pill/attack_self(mob/user)
+ return
+
+
+/obj/item/reagent_containers/pill/attack(mob/M, mob/user, def_zone)
+ if(!canconsume(M, user))
+ return 0
+
+ if(M == user)
+ M.visible_message("[user] attempts to [apply_method] [src].")
+ if(self_delay)
+ if(!do_mob(user, M, self_delay))
+ return 0
+ to_chat(M, "You [apply_method] [src].")
+
+ else
+ M.visible_message("[user] attempts to force [M] to [apply_method] [src].", \
+ "[user] attempts to force [M] to [apply_method] [src].")
+ if(!do_mob(user, M))
+ return 0
+ M.visible_message("[user] forces [M] to [apply_method] [src].", \
+ "[user] forces [M] to [apply_method] [src].")
+
+
+ add_logs(user, M, "fed", reagentlist(src))
+ if(reagents.total_volume)
+ reagents.reaction(M, apply_type)
+ reagents.trans_to(M, reagents.total_volume)
+ qdel(src)
+ return 1
+
+
+/obj/item/reagent_containers/pill/afterattack(obj/target, mob/user , proximity)
+ if(!proximity)
+ return
+ if(target.is_open_container() != 0 && target.reagents)
+ if(!target.reagents.total_volume)
+ to_chat(user, "[target] is empty! There's nothing to dissolve [src] in.")
+ return
+ to_chat(user, "You dissolve [src] in [target].")
+ for(var/mob/O in viewers(2, user)) //viewers is necessary here because of the small radius
+ to_chat(O, "[user] slips something into [target]!")
+ reagents.trans_to(target, reagents.total_volume)
+ qdel(src)
+
+/obj/item/reagent_containers/pill/tox
+ name = "toxins pill"
+ desc = "Highly toxic."
+ icon_state = "pill5"
+ list_reagents = list("toxin" = 50)
+ roundstart = 1
+/obj/item/reagent_containers/pill/cyanide
+ name = "cyanide pill"
+ desc = "Don't swallow this."
+ icon_state = "pill5"
+ list_reagents = list("cyanide" = 50)
+ roundstart = 1
+/obj/item/reagent_containers/pill/adminordrazine
+ name = "adminordrazine pill"
+ desc = "It's magic. We don't have to explain it."
+ icon_state = "pill16"
+ list_reagents = list("adminordrazine" = 50)
+ roundstart = 1
+/obj/item/reagent_containers/pill/morphine
+ name = "morphine pill"
+ desc = "Commonly used to treat insomnia."
+ icon_state = "pill8"
+ list_reagents = list("morphine" = 30)
+ roundstart = 1
+/obj/item/reagent_containers/pill/stimulant
+ name = "stimulant pill"
+ desc = "Often taken by overworked employees, athletes, and the inebriated. You'll snap to attention immediately!"
+ icon_state = "pill19"
+ list_reagents = list("ephedrine" = 10, "antihol" = 10, "coffee" = 30)
+ roundstart = 1
+/obj/item/reagent_containers/pill/salbutamol
+ name = "salbutamol pill"
+ desc = "Used to treat oxygen deprivation."
+ icon_state = "pill16"
+ list_reagents = list("salbutamol" = 30)
+ roundstart = 1
+/obj/item/reagent_containers/pill/charcoal
+ name = "charcoal pill"
+ desc = "Neutralizes many common toxins."
+ icon_state = "pill17"
+ list_reagents = list("charcoal" = 10)
+ roundstart = 1
+/obj/item/reagent_containers/pill/epinephrine
+ name = "epinephrine pill"
+ desc = "Used to stabilize patients."
+ icon_state = "pill5"
+ list_reagents = list("epinephrine" = 15)
+ roundstart = 1
+/obj/item/reagent_containers/pill/mannitol
+ name = "mannitol pill"
+ desc = "Used to treat brain damage."
+ icon_state = "pill17"
+ list_reagents = list("mannitol" = 50)
+ roundstart = 1
+/obj/item/reagent_containers/pill/mutadone
+ name = "mutadone pill"
+ desc = "Used to treat genetic damage."
+ icon_state = "pill20"
+ list_reagents = list("mutadone" = 50)
+ roundstart = 1
+/obj/item/reagent_containers/pill/salicyclic
+ name = "salicylic acid pill"
+ desc = "Used to dull pain."
+ icon_state = "pill9"
+ list_reagents = list("sal_acid" = 24)
+ roundstart = 1
+/obj/item/reagent_containers/pill/oxandrolone
+ name = "oxandrolone pill"
+ desc = "Used to stimulate burn healing."
+ icon_state = "pill11"
+ list_reagents = list("oxandrolone" = 24)
+ roundstart = 1
+
+/obj/item/reagent_containers/pill/insulin
+ name = "insulin pill"
+ desc = "Handles hyperglycaemic coma."
+ icon_state = "pill18"
+ list_reagents = list("insulin" = 50)
+ roundstart = 1
+
+/obj/item/reagent_containers/pill/shadowtoxin
+ name = "black pill"
+ desc = "I wouldn't eat this if I were you."
+ icon_state = "pill9"
+ color = "#454545"
+ list_reagents = list("shadowmutationtoxin" = 1)
diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm
index 87fb2b8a9e..d60d415e9a 100644
--- a/code/modules/reagents/reagent_containers/syringes.dm
+++ b/code/modules/reagents/reagent_containers/syringes.dm
@@ -157,7 +157,7 @@
/obj/item/reagent_containers/syringe/update_icon()
- var/rounded_vol = Clamp(round((reagents.total_volume / volume * 15),5), 0, 15)
+ var/rounded_vol = CLAMP(round((reagents.total_volume / volume * 15),5), 0, 15)
cut_overlays()
if(ismob(loc))
var/injoverlay
diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm
index ed14ae63c1..62965f7ca1 100644
--- a/code/modules/recycling/disposal/bin.dm
+++ b/code/modules/recycling/disposal/bin.dm
@@ -29,7 +29,7 @@
if(make_from)
setDir(make_from.dir)
- make_from.loc = null
+ make_from.moveToNullspace()
stored = make_from
pressure_charging = FALSE // newly built disposal bins start with pump off
else
@@ -297,7 +297,7 @@
data["full_pressure"] = full_pressure
data["pressure_charging"] = pressure_charging
data["panel_open"] = panel_open
- var/per = Clamp(100* air_contents.return_pressure() / (SEND_PRESSURE), 0, 100)
+ var/per = CLAMP(100* air_contents.return_pressure() / (SEND_PRESSURE), 0, 100)
data["per"] = round(per, 1)
data["isai"] = isAI(user)
return data
@@ -471,7 +471,7 @@
if(isobj(AM))
var/obj/O = AM
- O.loc = src
+ O.forceMove(src)
else if(ismob(AM))
var/mob/M = AM
if(prob(2)) // to prevent mobs being stuck in infinite loops
diff --git a/code/modules/research/designs/autolathe_designs.dm b/code/modules/research/designs/autolathe_designs.dm
index 39fd0bf182..ff2ccc938f 100644
--- a/code/modules/research/designs/autolathe_designs.dm
+++ b/code/modules/research/designs/autolathe_designs.dm
@@ -681,7 +681,7 @@
category = list("hacked", "Security")
/datum/design/a357
- name = "Ammo Box (.357)"
+ name = "Speed Loader (.357)"
id = "a357"
build_type = AUTOLATHE
materials = list(MAT_METAL = 30000)
diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm
index 56848c6394..bad8f1e5aa 100644
--- a/code/modules/research/experimentor.dm
+++ b/code/modules/research/experimentor.dm
@@ -219,8 +219,8 @@
return
var/turf/dropturf = get_turf(pick(view(1,src)))
if(!dropturf) //Failsafe to prevent the object being lost in the void forever.
- dropturf = get_turf(src)
- loaded_item.loc = dropturf
+ dropturf = drop_location()
+ loaded_item.forceMove(dropturf)
if(delete)
qdel(loaded_item)
loaded_item = null
@@ -510,7 +510,7 @@
throwSmoke(loc)
if(trackedRuntime)
throwSmoke(trackedRuntime.loc)
- trackedRuntime.loc = loc
+ trackedRuntime.forceMove(drop_location())
investigate_log("Experimentor has stolen Runtime!", INVESTIGATE_EXPERIMENTOR)
else
new /mob/living/simple_animal/pet/cat(loc)
diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm
index 6c52fd4678..521f1d7f29 100644
--- a/code/modules/research/protolathe.dm
+++ b/code/modules/research/protolathe.dm
@@ -93,7 +93,7 @@ Note: Must be placed west/left of and R&D console to function.
return FALSE
var/power = 1000
- amount = Clamp(amount, 1, 10)
+ amount = CLAMP(amount, 1, 10)
for(var/M in D.materials)
power += round(D.materials[M] * amount / 5)
power = max(3000, power)
diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm
index cf250f50f1..93fd8dda37 100644
--- a/code/modules/research/xenobiology/xenobiology.dm
+++ b/code/modules/research/xenobiology/xenobiology.dm
@@ -12,6 +12,7 @@
throw_speed = 3
throw_range = 6
container_type = INJECTABLE_1
+ grind_results = list()
var/Uses = 1 // uses before it goes inert
var/qdel_timer = null // deletion timer, for delayed reactions
@@ -29,6 +30,10 @@
. = ..()
create_reagents(100)
+/obj/item/slime_extract/on_grind()
+ if(Uses)
+ grind_results["slimejelly"] = 20
+
/obj/item/slime_extract/grey
name = "grey slime extract"
icon_state = "grey slime extract"
@@ -290,7 +295,7 @@
return ..()
to_chat(user, "You feed the slime the stabilizer. It is now less likely to mutate.")
- M.mutation_chance = Clamp(M.mutation_chance-15,0,100)
+ M.mutation_chance = CLAMP(M.mutation_chance-15,0,100)
qdel(src)
/obj/item/slimepotion/mutator
@@ -314,7 +319,7 @@
return ..()
to_chat(user, "You feed the slime the mutator. It is now more likely to mutate.")
- M.mutation_chance = Clamp(M.mutation_chance+12,0,100)
+ M.mutation_chance = CLAMP(M.mutation_chance+12,0,100)
M.mutator_used = TRUE
qdel(src)
diff --git a/code/modules/ruins/objects_and_mobs/ash_walker_den.dm b/code/modules/ruins/objects_and_mobs/ash_walker_den.dm
index 7f301bf8b9..f98162266a 100644
--- a/code/modules/ruins/objects_and_mobs/ash_walker_den.dm
+++ b/code/modules/ruins/objects_and_mobs/ash_walker_den.dm
@@ -9,7 +9,7 @@
faction = list("ashwalker")
health = 200
maxHealth = 200
- loot = list(/obj/effect/collapse)
+ loot = null
var/meat_counter = 6
/mob/living/simple_animal/hostile/spawner/lavaland/ash_walker/death()
diff --git a/code/modules/server_tools/st_commands.dm b/code/modules/server_tools/st_commands.dm
index 9ec87a595c..1e071550e0 100644
--- a/code/modules/server_tools/st_commands.dm
+++ b/code/modules/server_tools/st_commands.dm
@@ -51,7 +51,7 @@
/*
The MIT License
-Copyright (c) 2011 Dominic Tarr
+Copyright (c) 2017 Jordan Brown
Permission is hereby granted, free of charge,
to any person obtaining a copy of this software and
diff --git a/code/modules/server_tools/st_interface.dm b/code/modules/server_tools/st_interface.dm
index 39bebbbb3d..b0b1b0a43c 100644
--- a/code/modules/server_tools/st_interface.dm
+++ b/code/modules/server_tools/st_interface.dm
@@ -30,7 +30,10 @@ SERVER_TOOLS_DEFINE_AND_SET_GLOBAL(server_tools_api_compatible, FALSE)
return
if(skip_compat_check && !fexists(SERVICE_INTERFACE_DLL))
CRASH("Service parameter present but no interface DLL detected. This is symptomatic of running a service less than version 3.1! Please upgrade.")
- call(SERVICE_INTERFACE_DLL, SERVICE_INTERFACE_FUNCTION)(command) //trust no retval
+ var/instance = params[SERVICE_INSTANCE_PARAM]
+ if(!instance)
+ instance = "TG Station Server" //maybe just upgraded
+ call(SERVICE_INTERFACE_DLL, SERVICE_INTERFACE_FUNCTION)(instance, command) //trust no retval
return TRUE
/world/proc/ChatBroadcast(message)
@@ -72,7 +75,7 @@ SERVER_TOOLS_DEFINE_AND_SET_GLOBAL(server_tools_api_compatible, FALSE)
switch(command)
if(SERVICE_CMD_API_COMPATIBLE)
SERVER_TOOLS_WRITE_GLOBAL(server_tools_api_compatible, TRUE)
- return "SUCCESS"
+ return SERVICE_RETURN_SUCCESS
if(SERVICE_CMD_HARD_REBOOT)
if(SERVER_TOOLS_READ_GLOBAL(reboot_mode) != REBOOT_MODE_HARD)
SERVER_TOOLS_WRITE_GLOBAL(reboot_mode, REBOOT_MODE_HARD)
@@ -88,7 +91,7 @@ SERVER_TOOLS_DEFINE_AND_SET_GLOBAL(server_tools_api_compatible, FALSE)
if(!istext(msg) || !msg)
return "No message set!"
SERVER_TOOLS_WORLD_ANNOUNCE(msg)
- return "SUCCESS"
+ return SERVICE_RETURN_SUCCESS
if(SERVICE_CMD_PLAYER_COUNT)
return "[SERVER_TOOLS_CLIENT_COUNT]"
if(SERVICE_CMD_LIST_CUSTOM)
@@ -96,13 +99,13 @@ SERVER_TOOLS_DEFINE_AND_SET_GLOBAL(server_tools_api_compatible, FALSE)
else
var/custom_command_result = HandleServiceCustomCommand(lowertext(command), params[SERVICE_CMD_PARAM_SENDER], params[SERVICE_CMD_PARAM_CUSTOM])
if(custom_command_result)
- return istext(custom_command_result) ? custom_command_result : "SUCCESS"
+ return istext(custom_command_result) ? custom_command_result : SERVICE_RETURN_SUCCESS
return "Unknown command: [command]"
/*
The MIT License
-Copyright (c) 2011 Dominic Tarr
+Copyright (c) 2017 Jordan Brown
Permission is hereby granted, free of charge,
to any person obtaining a copy of this software and
diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm
index 65636aa528..de1b0022f6 100644
--- a/code/modules/shuttle/navigation_computer.dm
+++ b/code/modules/shuttle/navigation_computer.dm
@@ -119,7 +119,7 @@
return
if(!my_port)
- my_port = new /obj/docking_port/stationary()
+ my_port = new(locate(eyeobj.x - x_offset, eyeobj.y - y_offset, eyeobj.z))
my_port.name = shuttlePortName
my_port.id = shuttlePortId
my_port.height = shuttle_port.height
@@ -128,7 +128,6 @@
my_port.dwidth = shuttle_port.dwidth
my_port.hidden = shuttle_port.hidden
my_port.dir = the_eye.dir
- my_port.loc = locate(eyeobj.x - x_offset, eyeobj.y - y_offset, eyeobj.z)
if(current_user.client)
current_user.client.images -= the_eye.placed_images
diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm
index a4303078a5..3811fa0e4a 100644
--- a/code/modules/shuttle/shuttle.dm
+++ b/code/modules/shuttle/shuttle.dm
@@ -146,13 +146,13 @@
var/y0 = bounds[2]
var/x1 = bounds[3]
var/y1 = bounds[4]
- if(x0 <= x1 && !IsInRange(T.x, x0, x1))
+ if(x0 <= x1 && !ISINRANGE(T.x, x0, x1))
return FALSE
- else if(!IsInRange(T.x, x1, x0))
+ else if(!ISINRANGE(T.x, x1, x0))
return FALSE
- if(y0 <= y1 && !IsInRange(T.y, y0, y1))
+ if(y0 <= y1 && !ISINRANGE(T.y, y0, y1))
return FALSE
- else if(!IsInRange(T.y, y1, y0))
+ else if(!ISINRANGE(T.y, y1, y0))
return FALSE
return TRUE
@@ -534,7 +534,7 @@
rotation = dir2angle(new_dock.dir)-dir2angle(dir)
if ((rotation % 90) != 0)
rotation += (rotation % 90) //diagonal rotations not allowed, round up
- rotation = SimplifyDegrees(rotation)
+ rotation = SIMPLIFY_DEGREES(rotation)
if(!movement_direction)
movement_direction = turn(preferred_direction, 180)
@@ -888,13 +888,13 @@
var/change_per_engine = (1 - ENGINE_COEFF_MIN) / ENGINE_DEFAULT_MAXSPEED_ENGINES // 5 by default
if(initial_engines > 0)
change_per_engine = (1 - ENGINE_COEFF_MIN) / initial_engines // or however many it had
- return Clamp(1 - delta * change_per_engine,ENGINE_COEFF_MIN,ENGINE_COEFF_MAX)
+ return CLAMP(1 - delta * change_per_engine,ENGINE_COEFF_MIN,ENGINE_COEFF_MAX)
if(new_value < initial_engines)
var/delta = initial_engines - new_value
var/change_per_engine = 1 //doesn't really matter should not be happening for 0 engine shuttles
if(initial_engines > 0)
change_per_engine = (ENGINE_COEFF_MAX - 1) / initial_engines //just linear drop to max delay
- return Clamp(1 + delta * change_per_engine,ENGINE_COEFF_MIN,ENGINE_COEFF_MAX)
+ return CLAMP(1 + delta * change_per_engine,ENGINE_COEFF_MIN,ENGINE_COEFF_MAX)
/obj/docking_port/mobile/proc/in_flight()
diff --git a/code/modules/spells/spell_types/conjure.dm b/code/modules/spells/spell_types/conjure.dm
index 87c1b8de44..306c3fcef6 100644
--- a/code/modules/spells/spell_types/conjure.dm
+++ b/code/modules/spells/spell_types/conjure.dm
@@ -56,6 +56,18 @@
range = 3
newVars = list("emagged" = 2, "remote_disabled" = 1,"shoot_sound" = 'sound/weapons/laser.ogg',"projectile" = /obj/item/projectile/beam/laser, "declare_arrests" = 0,"name" = "Wizard's Justicebot")
+/obj/effect/proc_holder/spell/aoe_turf/conjure/linkWorlds
+ name = "Link Worlds"
+ desc = "A whole new dimension for you to play with! They won't be happy about it, though."
+ invocation = "WTF"
+ clothes_req = FALSE
+ charge_max = 600
+ cooldown_min = 200
+ summon_type = list(/mob/living/simple_animal/hostile/spawner/nether)
+ summon_amt = 1
+ range = 1
+ cast_sound = 'sound/weapons/marauder.ogg'
+
/obj/effect/proc_holder/spell/targeted/conjure_item
name = "Summon weapon"
desc = "A generic spell that should not exist. This summons an instance of a specific type of item, or if one already exists, un-summons it. Summons into hand if possible."
diff --git a/code/modules/spells/spell_types/wizard.dm b/code/modules/spells/spell_types/wizard.dm
index 9b120c2e7f..b36dfc885d 100644
--- a/code/modules/spells/spell_types/wizard.dm
+++ b/code/modules/spells/spell_types/wizard.dm
@@ -209,7 +209,7 @@
summon_amt = 10
range = 3
- summon_type = list(/mob/living/simple_animal/hostile/creature)
+ summon_type = list(/mob/living/simple_animal/hostile/netherworld)
cast_sound = 'sound/magic/summonitems_generic.ogg'
/obj/effect/proc_holder/spell/targeted/trigger/blind
@@ -289,7 +289,7 @@
var/mob/living/M = AM
M.Knockdown(stun_amt)
to_chat(M, "You're thrown back by [user]!")
- AM.throw_at(throwtarget, ((Clamp((maxthrow - (Clamp(distfromcaster - 2, 0, distfromcaster))), 3, maxthrow))), 1,user)//So stuff gets tossed around at the same time.
+ AM.throw_at(throwtarget, ((CLAMP((maxthrow - (CLAMP(distfromcaster - 2, 0, distfromcaster))), 3, maxthrow))), 1,user)//So stuff gets tossed around at the same time.
/obj/effect/proc_holder/spell/aoe_turf/repulse/xeno //i fixed conflicts only to find out that this is in the WIZARD file instead of the xeno file?!
name = "Tail Sweep"
diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm
index e99455c833..63b955a571 100644
--- a/code/modules/surgery/bodyparts/dismemberment.dm
+++ b/code/modules/surgery/bodyparts/dismemberment.dm
@@ -18,7 +18,7 @@
return 0
var/obj/item/bodypart/affecting = C.get_bodypart("chest")
- affecting.receive_damage(Clamp(brute_dam/2, 15, 50), Clamp(burn_dam/2, 0, 50)) //Damage the chest based on limb's existing damage
+ affecting.receive_damage(CLAMP(brute_dam/2, 15, 50), CLAMP(burn_dam/2, 0, 50)) //Damage the chest based on limb's existing damage
C.visible_message("[C]'s [src.name] has been violently dismembered!")
C.emote("scream")
drop_limb()
@@ -142,11 +142,11 @@
//when a limb is dropped, the internal organs are removed from the mob and put into the limb
/obj/item/organ/proc/transfer_to_limb(obj/item/bodypart/LB, mob/living/carbon/C)
Remove(C)
- loc = LB
+ forceMove(LB)
/obj/item/organ/brain/transfer_to_limb(obj/item/bodypart/head/LB, mob/living/carbon/human/C)
Remove(C) //Changeling brain concerns are now handled in Remove
- loc = LB
+ forceMove(LB)
LB.brain = src
if(brainmob)
LB.brainmob = brainmob
@@ -270,7 +270,7 @@
attach_limb(C, special)
/obj/item/bodypart/proc/attach_limb(mob/living/carbon/C, special)
- loc = null
+ moveToNullspace()
owner = C
C.bodyparts += src
if(held_index)
diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm
index 51e39605c4..f8f57c650f 100644
--- a/code/modules/surgery/organs/eyes.dm
+++ b/code/modules/surgery/organs/eyes.dm
@@ -199,7 +199,7 @@
return
var/range = input(user, "Enter range (0 - [max_light_beam_distance])", "Range Select", 0) as null|num
- set_distance(Clamp(range, 0, max_light_beam_distance))
+ set_distance(CLAMP(range, 0, max_light_beam_distance))
assume_rgb(C)
/obj/item/organ/eyes/robotic/glow/proc/assume_rgb(newcolor)
diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm
index 02f1ee4ec3..102ac9720f 100644
--- a/code/modules/surgery/organs/lungs.dm
+++ b/code/modules/surgery/organs/lungs.dm
@@ -111,7 +111,7 @@
if(safe_oxygen_max)
if(O2_pp > safe_oxygen_max)
var/ratio = (breath_gases[/datum/gas/oxygen][MOLES]/safe_oxygen_max) * 10
- H.apply_damage_type(Clamp(ratio, oxy_breath_dam_min, oxy_breath_dam_max), oxy_damage_type)
+ H.apply_damage_type(CLAMP(ratio, oxy_breath_dam_min, oxy_breath_dam_max), oxy_damage_type)
H.throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy)
else
H.clear_alert("too_much_oxy")
@@ -139,7 +139,7 @@
if(safe_nitro_max)
if(N2_pp > safe_nitro_max)
var/ratio = (breath_gases[/datum/gas/nitrogen][MOLES]/safe_nitro_max) * 10
- H.apply_damage_type(Clamp(ratio, nitro_breath_dam_min, nitro_breath_dam_max), nitro_damage_type)
+ H.apply_damage_type(CLAMP(ratio, nitro_breath_dam_min, nitro_breath_dam_max), nitro_damage_type)
H.throw_alert("too_much_nitro", /obj/screen/alert/too_much_nitro)
else
H.clear_alert("too_much_nitro")
@@ -205,7 +205,7 @@
if(safe_toxins_max)
if(Toxins_pp > safe_toxins_max)
var/ratio = (breath_gases[/datum/gas/plasma][MOLES]/safe_toxins_max) * 10
- H.apply_damage_type(Clamp(ratio, tox_breath_dam_min, tox_breath_dam_max), tox_damage_type)
+ H.apply_damage_type(CLAMP(ratio, tox_breath_dam_min, tox_breath_dam_max), tox_damage_type)
H.throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
else
H.clear_alert("too_much_tox")
diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm
index a8d6e7840a..ba988f450d 100644
--- a/code/modules/surgery/organs/tongue.dm
+++ b/code/modules/surgery/organs/tongue.dm
@@ -15,7 +15,8 @@
/datum/language/monkey,
/datum/language/narsie,
/datum/language/beachbum,
- /datum/language/ratvar
+ /datum/language/ratvar,
+ /datum/language/aphasia
))
/obj/item/organ/tongue/Initialize(mapload)
diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm
index 78f258be67..cc0324ab6a 100644
--- a/code/modules/surgery/organs/vocal_cords.dm
+++ b/code/modules/surgery/organs/vocal_cords.dm
@@ -119,7 +119,7 @@
///////////VOICE OF GOD///////////////
//////////////////////////////////////
-/proc/voice_of_god(message, mob/living/user, list/span_list, base_multiplier = 1)
+/proc/voice_of_god(message, mob/living/user, list/span_list, base_multiplier = 1, include_speaker = FALSE, message_admins = TRUE)
var/cooldown = 0
if(!user || !user.can_speak() || user.stat)
@@ -139,7 +139,9 @@
message = lowertext(message)
var/mob/living/list/listeners = list()
for(var/mob/living/L in get_hearers_in_view(8, user))
- if(L.can_hear() && !L.null_rod_check() && L != user && L.stat != DEAD)
+ if(L.can_hear() && !L.null_rod_check() && L.stat != DEAD)
+ if(L == user && !include_speaker)
+ continue
if(ishuman(L))
var/mob/living/carbon/human/H = L
if(istype(H.ears, /obj/item/clothing/ears/earmuffs))
@@ -209,12 +211,12 @@
var/static/regex/stun_words = regex("stop|wait|stand still|hold on|halt")
var/static/regex/knockdown_words = regex("drop|fall|trip|knockdown")
var/static/regex/sleep_words = regex("sleep|slumber|rest")
- var/static/regex/vomit_words = regex("vomit|throw up")
- var/static/regex/silence_words = regex("shut up|silence|ssh|quiet|hush")
+ var/static/regex/vomit_words = regex("vomit|throw up|sick")
+ var/static/regex/silence_words = regex("shut up|silence|be silent|ssh|quiet|hush")
var/static/regex/hallucinate_words = regex("see the truth|hallucinate")
var/static/regex/wakeup_words = regex("wake up|awaken")
- var/static/regex/heal_words = regex("live|heal|survive|mend|heroes never die")
- var/static/regex/hurt_words = regex("die|suffer|hurt|pain")
+ var/static/regex/heal_words = regex("live|heal|survive|mend|life|heroes never die")
+ var/static/regex/hurt_words = regex("die|suffer|hurt|pain|death")
var/static/regex/bleed_words = regex("bleed|there will be blood")
var/static/regex/burn_words = regex("burn|ignite")
var/static/regex/hot_words = regex("heat|hot|hell")
@@ -566,7 +568,8 @@
else
cooldown = COOLDOWN_NONE
- message_admins("[key_name_admin(user)] has said '[log_message]' with a Voice of God, affecting [english_list(listeners)], with a power multiplier of [power_multiplier].")
+ if(message_admins)
+ message_admins("[key_name_admin(user)] has said '[log_message]' with a Voice of God, affecting [english_list(listeners)], with a power multiplier of [power_multiplier].")
log_game("[key_name(user)] has said '[log_message]' with a Voice of God, affecting [english_list(listeners)], with a power multiplier of [power_multiplier].")
SSblackbox.record_feedback("tally", "voice_of_god", 1, log_message)
diff --git a/config/config.txt b/config/config.txt
index fb648a5fa9..e43b38b568 100644
--- a/config/config.txt
+++ b/config/config.txt
@@ -1,3 +1,9 @@
+# You can use the "$include" directive to split your configs however you want
+
+$include game_options.txt
+$include dbconfig.txt
+$include comms.txt
+
# You can use the @ character at the beginning of a config option to lock it from being edited in-game
# Example usage:
# @SERVERNAME tgstation
diff --git a/html/changelog.html b/html/changelog.html
index 45dfe57b20..d73ebdcd62 100644
--- a/html/changelog.html
+++ b/html/changelog.html
@@ -1279,3 +1279,1492 @@