mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-08-30 02:24:42 +08:00
update: dev params
This commit is contained in:
+18
-10
@@ -1,24 +1,32 @@
|
|||||||
import type { Config } from '@remake/hooks'
|
import type { Config } from '@remake/hooks'
|
||||||
|
export const dev = {} as Record<string, any>
|
||||||
|
if (import.meta.env.MODE === 'development') {
|
||||||
|
new URLSearchParams(window.location.search)
|
||||||
|
.entries()
|
||||||
|
.forEach(([key, value]) => {
|
||||||
|
if (key !== 'locked') return (dev[key] = Number(value))
|
||||||
|
dev[key] = value.split(',').map(v => Number(v))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export const isDev = import.meta.env.MODE === 'development'
|
|
||||||
// 自动模式自动点击间隔
|
// 自动模式自动点击间隔
|
||||||
export const AutoInterval = 500
|
export const AutoInterval = dev.interval ?? 500
|
||||||
// 可锁定的天赋数量
|
// 可锁定的天赋数量
|
||||||
export const LockLimit = isDev ? 10 : 1
|
export const LockLimit = dev.lock ?? 1
|
||||||
// 名人模式重开次数限制
|
// 名人模式重开次数限制
|
||||||
export const ModeLimit = 10
|
export const ModeLimit = dev.mode ?? 10
|
||||||
// 天赋选择数量限制
|
// 天赋选择数量限制
|
||||||
export const PickMax = isDev ? 10 : 3
|
export const PickMax = dev.max ?? 3
|
||||||
// 天赋选择最少数量限制
|
// 天赋选择最少数量限制
|
||||||
export const PickMin = 3
|
export const PickMin = dev.min ?? 3
|
||||||
// 基础属性点
|
// 基础属性点
|
||||||
export const BasePoints = 20
|
export const BasePoints = dev.points ?? 20
|
||||||
// 单项属性点最大限制
|
// 单项属性点最大限制
|
||||||
export const AllocLimit = 10
|
export const AllocLimit = dev.allocate ?? 10
|
||||||
// 默认初始快乐
|
// 默认初始快乐
|
||||||
export const DefaultSpirit = 5
|
export const DefaultSpirit = dev.spirit ?? 5
|
||||||
// 天赋抽取个数
|
// 天赋抽取个数
|
||||||
export const PullCount = isDev ? 20 : 10
|
export const PullCount = dev.pull ?? 10
|
||||||
// 天赋抽取基础概率
|
// 天赋抽取基础概率
|
||||||
export const PullRateBase: Config['pull']['rate']['base'] = new Map([
|
export const PullRateBase: Config['pull']['rate']['base'] = new Map([
|
||||||
[0, 889],
|
[0, 889],
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { useEffect, useState, useRef, useMemo } from 'react'
|
import { useEffect, useRef } from 'react'
|
||||||
import { usePicked, useEnd, useProfile } from '@remake/hooks'
|
import { usePicked, useEnd, useProfile } from '@remake/hooks'
|
||||||
import { useEndJudge } from '@/hooks/judge'
|
import { useEndJudge } from '@/hooks/judge'
|
||||||
import { properties, judgeDisplay } from '@/display'
|
import { properties, judgeDisplay } from '@/display'
|
||||||
import { isDev } from '@/config'
|
|
||||||
import TalentComponent from '@/components/Talent'
|
import TalentComponent from '@/components/Talent'
|
||||||
import './Summary.css'
|
import './Summary.css'
|
||||||
|
|
||||||
@@ -27,11 +26,7 @@ interface TalentListProps {
|
|||||||
}
|
}
|
||||||
function TalentList({ picked, picker }: TalentListProps) {
|
function TalentList({ picked, picker }: TalentListProps) {
|
||||||
const [profile] = useProfile()
|
const [profile] = useProfile()
|
||||||
const items = usePicked()
|
const talents = usePicked()
|
||||||
const talents = useMemo(() => {
|
|
||||||
if (!isDev || !profile.locked) return items
|
|
||||||
return new Set([...items, ...profile.locked])
|
|
||||||
}, [])
|
|
||||||
const hasInitialized = useRef(false)
|
const hasInitialized = useRef(false)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!profile.locked) return
|
if (!profile.locked) return
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// import { useEffect } from 'react'
|
// import { useEffect } from 'react'
|
||||||
import { useTalentPuller, useTalentPicker } from '@remake/hooks'
|
import { useTalentPuller, useTalentPicker } from '@remake/hooks'
|
||||||
import { useTalentSubmit, useSubmitIsEnable } from '@remake/hooks'
|
import { useTalentSubmit, useSubmitIsEnable } from '@remake/hooks'
|
||||||
import { PullCount } from '@/config'
|
import { PullCount, dev } from '@/config'
|
||||||
import TalentComponent from '@/components/Talent'
|
import TalentComponent from '@/components/Talent'
|
||||||
import './TalentPick.css'
|
import './TalentPick.css'
|
||||||
|
|
||||||
@@ -19,10 +19,13 @@ export default function TalentPick() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
const ps = dev.locked
|
||||||
|
? Array.from(new Set([...dev.locked, ...pulled]))
|
||||||
|
: pulled
|
||||||
return (
|
return (
|
||||||
<div className="screen talent-pick">
|
<div className="screen talent-pick">
|
||||||
<ul className="talent-list">
|
<ul className="talent-list">
|
||||||
{pulled.map(id => (
|
{ps.map(id => (
|
||||||
<li key={id} onClick={() => picker(id)}>
|
<li key={id} onClick={() => picker(id)}>
|
||||||
<TalentComponent id={id} selected={talents.has(id)} />
|
<TalentComponent id={id} selected={talents.has(id)} />
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user