Skip to content

Commit

Permalink
Implement auto AI tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Damnae committed Feb 24, 2024
1 parent 9ba08ba commit 208bd5c
Show file tree
Hide file tree
Showing 27 changed files with 571 additions and 8 deletions.
26 changes: 26 additions & 0 deletions src/gamecore/tasks/ComplexSkillAIAllTargetCombine.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
import AnyTask from '@/gamecore/AnyTask.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
Evaluator:GamecoreTask
ListCombineType:string
}
</script>

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

<span class="flow">Take the <em>{{ node.ListCombineType ?? "Add" }}</em> in all targets</span>
<template #content>
<AnyTask :node="node.Evaluator" />
</template>

</BlockLayout>
</template>

<style scoped>
</style>
27 changes: 27 additions & 0 deletions src/gamecore/tasks/ComplexSkillAIAllTeamMemberCombine.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
import AnyTask from '@/gamecore/AnyTask.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
Evaluator:GamecoreTask
TeamType:string
ListCombineType:string
}
</script>

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

<span class="flow">Take the <em>{{ node.ListCombineType ?? "Add" }}</em> in <em>{{ node.TeamType }}</em></span>
<template #content>
<AnyTask :node="node.Evaluator" />
</template>

</BlockLayout>
</template>

<style scoped>
</style>
21 changes: 21 additions & 0 deletions src/gamecore/tasks/ComplexSkillAIBattleGlobalData.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
DataType:string
}
</script>

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

Global data <em>{{ node.DataType }}</em>

</BlockLayout>
</template>

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

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

{{ node.IsTarget === false ? "Source" : "Target" }} has modifier
<RouterLink :to="createModifierRoute(node.ModifilerName)">
<em>{{ node.ModifilerName }}</em>
</RouterLink>

</BlockLayout>
</template>

<style scoped>
</style>
21 changes: 21 additions & 0 deletions src/gamecore/tasks/ComplexSkillAIGetStrengthLevel.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
IsTarget:boolean
}
</script>

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

{{ node.IsTarget === false ? "Source" : "Target" }}'s strength level

</BlockLayout>
</template>

<style scoped>
</style>
29 changes: 29 additions & 0 deletions src/gamecore/tasks/ComplexSkillAIMapperMultiRange.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
Ranges:
[
{
xmin: { Value: number }
xmax: { Value: number }
ymin: { Value: number }
ymax: { Value: number }
}
]
}
</script>

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

Remap the value

</BlockLayout>
</template>

<style scoped>
</style>
22 changes: 22 additions & 0 deletions src/gamecore/tasks/ComplexSkillAIModifierTypeNumber.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
ModifierType:string
IsTarget:boolean
}
</script>

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

{{ node.IsTarget === false ? "Source" : "Target" }}'s status count of type <em>{{ node.ModifierType }}</em>

</BlockLayout>
</template>

<style scoped>
</style>
27 changes: 27 additions & 0 deletions src/gamecore/tasks/ComplexSkillAIPostProcessBreak.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
CompareType:string
CompareValue:{ Value: number }
IsOverrideFinalScore:boolean
FinalScore:{ Value: number }
}
</script>

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

Break if the value is <em>{{ node.CompareType }}</em> <em>{{ node.CompareValue?.Value }}</em>
<template v-if="node.IsOverrideFinalScore">
and override the final score to <em>{{ node.FinalScore?.Value ?? "0" }}</em>
</template>

</BlockLayout>
</template>

<style scoped>
</style>
22 changes: 22 additions & 0 deletions src/gamecore/tasks/ComplexSkillAIPostProcessClamp.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
minValue:{ Value: number }
maxValue:{ Value: number }
}
</script>

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

Clamp the value between <em>{{ node.minValue?.Value }}</em> and <em>{{ node.maxValue?.Value }}</em>

</BlockLayout>
</template>

<style scoped>
</style>
22 changes: 22 additions & 0 deletions src/gamecore/tasks/ComplexSkillAIPostProcessPreCheckFail.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
CompareType:string
CompareValue:{ Value: number }
}
</script>

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

Fail if the value is not <em>{{ node.CompareType }}</em> <em>{{ node.CompareValue?.Value }}</em>

</BlockLayout>
</template>

<style scoped>
</style>
26 changes: 26 additions & 0 deletions src/gamecore/tasks/ComplexSkillAISourceAITag.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
DynamicValueKey:string
IsTarget:boolean
}
if (node.DynamicValueKey)
useHashStore().register(node.DynamicValueKey, true)
</script>

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

{{ node.IsTarget === false ? "Source" : "Target" }}'s AI tag <em>{{ node.DynamicValueKey }}</em>

</BlockLayout>
</template>

<style scoped>
</style>
22 changes: 22 additions & 0 deletions src/gamecore/tasks/ComplexSkillAISourceContainBehaviorFlag.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
BehaviorFlag:string
FromTarget:boolean
}
</script>

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

{{ node.FromTarget === false ? "Source" : "Target" }} has flag <em>{{ node.BehaviorFlag }}</em>

</BlockLayout>
</template>

<style scoped>
</style>
26 changes: 26 additions & 0 deletions src/gamecore/tasks/ComplexSkillAISourceDynamicValue.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
DynamicValueKey:string
IsTarget:boolean
}
if (node.DynamicValueKey)
useHashStore().register(node.DynamicValueKey, true)
</script>

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

{{ node.IsTarget === false ? "Source" : "Target" }}'s dynamic value <em>{{ node.DynamicValueKey }}</em>

</BlockLayout>
</template>

<style scoped>
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
AITagKey:string
IsTarget:boolean
DefaultAITagValue:
{
Value:number
}
}
if (node.AITagKey)
useHashStore().register(node.AITagKey, true)
</script>

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

{{ node.IsTarget === false ? "Source" : "Target" }}'s combat power
<template v-if="node.AITagKey">
by AI tag <em>{{ node.AITagKey }}</em>
</template>
<template v-if="node.DefaultAITagValue?.Value">
with default <em>{{ node.DefaultAITagValue.Value }}</em>
</template>

</BlockLayout>
</template>

<style scoped>
</style>
Loading

0 comments on commit 208bd5c

Please sign in to comment.