Skip to content

Commit

Permalink
Datum handling
Browse files Browse the repository at this point in the history
  • Loading branch information
silencer-pl committed Sep 29, 2024
1 parent 78b9352 commit 22dee26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
5 changes: 3 additions & 2 deletions code/modules/pve/boss/abilities/boss_click_actions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

var/mob/living/pve_boss/attached_mob

/datum/bossclicking/proc/AssignMob(mob/owner_mob)
attached_mob = owner_mob
/datum/bossclicking/New()
. = ..()
attached_mob = src

/datum/bossclicking/proc/InterceptClickOn(mob/user, params, atom/object)

Expand Down
20 changes: 7 additions & 13 deletions code/modules/pve/boss/boss.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
var/boss_type = "default"
//below should be safely disregarded if type is not set to 1
var/boss_stage = 1
var/datum/boss_action/boss_ability = /datum/boss_action/
var/datum/bossclicking/boss_click_intercept = /datum/bossclicking/
var/datum/boss_action/boss_ability

var/list/boss_abilities = list()
var/list/ability_cooldowns = list()
var/explosion_damage = 30
Expand All @@ -23,23 +23,17 @@

/mob/living/pve_boss/Initialize()
. = ..()
boss_ability.set_owner(src)
boss_click_intercept.AssignMob(src)
click_intercept = boss_click_intercept
boss_ability = new /datum/boss_action/
click_intercept = new /datum/bossclicking/

/datum/boss_action/

var/mob/owner = null


/datum/boss_action/proc/set_owner(mob/owner_mob) // Assigns owner reference, makes some of the ability code easier. null will null the owner value.
if(!owner_mob)
if(owner)
owner = null
else
return
owner = owner_mob
return
/datum/boss_action/New() // Assigns owner reference, makes some of the ability code easier. null will null the owner value.
. = ..()
owner = src

/datum/boss_action/proc/switch_action() // Called to switch the active action. This also defines which action is getting its cooldown set etc
var/mob/living/pve_boss/boss_mob = owner
Expand Down

0 comments on commit 22dee26

Please sign in to comment.