Borgs can now use nutrition to recharge. (#6715)

This commit is contained in:
Verkister
2023-08-05 08:20:08 +03:00
committed by GitHub
parent 569f1d5abf
commit ae8d9a853f
3 changed files with 14 additions and 5 deletions

View File

@@ -1315,9 +1315,9 @@
items_preserved |= item
else
owner.adjust_nutrition((nutrition_percent / 100) * 5 * digested)
if(isrobot(owner))
var/mob/living/silicon/robot/R = owner
R.cell.charge += ((nutrition_percent / 100) * 50 * digested)
// if(isrobot(owner)) //CHOMPEdit: Borgos can now use nutrition too.
// var/mob/living/silicon/robot/R = owner
// R.cell.charge += ((nutrition_percent / 100) * 50 * digested)
digested = TRUE //CHOMPEdit
return digested

View File

@@ -86,7 +86,7 @@ GLOBAL_LIST_INIT(digest_modes, list())
var/difference = B.owner.size_multiplier / L.size_multiplier
if(B.health_impacts_size) //CHOMPEdit - Health probably changed so...
B.owner.update_fullness() //CHOMPEdit - This is run whenever a belly's contents are changed.
if(isrobot(B.owner))
/*if(isrobot(B.owner)) //CHOMPEdit: Borgos can now use nutrition too
if(B.reagent_mode_flags & DM_FLAG_REAGENTSDIGEST && B.reagents.total_volume < B.reagents.maximum_volume) //digestion producing reagents
var/mob/living/silicon/robot/R = B.owner
R.cell.charge += 20*damage_gain
@@ -94,7 +94,7 @@ GLOBAL_LIST_INIT(digest_modes, list())
B.GenerateBellyReagents_digesting()
else
var/mob/living/silicon/robot/R = B.owner
R.cell.charge += 25*damage_gain
R.cell.charge += 25*damage_gain */
if(offset && damage_gain > 0) // If any different than default weight, multiply the % of offset.
if(B.reagent_mode_flags & DM_FLAG_REAGENTSDIGEST && B.reagents.total_volume < B.reagents.maximum_volume) //digestion producing reagents
B.owner.adjust_nutrition(offset * (3 * damage_gain / difference) * L.get_digestion_nutrition_modifier() * B.owner.get_digestion_efficiency_modifier()) //Uncertain if balanced fairly, can adjust by multiplier for the cost of reagent, dont go below 1 or else it will result in more nutrition than normal - Jack

View File

@@ -1,3 +1,5 @@
/mob/living/silicon/robot
nutrition = 0 //No starter nutrition to overcharge the cell with.
/mob/living/silicon/robot/updateicon() //TODO - Make the belly stuff resting sprite stuff into feature flags and replace dogborg var - 7/19/23
vr_sprite_check()
@@ -79,3 +81,10 @@
else if (vis_height != module_sprites[icontype][SKIN_HEIGHT])
vis_height = module_sprites[icontype][SKIN_HEIGHT]
update_transform()
/mob/living/silicon/robot/use_power()
if(cell && cell.charge < cell.maxcharge)
if(nutrition >= 20)
nutrition -= 20
cell.charge += 200
..()