-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Crimson Moon's Semblance add Crimson Moon's Semblance add Crimson Moon's Semblance
- Loading branch information
1 parent
408e19f
commit e5530ee
Showing
11 changed files
with
227 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package_name: crimsonmoonssemblance | ||
genshin_id: 13512 | ||
key: crimsonmoonssemblance |
88 changes: 88 additions & 0 deletions
88
internal/weapons/spear/crimsonmoonssemblance/crimsonmoonssemblance.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package crimsonmoonssemblance | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/genshinsim/gcsim/pkg/core" | ||
"github.com/genshinsim/gcsim/pkg/core/attacks" | ||
"github.com/genshinsim/gcsim/pkg/core/attributes" | ||
"github.com/genshinsim/gcsim/pkg/core/combat" | ||
"github.com/genshinsim/gcsim/pkg/core/event" | ||
"github.com/genshinsim/gcsim/pkg/core/info" | ||
"github.com/genshinsim/gcsim/pkg/core/keys" | ||
"github.com/genshinsim/gcsim/pkg/core/player/character" | ||
"github.com/genshinsim/gcsim/pkg/modifier" | ||
) | ||
|
||
const ( | ||
icdKey = "crimsonmoonssemblance-icd" | ||
icdDuration = 14 * 60 | ||
) | ||
|
||
func init() { | ||
core.RegisterWeaponFunc(keys.CrimsonMoonsSemblance, NewWeapon) | ||
} | ||
|
||
type Weapon struct { | ||
Index int | ||
core *core.Core | ||
char *character.CharWrapper | ||
refine int | ||
} | ||
|
||
func (w *Weapon) SetIndex(idx int) { w.Index = idx } | ||
func (w *Weapon) Init() error { return nil } | ||
|
||
func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) (info.Weapon, error) { | ||
w := &Weapon{ | ||
char: char, | ||
core: c, | ||
refine: p.Refine, | ||
} | ||
|
||
c.Events.Subscribe(event.OnEnemyHit, func(args ...interface{}) bool { | ||
ae := args[1].(*combat.AttackEvent) | ||
|
||
if ae.Info.AttackTag != attacks.AttackTagExtra { | ||
return false | ||
} | ||
|
||
if w.core.Player.Active() != w.char.Index { | ||
return false | ||
} | ||
|
||
if w.char.StatusIsActive(icdKey) { | ||
return false | ||
} | ||
|
||
w.char.AddStatus(icdKey, icdDuration, true) | ||
w.char.ModifyHPDebtByRatio(0.25) | ||
|
||
return false | ||
}, fmt.Sprintf("crimsonmoonssemblance-hit-%v", char.Base.Key.String())) | ||
|
||
c.Events.Subscribe(event.OnHPDebt, func(args ...interface{}) bool { | ||
maxhp := w.char.MaxHP() | ||
m := make([]float64, attributes.EndStatType) | ||
|
||
if w.char.CurrentHPDebt() > 0 { | ||
m[attributes.DmgP] += 0.08 + 0.04*float64(w.refine) | ||
} | ||
|
||
if w.char.CurrentHPDebt() >= 0.3*maxhp { | ||
m[attributes.DmgP] += 0.16 + 0.08*float64(w.refine) | ||
} | ||
|
||
w.char.AddStatMod(character.StatMod{ | ||
Base: modifier.NewBaseWithHitlag("crimsonmoonssemblance-bonus", -1), | ||
AffectedStat: attributes.DmgP, | ||
Amount: func() ([]float64, bool) { | ||
return m, true | ||
}, | ||
}) | ||
|
||
return false | ||
}, fmt.Sprintf("crimsonmoonssemblance-hp-debt-%v", char.Base.Key.String())) | ||
|
||
return w, nil | ||
} |
25 changes: 25 additions & 0 deletions
25
internal/weapons/spear/crimsonmoonssemblance/crimsonmoonssemblance_gen.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
internal/weapons/spear/crimsonmoonssemblance/data_gen.textproto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
id: 13512 | ||
key: "crimsonmoonssemblance" | ||
rarity: 5 | ||
weapon_class: WEAPON_POLE | ||
image_name: "UI_EquipIcon_Pole_BloodMoon" | ||
base_stats: { | ||
base_props: { | ||
prop_type: FIGHT_PROP_BASE_ATTACK | ||
initial_value: 47.537 | ||
curve: GROW_CURVE_ATTACK_302 | ||
} | ||
base_props: { | ||
prop_type: FIGHT_PROP_CRITICAL | ||
initial_value: 0.048 | ||
curve: GROW_CURVE_CRITICAL_301 | ||
} | ||
promo_data: { | ||
max_level: 20 | ||
} | ||
promo_data: { | ||
max_level: 40 | ||
add_props: { | ||
prop_type: FIGHT_PROP_BASE_ATTACK | ||
value: 31.1 | ||
} | ||
} | ||
promo_data: { | ||
max_level: 50 | ||
add_props: { | ||
prop_type: FIGHT_PROP_BASE_ATTACK | ||
value: 62.2 | ||
} | ||
} | ||
promo_data: { | ||
max_level: 60 | ||
add_props: { | ||
prop_type: FIGHT_PROP_BASE_ATTACK | ||
value: 93.4 | ||
} | ||
} | ||
promo_data: { | ||
max_level: 70 | ||
add_props: { | ||
prop_type: FIGHT_PROP_BASE_ATTACK | ||
value: 124.5 | ||
} | ||
} | ||
promo_data: { | ||
max_level: 80 | ||
add_props: { | ||
prop_type: FIGHT_PROP_BASE_ATTACK | ||
value: 155.6 | ||
} | ||
} | ||
promo_data: { | ||
max_level: 90 | ||
add_props: { | ||
prop_type: FIGHT_PROP_BASE_ATTACK | ||
value: 186.7 | ||
} | ||
} | ||
} | ||
name_text_hash_map: 2944936683 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
ui/packages/docs/docs/reference/weapons/crimsonmoonssemblance.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: Crimson Moon's Semblance | ||
--- | ||
|
||
import AoETable from "@site/src/components/AoE/AoETable"; import IssuesTable from "@site/src/components/Issues/IssuesTable"; import NamesList from "@site/src/components/Names/NamesList"; import ParamsTable from "@site/src/components/Params/ParamsTable"; import FieldsTable from "@site/src/components/Fields/FieldsTable"; | ||
|
||
## AoE Data | ||
|
||
<AoETable item_key="crimsonmoonssemblance" data_src="weapon" /> | ||
|
||
## Known issues | ||
|
||
<IssuesTable item_key="crimsonmoonssemblance" data_src="weapon" /> | ||
|
||
## Names | ||
|
||
<NamesList item_key="crimsonmoonssemblance" data_src="weapon" /> | ||
|
||
## Params | ||
|
||
<ParamsTable item_key="crimsonmoonssemblance" data_src="weapon" /> | ||
|
||
## Fields | ||
|
||
<FieldsTable item_key="crimsonmoonssemblance" data_src="weapon" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters