Skip to content

Commit

Permalink
Implement some tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Damnae committed Jan 9, 2024
1 parent ccee621 commit 3cc423a
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 3 deletions.
37 changes: 37 additions & 0 deletions src/gamecore/tasks/AddBehaviorFlagForModifier.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script setup lang="ts">
import { inject } from 'vue';
import { GamecoreTask, GamecoreTargetType, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
TargetType:GamecoreTargetType
CasterFilter?:GamecoreTargetType
ModifierName:string
AddBehaviorFlags:string[]
}
const createModifierRoute = inject<(key:string) => object>('createModifierRoute') as (key:string) => object
</script>

<template>
<BlockLayout :source="node">

Add <em>{{ node.AddBehaviorFlags.join(", ") }}</em> flag to
<RouterLink v-if="node.ModifierName" :to="createModifierRoute(node.ModifierName)">
<em>{{ node.ModifierName }}</em>
</RouterLink>
<template v-if="node.CasterFilter">
applied by <em><EvaluateTargetType :target="node.CasterFilter" /></em>
</template>
<template v-if="node.TargetType">
on <em><EvaluateTargetType :target="node.TargetType" /></em>
</template>

</BlockLayout>
</template>

<style scoped>
</style>
46 changes: 46 additions & 0 deletions src/gamecore/tasks/ByCompareStanceRatio.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<script setup lang="ts">
import { inject, } from 'vue';
import { GamecoreTask, DynamicExpression, GamecoreTargetType, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateExpression from '../EvaluateExpression.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
TargetType:GamecoreTargetType
ModifierName:string
ValueType:string
CompareType?:string
CompareValue?:DynamicExpression
}
const createModifierRoute = inject<(key:string) => object>('createModifierRoute') as (key:string) => object
</script>

<template>
<BlockLayout :source="node">

<template v-if="node.TargetType">
<em><EvaluateTargetType :target="node.TargetType" /></em>'s
</template>
toughness ratio is
<RouterLink v-if="node.ModifierName" :to="createModifierRoute(node.ModifierName)">
<em>{{ node.ModifierName }}</em>'s
</RouterLink>

<template v-if="node.ValueType">
<em>{{ node.ValueType }}</em> is
</template>
<template v-if="node.CompareType">
<em>{{ node.CompareType }}</em> to
</template>
<template v-if="node.CompareValue">
<em><EvaluateExpression :expression="node.CompareValue" /></em>
</template>

</BlockLayout>
</template>

<style scoped>
</style>
7 changes: 4 additions & 3 deletions src/gamecore/tasks/Remodifier.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{
TargetType:GamecoreTargetType
BehaviorFlagFilter?:string[]
StatusTypeMask:string
MaxNumber?:DynamicExpression
TaskList?:GamecoreTask[]
}
Expand All @@ -22,14 +23,14 @@
<span class="flow">
For
<template v-if="node.MaxNumber">
up to <EvaluateExpression :expression="node.MaxNumber" /> modifiers on
up to <em><EvaluateExpression :expression="node.MaxNumber" /></em> <em>{{ node.StatusTypeMask }}</em> modifiers on
</template>
<template v-else>
all modifiers on
all <em>{{ node.StatusTypeMask }}</em> modifiers on
</template>
<EvaluateTargetType :target="node.TargetType" />
<template v-if="node.BehaviorFlagFilter">
with <em>{{ node.BehaviorFlagFilter.join(', ') }}</em>
with flag <em>{{ node.BehaviorFlagFilter.join(', ') }}</em>
</template>
</span>
<template #content>
Expand Down
66 changes: 66 additions & 0 deletions src/gamecore/tasks/SetModifierDynamicValue.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<script setup lang="ts">
import { inject } from 'vue';
import { GamecoreTask, DynamicExpression, GamecoreTargetType, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateExpression from '../EvaluateExpression.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
TargetType:GamecoreTargetType
ModifierName:string
DynamicKey:string
NewValue?:DynamicExpression
ModifyFunction:string
}
if (node.DynamicKey)
useHashStore().register(node.DynamicKey, true)
const createModifierRoute = inject<(key:string) => object>('createModifierRoute') as (key:string) => object
</script>

<template>
<BlockLayout :source="node">
<template v-if="node.ModifyFunction">

{{ node.ModifyFunction }}
<em v-if="node.NewValue">
<EvaluateExpression :expression="node.NewValue" />
</em>
<em v-else>
-1
</em>
to
<RouterLink v-if="node.ModifierName" :to="createModifierRoute(node.ModifierName)">
<em>{{ node.ModifierName }}</em>'s
</RouterLink>
<template v-else>
this modifier's
</template>
<em>{{ node.DynamicKey }}</em>
<template v-if="node.TargetType">
on <em><EvaluateTargetType :target="node.TargetType" /></em>
</template>

</template>
<template v-else>

Set
<template v-if="node.TargetType">
<em><EvaluateTargetType :target="node.TargetType" /></em>'s
</template>
<RouterLink v-if="node.ModifierName" :to="createModifierRoute(node.ModifierName)">
<em>{{ node.ModifierName }}</em>
</RouterLink>'s
<em>{{ node.DynamicKey }}</em>
to <em><EvaluateExpression :expression="node.NewValue" /></em>

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

<style scoped>
</style>
37 changes: 37 additions & 0 deletions src/gamecore/tasks/SetModifierOverrideNameForStatus.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script setup lang="ts">
import { inject } from 'vue';
import { GamecoreTask, GamecoreTargetType, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
TargetType:GamecoreTargetType
ModifierName:string
ModifierNameForStatus:string
}
const createModifierRoute = inject<(key:string) => object>('createModifierRoute') as (key:string) => object
</script>

<template>
<BlockLayout :source="node">

Override
<template v-if="node.TargetType">
<em><EvaluateTargetType :target="node.TargetType" /></em>'s
</template>
<RouterLink v-if="node.ModifierName" :to="createModifierRoute(node.ModifierName)">
<em>{{ node.ModifierName }}</em>
</RouterLink>'s
status name to
<RouterLink v-if="node.ModifierNameForStatus" :to="createModifierRoute(node.ModifierNameForStatus)">
<em>{{ node.ModifierNameForStatus }}</em>
</RouterLink>

</BlockLayout>
</template>

<style scoped>
</style>

0 comments on commit 3cc423a

Please sign in to comment.