Guest User

Untitled

a guest
Jan 26th, 2026
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 3.85 KB | Source Code | 0 0
  1. private enum class CarabosseForm(
  2.     val transitionSkill: MobSkillId?,
  3.     val mobSkills: List<MobSkillId>,
  4.     val spells: List<SpellSkillId>,
  5. ) {
  6.     None(
  7.         transitionSkill = null,
  8.         mobSkills = listOf(mskillZephyrArrow_1937, mskillLetheArrows_1938),
  9.         spells = emptyList(),
  10.     ),
  11.     Winter(
  12.         transitionSkill = mskillWinterBreeze_1942,
  13.         mobSkills = emptyList(), spells =
  14.         listOf(spellTornado_208),
  15.     ),
  16.     Summer(
  17.         transitionSkill = mskillSummerBreeze_1940,
  18.         mobSkills = listOf(mskillCyclonicTurmoil_1943, mskillCyclonicTorrent_1944),
  19.         spells = emptyList(),
  20.     ),
  21.     Spring(
  22.         transitionSkill = mskillSpringBreeze_1939,
  23.         mobSkills = emptyList(),
  24.         spells = listOf(spellParalyze_58, spellStun_252, spellSlowII_79, spellGravity_216),
  25.     ),
  26.     Autumn(
  27.         transitionSkill = mskillAutumnBreeze_1941,
  28.         mobSkills = emptyList(),
  29.         spells = listOf(spellBlink_53, spellRegenII_110, spellHasteII_511),
  30.     ),
  31. }
  32.  
  33. class MobCarabosseController(actorState: ActorState): V0MonsterController(actorState) {
  34.  
  35.     private var hasUsedBenediction = false
  36.     private var currentForm = CarabosseForm.None
  37.     private val wantsToChangeForms = FrameTimer(period = 20.seconds, initial = Duration.ZERO)
  38.  
  39.     init {
  40.         spellTimer = FrameTimer(5.seconds)
  41.     }
  42.  
  43.     override fun update(elapsedFrames: Float): List<Event> {
  44.         wantsToChangeForms.update(elapsedFrames)
  45.         return super.update(elapsedFrames)
  46.     }
  47.  
  48.     override fun onSkillExecuted(primaryTargetContext: SkillApplierHelper.TargetEvaluatorContext): List<Event> {
  49.         if (primaryTargetContext.skill == mskillBenediction_1230) {
  50.             hasUsedBenediction = true
  51.             return emptyList()
  52.         }
  53.  
  54.         val resultForm = CarabosseForm.values().firstOrNull { primaryTargetContext.skill == it.transitionSkill }
  55.         if (resultForm != null) {
  56.             currentForm = resultForm
  57.             wantsToChangeForms.reset()
  58.             return emptyList()
  59.         }
  60.  
  61.         return emptyList()
  62.     }
  63.  
  64.     override fun applyMonsterBehaviorBonuses(aggregate: CombatBonusAggregate) {
  65.         aggregate.refresh += 10
  66.         aggregate.fastCast += 33
  67.         aggregate.spellInterruptDown += 100
  68.  
  69.         aggregate.fullResist(StatusEffect.Sleep, StatusEffect.Silence)
  70.  
  71.         when (currentForm) {
  72.             CarabosseForm.None -> {
  73.                
  74.             }
  75.             CarabosseForm.Winter -> {
  76.                 aggregate.magicAttackBonus += 50
  77.             }
  78.             CarabosseForm.Summer -> {
  79.                 aggregate.doubleAttack += 50
  80.             }
  81.             CarabosseForm.Spring -> {
  82.             }
  83.             CarabosseForm.Autumn -> {
  84.                 aggregate.regen += (actorState.getMaxHp() * 0.01f).roundToInt()
  85.                 aggregate.magicalDamageTaken -= 100
  86.             }
  87.         }
  88.     }
  89.  
  90.     override fun wantsToUseSkill(): Boolean {
  91.         return if (!hasUsedBenediction && actorState.getHpp() < 0.5f) { true } else { super.wantsToUseSkill() }
  92.     }
  93.  
  94.     override fun getSkills(): List<SkillId> {
  95.         return if (hasUsedBenediction && wantsToChangeForms.isReady()) {
  96.             listOf(
  97.                 mskillSpringBreeze_1939,
  98.                 mskillSummerBreeze_1940,
  99.                 mskillAutumnBreeze_1941,
  100.                 mskillWinterBreeze_1942,
  101.             ).filter { it != currentForm.transitionSkill }
  102.         } else {
  103.             currentForm.mobSkills
  104.         }
  105.     }
  106.  
  107.     override fun selectSkill(): SkillSelection? {
  108.         return if (!hasUsedBenediction && actorState.getHpp() <= 0.5) {
  109.             SkillSelection(mskillBenediction_1230, actorState)
  110.         } else {
  111.             super.selectSkill()
  112.         }
  113.     }
  114.  
  115.     override fun getSpells(): List<SkillId> {
  116.         return currentForm.spells
  117.     }
  118.  
  119. }
Add Comment
Please, Sign In to add comment