diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4ccb37d..ef7e425 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,10 +12,10 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 - name: Install dependencies uses: bahmutov/npm-install@v1 diff --git a/src/assets/base.scss b/src/assets/base.scss index 1e04939..38ab595 100644 --- a/src/assets/base.scss +++ b/src/assets/base.scss @@ -80,6 +80,5 @@ *::after { box-sizing: border-box; margin: 0; - position: relative; font-weight: normal; } diff --git a/src/assets/group-qr-wechat.jpg b/src/assets/group-qr-wechat.jpg new file mode 100644 index 0000000..2d14277 Binary files /dev/null and b/src/assets/group-qr-wechat.jpg differ diff --git a/src/components/coc-card/IssueRow.vue b/src/components/coc-card/IssueRow.vue index a0fe3b0..f4ac1f0 100644 --- a/src/components/coc-card/IssueRow.vue +++ b/src/components/coc-card/IssueRow.vue @@ -11,7 +11,7 @@ href="https://github.com/masquevil/trpg-saikou#商业使用" target="_blank" > - 交流 反馈 商业合作:点这里 + 交流 反馈 商业合作:Github diff --git a/src/components/coc-card/QunSection.vue b/src/components/coc-card/QunSection.vue new file mode 100644 index 0000000..30d1b58 --- /dev/null +++ b/src/components/coc-card/QunSection.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/components/coc-card/SkillTable.vue b/src/components/coc-card/SkillTable.vue index 0c13902..7bb49a4 100644 --- a/src/components/coc-card/SkillTable.vue +++ b/src/components/coc-card/SkillTable.vue @@ -98,9 +98,9 @@ function getTableData(data: SkillGroups, suggestion?: Suggestion) { viewData?.showingChildSkills.get(skill.name)?.[childIndex] ?? placeName; const childSkill = skill.group?.skills.find( - ({ name }) => name === childSkillName + ({ name }) => name === childSkillName, ); - const init = childSkill?.init ?? rowData.init; + let init = childSkill?.init ?? rowData.init; const skillKey: COCPCSkill = [ skill.name, childSkillName, @@ -108,6 +108,9 @@ function getTableData(data: SkillGroups, suggestion?: Suggestion) { ]; const skillPoint = findSkillPoints(skillKey); const points = skillPoint?.[1] || {}; + if (pc && !skill.name) { + init = points.b || 0; + } return { ...rowData, // group info @@ -131,7 +134,7 @@ function getTableData(data: SkillGroups, suggestion?: Suggestion) { }, []); return [...result, ...rows]; }, - [] + [], ); return tableData; } @@ -154,7 +157,7 @@ function findSkillPoints(skillInfo: COCPCSkill) { function updateSkillPoint( skillKey: COCPCSkill, pointName: keyof SkillPoint, - value: string | boolean + value: string | boolean, ) { if (!pc) return; let skillPoint = findSkillPoints(skillKey); @@ -419,6 +422,7 @@ function getTotal(points: SkillPoint, init: number) { } .skill-td { + position: relative; text-align: center; line-height: var(--td-line-height); border: none; diff --git a/src/components/coc-card/control-section-parts/dice-maid/DiceMaid.vue b/src/components/coc-card/control-section-parts/dice-maid/DiceMaid.vue new file mode 100644 index 0000000..7019edf --- /dev/null +++ b/src/components/coc-card/control-section-parts/dice-maid/DiceMaid.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/src/constants/coc-card/skill.ts b/src/constants/coc-card/skill.ts index 8ccd8bb..480355a 100644 --- a/src/constants/coc-card/skill.ts +++ b/src/constants/coc-card/skill.ts @@ -622,3 +622,17 @@ export const skills: Skill[] = [ }, }, ]; + +export const skillNameAlias: Record = { + 信用评级: ['信用', '信誉'], + 克苏鲁神话: ['克苏鲁'], + 取悦: ['魅惑'], + 汽车驾驶: ['汽车', '驾驶'], + 图书馆使用: ['图书馆'], + 计算机使用Ω: ['计算机', '电脑'], + '步/霰': ['步枪', '霰弹枪'], + 锁匠: ['开锁', '撬锁'], + 博物学: ['自然学'], + 导航: ['领航'], + 操作重型机械: ['重型机械', '重型操作', '重型'], +}; diff --git a/src/models/coc-card/skill.ts b/src/models/coc-card/skill.ts index a28d144..3ab6577 100644 --- a/src/models/coc-card/skill.ts +++ b/src/models/coc-card/skill.ts @@ -1,9 +1,13 @@ import type { Skill } from '@/types/coc-card/skill'; import type { SkillGroupName } from '@/types/coc-card/skillGroup'; import type { SkillGroups } from '@/types/coc-card/formattedSkill'; -import type { COCPlayerCharacter } from '@/types/coc-card/character'; +import type { + COCPlayerCharacter, + SkillPoint, +} from '@/types/coc-card/character'; +import type { COCCardViewData } from '@/types/coc-card/viewData'; -import { skills } from '@/constants/coc-card/skill'; +import { skills, skillNameAlias } from '@/constants/coc-card/skill'; import { skillGroups as groups, skillGroupOrder, @@ -49,3 +53,120 @@ export const dynamicInitFormulas: Record< 母语: (pc) => pc.attributes.edu || 0, 闪避: (pc) => Math.floor((pc.attributes.dex || 0) / 2), }; + +// 获取 pc 的数据,返回这个结构的字符串 +// 第一部分——属性:力量60str60敏捷60dex60…… +// 第二部分——衍生属性:hp12体力12mp12魔法12san60理智60san值60 +// 第三部分——技能:母语60英语60日语40汽车驾驶25…… +export function getDiceMaidStString( + pc: COCPlayerCharacter, + viewData: COCCardViewData, +) { + const { attributes, deriveAttributes, skillPoints } = pc; + const { + str = 0, + con = 0, + siz = 0, + dex = 0, + app = 0, + int = 0, + pow = 0, + edu = 0, + luc = 0, + } = attributes; + const { + hp = { start: 0 }, + mp = { start: 0 }, + sanity: san = { start: 0 }, + } = deriveAttributes || {}; + + const attributesString = `力量${str}str${str}敏捷${dex}dex${dex}体质${con}con${con}外貌${app}app${app}智力${int}灵感${int}int${int}意志${pow}pow${pow}体型${siz}siz${siz}教育${edu}edu${edu}幸运${luc}运气${luc}luck${luc}`; + const deriveAttributesString = `hp${hp.start}体力${hp.start}mp${mp.start}魔法${mp.start}san${san.start}理智${san.start}理智值${san.start}san值${san.start}`; + let skillString = ''; + + const pcPointsMap: Record = {}; + skillPoints.forEach(([fullName, skillPoint]) => { + let skillName: string; + let childSkillName: string | undefined; + let childSkillPosition: number | undefined; + if (Array.isArray(fullName)) { + [skillName, , childSkillPosition] = fullName; + childSkillName = + viewData.showingChildSkills.get(skillName)![childSkillPosition]; + } else { + skillName = fullName; + } + const mapKey = childSkillName + ? `${skillName}-${childSkillName}` + : skillName; + pcPointsMap[mapKey] = skillPoint; + }); + + skills.forEach((skill) => { + const { name, init, group } = skill; + let realInit = dynamicInitFormulas[name] + ? dynamicInitFormulas[name](pc) + : init; + const displayName = name.includes('Ω') ? name.slice(0, -1) : name; + + if (!group) { + const point = pcPointsMap[name]; + let total = 0; + if (point) { + const { b = name ? realInit : 0, p = 0, i = 0, g = 0 } = point; + total = b + p + i + g; + } else { + total = realInit; + } + skillString += `${displayName}${total}`; + // aliases + const aliases = skillNameAlias[name]; + if (aliases) { + skillString += aliases.map((alias) => `${alias}${total}`).join(''); + } + delete pcPointsMap[name]; + } else { + let total = 0; + // viewData + viewData.showingChildSkills.get(name)!.forEach((childSkillName) => { + if (!childSkillName) return; + const mapKey = `${name}-${childSkillName}`; + const point = pcPointsMap[mapKey]; + if (name) { + realInit = + skill.group?.skills.find((s) => s.name === childSkillName)?.init || + realInit; + } + if (point) { + const { b = name ? realInit : 0, p = 0, i = 0, g = 0 } = point; + total = b + p + i + g; + } else if (group.show.includes(childSkillName)) { + total = realInit; + } + skillString += `${childSkillName}${total}`; + // aliases + const aliases = skillNameAlias[childSkillName]; + if (aliases) { + skillString += aliases.map((alias) => `${alias}${total}`).join(''); + } + delete pcPointsMap[mapKey]; + }); + // special cases + if (name === '母语') { + if (total) { + skillString += `母语${total}`; + } else { + const point = pcPointsMap[name]; + if (point) { + const { b = name ? realInit : 0, p = 0, i = 0, g = 0 } = point; + skillString += `母语${b + p + i + g}`; + } else { + skillString += `母语${realInit}`; + } + } + } + } + }); + + return `${attributesString}${deriveAttributesString}${skillString}`; +} diff --git a/src/types/coc-card/character.ts b/src/types/coc-card/character.ts index 9788b0f..b686d4f 100644 --- a/src/types/coc-card/character.ts +++ b/src/types/coc-card/character.ts @@ -94,9 +94,14 @@ export interface COCBattleAttributes { export type COCPCSkill = string | [string, string, number]; export interface SkillPoint { + // 初始点数 b?: number; + // 职业点数 p?: number; + // 兴趣点数 i?: number; + // 成长点数 g?: number; + // 是否有成长 c?: boolean; } diff --git a/src/views/COCCardSections/ControlSection.vue b/src/views/COCCardSections/ControlSection.vue index a76cdc2..ebf0a42 100644 --- a/src/views/COCCardSections/ControlSection.vue +++ b/src/views/COCCardSections/ControlSection.vue @@ -14,7 +14,7 @@ import { DocumentCopy, KnifeFork, IceCream, - Guide, + // Guide, Brush, Mug, } from '@element-plus/icons-vue'; @@ -24,9 +24,11 @@ import ControlButton from '@/components/coc-card/ControlButton.vue'; import ControlDialog from '@/components/coc-card/ControlDialog.vue'; import DownloaderItem from '@/components/coc-card/DownloaderItem.vue'; import GuidePaneContent from '@/components/coc-card/GuidePaneContent.vue'; -import IssueRow from '@/components/coc-card/IssueRow.vue'; +// import IssueRow from '@/components/coc-card/IssueRow.vue'; +import QunSection from '@/components/coc-card/QunSection.vue'; import JobList from '@/components/coc-card/JobList.vue'; import WeaponList from '@/components/coc-card/WeaponList.vue'; +import DiceMaid from '@/components/coc-card/control-section-parts/dice-maid/DiceMaid.vue'; // models import { @@ -228,6 +230,7 @@ const cleanPreloadFn = watch(morePanelVisible, (visible) => { v-model="morePanelActiveTab" > @@ -252,11 +255,7 @@ const cleanPreloadFn = watch(morePanelVisible, (visible) => { :icon="KnifeFork" @click="$emit('switch-cheating')" /> - + { @click="rewardModalVisible = true" /> - + + @@ -381,6 +381,8 @@ const cleanPreloadFn = watch(morePanelVisible, (visible) => { + + { --el-border-color-light: var(--color-border); } .more-pane { - max-height: 32vh; + max-height: 64vh; overflow: auto; } +.more-pane-less { + max-height: 32vh; +} .more-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); diff --git a/src/views/COCCardView.vue b/src/views/COCCardView.vue index 7660660..8e71846 100644 --- a/src/views/COCCardView.vue +++ b/src/views/COCCardView.vue @@ -74,10 +74,20 @@ function switchCheating() { }" > - +