Skip to content

Commit

Permalink
Add modifier stance preview.
Browse files Browse the repository at this point in the history
  • Loading branch information
Damnae committed Jun 8, 2024
1 parent b8618e2 commit bc3c795
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/sources/ability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ export interface ModifierPreshowConfig
[property:string]: DynamicExpression
}
}
export interface ModifierStanceConfig
{
SkillType: string
Condition: GamecoreTask
MultiplyRatio?:DynamicExpression
StanceBreakAddRatio?:DynamicExpression
AddForceStanceDamageFlag?:boolean
AddWeakness?:string
}

export interface RangeWatcher
{
Expand Down Expand Up @@ -73,6 +82,7 @@ export interface Modifier
PerformTime?:DynamicExpression
DynamicValues?: DynamicValues
ModifierAffectedPreshowConfig?: ModifierPreshowConfig
ModifierStancePreshowConfig?: ModifierStanceConfig
OnAbilityPropertyChange?:PropertyChangeWatcher[]
OnDynamicValueChange?:ValueChangeWatcher[]
TaskListTemplate?:TaskListTemplate[]
Expand Down
53 changes: 51 additions & 2 deletions src/views/abilities/Modifier.vue
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@
</template>
</template>

<template v-if="modifier.ModifierAffectedPreshowConfig">
<template v-if="modifier.ModifierAffectedPreshowConfig || modifier.ModifierStancePreshowConfig">
<h2>Preview</h2>
<BlockLayout :source="modifier.ModifierAffectedPreshowConfig">
<BlockLayout v-if="modifier.ModifierAffectedPreshowConfig" :source="modifier.ModifierAffectedPreshowConfig">
<span class="flow">
<template v-if="modifier.ModifierAffectedPreshowConfig.SkillTypes">
While preparing <em>{{ modifier.ModifierAffectedPreshowConfig.SkillTypes.join(', ') }}</em>,
Expand Down Expand Up @@ -309,6 +309,55 @@
</template>
</template>
</BlockLayout>

<BlockLayout v-if="modifier.ModifierStancePreshowConfig" :source="modifier.ModifierStancePreshowConfig">
<span class="flow">
<template v-if="modifier.ModifierStancePreshowConfig.SkillType">
While preparing <em>{{ modifier.ModifierStancePreshowConfig.SkillType }}</em>
</template>
</span>
<template #content>
<template v-if="modifier.ModifierStancePreshowConfig.Condition">

<div class="subblock">
<span class="flow">If</span>
<AnyTask :node="modifier.ModifierStancePreshowConfig.Condition" />
<span class="flow">Do</span>

<BlockLayout v-if="modifier.ModifierStancePreshowConfig.AddWeakness" :source="modifier.ModifierStancePreshowConfig.AddWeakness">
Preview added weakness to <em>{{ modifier.ModifierStancePreshowConfig.AddWeakness }}</em>
</BlockLayout>
<BlockLayout v-if="modifier.ModifierStancePreshowConfig.AddForceStanceDamageFlag" :source="modifier.ModifierStancePreshowConfig.AddForceStanceDamageFlag">
Preview forced toughness damage
</BlockLayout>
<BlockLayout v-if="modifier.ModifierStancePreshowConfig.MultiplyRatio" :source="modifier.ModifierStancePreshowConfig.MultiplyRatio">
Preview break multiplier with value <em><EvaluateExpression :expression="modifier.ModifierStancePreshowConfig.MultiplyRatio" /></em>
</BlockLayout>
<BlockLayout v-if="modifier.ModifierStancePreshowConfig.StanceBreakAddRatio" :source="modifier.ModifierStancePreshowConfig.StanceBreakAddRatio">
Preview break with value <em><EvaluateExpression :expression="modifier.ModifierStancePreshowConfig.StanceBreakAddRatio" /></em>
</BlockLayout>
</div>

</template>
<template v-else>

<BlockLayout v-if="modifier.ModifierStancePreshowConfig.AddWeakness" :source="modifier.ModifierStancePreshowConfig.AddWeakness">
Preview added weakness to <em>{{ modifier.ModifierStancePreshowConfig.AddWeakness }}</em>
</BlockLayout>
<BlockLayout v-if="modifier.ModifierStancePreshowConfig.AddForceStanceDamageFlag" :source="modifier.ModifierStancePreshowConfig.AddForceStanceDamageFlag">
Preview forced toughness damage
</BlockLayout>
<BlockLayout v-if="modifier.ModifierStancePreshowConfig.MultiplyRatio" :source="modifier.ModifierStancePreshowConfig.MultiplyRatio">
Preview break multiplier with value <em><EvaluateExpression :expression="modifier.ModifierStancePreshowConfig.MultiplyRatio" /></em>
</BlockLayout>
<BlockLayout v-if="modifier.ModifierStancePreshowConfig.StanceBreakAddRatio" :source="modifier.ModifierStancePreshowConfig.StanceBreakAddRatio">
Preview break with value <em><EvaluateExpression :expression="modifier.ModifierStancePreshowConfig.StanceBreakAddRatio" /></em>
</BlockLayout>

</template>

</template>
</BlockLayout>
</template>

<h2>Context</h2>
Expand Down

0 comments on commit bc3c795

Please sign in to comment.