diff --git a/internal/lightcone/hunt/baptismofpurethought/baptismofpurethought.go b/internal/lightcone/hunt/baptismofpurethought/baptismofpurethought.go new file mode 100644 index 00000000..ded30ec2 --- /dev/null +++ b/internal/lightcone/hunt/baptismofpurethought/baptismofpurethought.go @@ -0,0 +1,100 @@ +package baptismofpurethought + +import ( + "github.com/simimpact/srsim/pkg/engine" + "github.com/simimpact/srsim/pkg/engine/equip/lightcone" + "github.com/simimpact/srsim/pkg/engine/event" + "github.com/simimpact/srsim/pkg/engine/info" + "github.com/simimpact/srsim/pkg/engine/modifier" + "github.com/simimpact/srsim/pkg/engine/prop" + "github.com/simimpact/srsim/pkg/key" + "github.com/simimpact/srsim/pkg/model" +) + +const ( + Check = "baptism-of-pure-thought" + Disputation = "baptism-of-pure-thought-disputation-buff" +) + +type state struct { + cdmgBonusInc float64 + dmgBonus float64 + defignore float64 +} + +// Increases the wearer's CRIT DMG by 20/23/26/29/32%. For every debuff on the enemy target, +// the wearer's CRIT DMG dealt against this target additionally increases by 8/9/10/11/12%, stacking up to 3 times. +// When using Ultimate to attack the enemy target, the wearer receives the Disputation effect, +// which increases DMG dealt by 36/42/48/54/60% and enables their follow-up attacks to ignore 24/28/32/36/40% of the target's DEF. +// This effect lasts for 2 turns. + +func init() { + lightcone.Register(key.BaptismofPureThought, lightcone.Config{ + CreatePassive: Create, + Rarity: 5, + Path: model.Path_HUNT, + Promotions: promotions, + }) + + modifier.Register(Check, modifier.Config{ + Listeners: modifier.Listeners{ + OnBeforeHitAll: applyCdmgInc, + OnBeforeAttack: applyDisputation, + }, + }) + + modifier.Register(Disputation, modifier.Config{ + StatusType: model.StatusType_STATUS_BUFF, + Stacking: modifier.ReplaceBySource, + CanDispel: true, + Listeners: modifier.Listeners{ + OnBeforeHitAll: applyDefignore, + }, + }) +} + +func Create(engine engine.Engine, owner key.TargetID, lc info.LightCone) { + cdmgAmt := 0.17 + 0.03*float64(lc.Imposition) + cdmgIncAmt := 0.07 + 0.01*float64(lc.Imposition) + dmgAmt := 0.3 + 0.06*float64(lc.Imposition) + defignoreAmt := 0.2 + 0.04*float64(lc.Imposition) + + engine.AddModifier(owner, info.Modifier{ + Name: Check, + Source: owner, + Stats: info.PropMap{prop.CritDMG: cdmgAmt}, + State: &state{ + cdmgBonusInc: cdmgIncAmt, + dmgBonus: dmgAmt, + defignore: defignoreAmt, + }, + }) +} + +func applyCdmgInc(mod *modifier.Instance, e event.HitStart) { + debuffCount := mod.Engine().ModifierStatusCount(e.Defender, model.StatusType_STATUS_DEBUFF) + if debuffCount > 3 { + debuffCount = 3 + } + cdmgBonusInc := mod.State().(state).cdmgBonusInc + e.Hit.Attacker.AddProperty(Check, prop.CritDMG, float64(debuffCount)*cdmgBonusInc) +} + +func applyDisputation(mod *modifier.Instance, e event.AttackStart) { + // this might need to be a SkillType/ActionType check in the future + if e.AttackType == model.AttackType_ULT { + st := mod.State().(state) + mod.Engine().AddModifier(mod.Owner(), info.Modifier{ + Name: Disputation, + Source: mod.Owner(), + Stats: info.PropMap{prop.AllDamagePercent: st.dmgBonus}, + State: st.defignore, + }) + } +} + +func applyDefignore(mod *modifier.Instance, e event.HitStart) { + if e.Hit.AttackType == model.AttackType_INSERT { + e.Hit.Defender.AddProperty(Disputation, prop.DEFPercent, -mod.State().(float64)) + } +} diff --git a/internal/lightcone/hunt/baptismofpurethought/data.go b/internal/lightcone/hunt/baptismofpurethought/data.go new file mode 100644 index 00000000..c66ebd6f --- /dev/null +++ b/internal/lightcone/hunt/baptismofpurethought/data.go @@ -0,0 +1,71 @@ +// Code generated by "weapstat"; DO NOT EDIT. + +package baptismofpurethought + +import "github.com/simimpact/srsim/pkg/engine/equip/lightcone" + +var promotions = []lightcone.PromotionData{ + { + MaxLevel: 20, + HPBase: 43.2, + HPAdd: 6.48, + ATKBase: 26.4, + ATKAdd: 3.96, + DEFBase: 24, + DEFAdd: 3.6, + }, + { + MaxLevel: 30, + HPBase: 95.04, + HPAdd: 6.48, + ATKBase: 58.08, + ATKAdd: 3.96, + DEFBase: 52.8, + DEFAdd: 3.6, + }, + { + MaxLevel: 40, + HPBase: 164.16, + HPAdd: 6.48, + ATKBase: 100.32, + ATKAdd: 3.96, + DEFBase: 91.2, + DEFAdd: 3.6, + }, + { + MaxLevel: 50, + HPBase: 233.28, + HPAdd: 6.48, + ATKBase: 142.56, + ATKAdd: 3.96, + DEFBase: 129.6, + DEFAdd: 3.6, + }, + { + MaxLevel: 60, + HPBase: 302.4, + HPAdd: 6.48, + ATKBase: 184.8, + ATKAdd: 3.96, + DEFBase: 168, + DEFAdd: 3.6, + }, + { + MaxLevel: 70, + HPBase: 371.52, + HPAdd: 6.48, + ATKBase: 227.04, + ATKAdd: 3.96, + DEFBase: 206.4, + DEFAdd: 3.6, + }, + { + MaxLevel: 80, + HPBase: 440.64, + HPAdd: 6.48, + ATKBase: 269.28, + ATKAdd: 3.96, + DEFBase: 244.8, + DEFAdd: 3.6, + }, +} \ No newline at end of file diff --git a/pkg/key/lightcone.go b/pkg/key/lightcone.go index bf2afa89..08daf2ac 100644 --- a/pkg/key/lightcone.go +++ b/pkg/key/lightcone.go @@ -31,6 +31,7 @@ const ( ReturntoDarkness LightCone = "return_to_darkness" SleepLiketheDead LightCone = "sleep_like_the_dead" IntheNight LightCone = "in_the_night" + BaptismofPureThought LightCone = "baptism_of_pure_thought" ) // Nihility diff --git a/pkg/simulation/imports.go b/pkg/simulation/imports.go index 78e8c59e..f939f44e 100644 --- a/pkg/simulation/imports.go +++ b/pkg/simulation/imports.go @@ -76,6 +76,7 @@ import ( _ "github.com/simimpact/srsim/internal/lightcone/harmony/planetaryrendezvous" _ "github.com/simimpact/srsim/internal/lightcone/hunt/adversarial" _ "github.com/simimpact/srsim/internal/lightcone/hunt/arrows" + _ "github.com/simimpact/srsim/internal/lightcone/hunt/baptismofpurethought" _ "github.com/simimpact/srsim/internal/lightcone/hunt/cruisinginthestellarsea" _ "github.com/simimpact/srsim/internal/lightcone/hunt/dartingarrow" _ "github.com/simimpact/srsim/internal/lightcone/hunt/inthenight"