Skip to content

Commit

Permalink
Mass Changes: Part 2a
Browse files Browse the repository at this point in the history
  • Loading branch information
BurgerLUA committed Oct 4, 2024
1 parent 8c635ef commit 41222a5
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 104 deletions.
62 changes: 11 additions & 51 deletions code/_core/mob/living/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,30 +90,6 @@

return TRUE


/*
/mob/living/proc/do_loot_drop(var/atom/desired_loc)
if(desired_loc && loot_drop && health)
var/loot/L = all_loot[loot_drop]
if(!is_turf(desired_loc))
return FALSE
if(loot_drop_in_corpse)
L.spawn_loot_corpse(desired_loc)
else
L.spawn_loot_turf(desired_loc)
var/obj/item/currency/C = new(src.loc)
C.value = 1 + FLOOR(health.health_max/10, 1)
INITIALIZE(C)
step_rand(C)
return TRUE
return FALSE
*/

/mob/living/proc/revive()
if(!dead)
return FALSE
Expand Down Expand Up @@ -198,7 +174,15 @@
on_killed(people_who_killed) //people_who_killed can be empty.

if(length(people_who_killed))
if(!boss)
if(boss)
for(var/k in people_who_killed)
var/mob/living/advanced/player/P = k
if(!is_player(P))
continue
INCREASE_ACHIEVEMENT(P,"bosses_killed",1)
if(T)
create_gold_drop(T,CEILING(src.health.health_max/10,1))
else
if(!was_killed && !minion_master && !delete_on_death && health && health.health_max >= 100 && src.get_xp_multiplier() >= 1)
for(var/k in people_who_killed)
var/mob/living/advanced/player/P = k
Expand All @@ -215,32 +199,8 @@
var/credits_given = P.adjust_currency(credits_to_give,silent=TRUE)
if(credits_given > 0)
P.to_chat(span("notice","You gained [credits_given] credits for killing [src.name]."),CHAT_TYPE_COMBAT)
else
var/rarity = 0
var/rarity_count = 0
for(var/k in people_who_killed)
var/mob/living/advanced/player/P = k
if(!is_player(P))
continue
rarity += P.get_rarity()
rarity_count++
INCREASE_ACHIEVEMENT(P,"bosses_killed",1)
if(T)
create_gold_drop(T,CEILING(src.health.health_max/10,1))
if(rarity_count > 0)
rarity *= 1/rarity_count
var/list/loot_spawned = SPAWN_LOOT(/loot/boss,T,rarity)
for(var/k in loot_spawned)
var/obj/item/I = k
var/item_move_dir = pick(DIRECTIONS_ALL)
var/turf/turf_to_move_to = get_step(T,item_move_dir)
if(!turf_to_move_to)
turf_to_move_to = T
I.force_move(turf_to_move_to)
var/list/pixel_offsets = direction_to_pixel_offset(item_move_dir)
I.pixel_x = -pixel_offsets[1]*TILE_SIZE
I.pixel_y = -pixel_offsets[2]*TILE_SIZE
animate(I,pixel_x=rand(-8,8),pixel_y=rand(-8,8),time=5)




HOOK_CALL("post_death")
Expand Down
53 changes: 26 additions & 27 deletions code/_core/obj/item/corrupting_frog.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,50 @@
icon = 'icons/obj/item/corrupting_frog.dmi'
icon_state = "inventory"
desc = "One frog was harmed in the making of this item."
desc_extended = "A magical wooden frog doll that has the ability to sacrifice one item into another similiar item. Must be used on an item on the ground. Has one use, then disappears."
desc_extended = "A magical wooden frog doll that has the abiltity to randomize the quality of an object between 1% and 300%. Single use."
rarity = RARITY_LEGENDARY
value = 4000
value_burgerbux = 1
var/can_use = TRUE

/obj/item/corrupting_frog/click_on_object(var/mob/caller,var/atom/object,location,control,params)

if(!is_item(object) || !is_turf(object.loc))
if(!can_use || !is_item(object))
return ..()

var/obj/item/O = object
var/obj/item/I = object

if(!O.is_safe_to_delete())
return ..()
INTERACT_CHECK
INTERACT_CHECK_OBJECT

var/list/possible_types = subtypesof(O.type)
possible_types += typesof(O.parent_type) - O.type
if(!I.can_save)
caller.to_chat(span("warning","You can't temper \the [I.name] with \the [src.name]! Try tempering the main part of this clothing set."))
return FALSE

for(var/k in possible_types)
if(!SSbalance.stored_value[k])
possible_types -= k
if(I.quality <= -1)
caller.to_chat(span("warning","\The [src.name] cannot be used with \the [I.name]!"))
return FALSE

if(!length(possible_types))
caller.to_chat(span("warning","\The [src.name] doesn't seem to work on \the [O.name]..."))
return TRUE
var/choice = input("Are you sure you want to corrupt \the [I.name]?","Corrupting Frog") as null|anything in list("Yes","No","Cancel")
if(choice != "Yes")
return ..()

var/turf/T = get_turf(O)
INTERACT_CHECK
INTERACT_CHECK_OBJECT

var/old_object_name = O.name
if(!can_use) //Prevents race conditions.
return FALSE

qdel(O)
can_use = FALSE

var/obj/item/I = pick(possible_types)
I = new I(T)
INITIALIZE(I)
GENERATE(I)
FINALIZE(I)
play_sound('sound/weapons/magic/zap_large.ogg',get_turf(src))

visible_message(
span("notice","With the flick of \the [src.name], \the [caller.name] turns \the [old_object_name] into \the [I.name]!"),
span("notice","With the flick of \the [src.name], you turn \the [old_object_name] into \the [I.name]!")
)
I.quality = rand(1,300)

play_sound('sound/weapons/magic/zap_large.ogg',T)
if(is_clothing(I))
var/obj/item/clothing/C = I
C.sync_additional_clothing()

qdel(src)

return TRUE
return TRUE
2 changes: 1 addition & 1 deletion code/_core/obj/item/tempering/_tempering.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
return TRUE
else if(!is_inventory(object))
if(can_temper(caller,object))
var/choice = input("Are you sure you want to temper \the [object.name]?","ALT+Click to skip this next time") as null|anything in list("Yes","No")
var/choice = input("Are you sure you want to temper \the [object.name]?","ALT+Click to skip this next time") as null|anything in list("Yes","No","Cancel")
if(choice == "Yes")
INTERACT_CHECK
INTERACT_CHECK_OBJECT
Expand Down
1 change: 1 addition & 0 deletions code/_core/obj/item/weapon/ranged/bow/_bow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@
ranged_damage_type = /damagetype/ranged/bow/hardlight/syndicate
stage_per_decisecond = 8
stage_max = 125
rarity = RARITY_RARE

/obj/item/weapon/ranged/bow/ashen
name = "ashen bow"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,27 @@
shoot_alert = ALERT_LEVEL_NONE

attachment_whitelist = list(
/obj/item/attachment/barrel/charger = TRUE,
/obj/item/attachment/barrel/charger/advanced = TRUE,
/obj/item/attachment/barrel/charger = TRUE, /obj/item/attachment/barrel/charger/advanced = TRUE,
/obj/item/attachment/barrel/compensator = TRUE,
/obj/item/attachment/barrel/extended = TRUE,
/obj/item/attachment/barrel/gyro = TRUE,
/obj/item/attachment/barrel/laser_charger = FALSE,
/obj/item/attachment/barrel/suppressor = TRUE,
/obj/item/attachment/barrel_mod/reinforced_barrel = TRUE,
/obj/item/attachment/stock_mod/reinforced_stock = TRUE,

/obj/item/attachment/sight/laser_sight = TRUE,
/obj/item/attachment/sight/quickfire_adapter = TRUE,
/obj/item/attachment/sight/red_dot = TRUE,
/obj/item/attachment/sight/scope = TRUE,
/obj/item/attachment/sight/scope/large = TRUE,
/obj/item/attachment/sight/targeting_computer = TRUE,

/obj/item/attachment/undermount/angled_grip = TRUE,
/obj/item/attachment/undermount/bipod = TRUE,
/obj/item/attachment/undermount/burst_adapter = TRUE
/obj/item/attachment/undermount/burst_adapter = FALSE,
/obj/item/attachment/undermount/vertical_grip = TRUE,
/obj/item/attachment/undermount/gun/grenade_launcher = TRUE
)

attachment_barrel_offset_x = 32 - 16
Expand Down
2 changes: 1 addition & 1 deletion code/_core/obj/structure/interactive/boss_loot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
return ..()

/obj/structure/interactive/boss_loot/Finalize()
die_time = world.time + SECONDS_TO_DECISECONDS(120)
die_time = world.time + SECONDS_TO_DECISECONDS(180)
START_THINKING(src)
return ..()

Expand Down
51 changes: 30 additions & 21 deletions code/_core/world/subsystems/boss.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,49 @@ SUBSYSTEM_DEF(bosses)

/subsystem/bosses/proc/check_boss(var/mob/living/L)

if(L.dead || L.qdeleting)
for(var/v in L.players_fighting_boss)
var/mob/living/advanced/P = v
if(!P || P.qdeleting)
L.players_fighting_boss -= v
continue
if(L.dead || L.qdeleting) //Boss is dead or deleted.
for(var/k in L.players_fighting_boss)
var/mob/living/advanced/P = k
L.remove_player_from_boss(P)
CHECK_TICK(tick_usage_max,FPS_SERVER*5)
return FALSE

var/turf/boss_turf = get_turf(L)
for(var/v in L.players_fighting_boss)
var/mob/living/advanced/player/P = v
var/turf/player_turf = get_turf(P)
if(!boss_turf || !player_turf || player_turf.z != boss_turf.z)
L.remove_player_from_boss(P)
continue
if(get_dist(player_turf,boss_turf) >= L.boss_range*2)
if(L.ai)
var/ai/AI = L.ai
if(AI.objective_attack)
var/turf/T = get_turf(AI.objective_attack)
if(T && T.z == P.z && get_dist(T,P) <= L.boss_range*2)
continue
L.remove_player_from_boss(P)
CHECK_TICK(tick_usage_max,FPS_SERVER*5)

if(L.ai)
var/ai/AI = L.ai
if(AI.objective_attack)
if(AI.objective_attack) //Boss is officially in combat.
for(var/mob/living/advanced/player/P in viewers(L.boss_range,L))
if(L.loyalty_tag == P.loyalty_tag)
continue

CHECK_TICK(tick_usage_max,FPS_SERVER*5)
L.add_player_to_boss(P)

for(var/v in L.players_fighting_boss)
var/mob/living/advanced/player/P = v
CHECK_TICK(tick_usage_max,FPS_SERVER*5)
if(get_dist(P,L) >= L.boss_range*2)
L.remove_player_from_boss(P)
CHECK_TICK(tick_usage_max,FPS_SERVER*5)

return TRUE

/subsystem/bosses/on_life()

for(var/k in tracked_bosses)
var/mob/living/L = k
if(!L)
if(!L) // Invalid entry, for some reason.
tracked_bosses -= k
continue
if(check_boss(L) == null)
if(!check_boss(L))
tracked_bosses -= L
qdel(L)
log_error("WARNING! Boss [L.get_debug_name()] didn't complete tracked_bosses() and thus was deleted.")
Expand All @@ -73,17 +80,19 @@ SUBSYSTEM_DEF(bosses)
B.update_stats()

/mob/living/proc/add_player_to_boss(var/mob/living/advanced/player/P)
if(P in src.players_fighting_boss)
if(!P || P.qdeleting) //Can't add an invalid player.
return FALSE
players_fighting_boss += P
players_fighting_boss |= P
for(var/obj/hud/button/boss_health/B in P.buttons)
B.target_bosses |= src
B.update_stats()
return TRUE

/mob/living/proc/remove_player_from_boss(var/mob/living/advanced/player/P)
if(!(P in src.players_fighting_boss))
return FALSE
players_fighting_boss -= P
if(!P || P.qdeleting)
return TRUE
for(var/obj/hud/button/boss_health/B in P.buttons)
B.target_bosses -= src
B.update_stats()
return TRUE

0 comments on commit 41222a5

Please sign in to comment.