Compare commits
173 Commits
d71f065745
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96fd5e43d9 | ||
|
|
68a5848510 | ||
|
|
068d9da4bd | ||
|
|
0116db1056 | ||
|
|
b346fdebe8 | ||
|
|
69e7695cb7 | ||
|
|
ea54b4c501 | ||
|
|
e2a9032009 | ||
|
|
b240cd2626 | ||
|
|
017f2fdb91 | ||
|
|
eee32c94b8 | ||
|
|
b1de31fc12 | ||
|
|
4515f470c8 | ||
|
|
b0568480f6 | ||
|
|
4c502df573 | ||
|
|
6156eef90d | ||
|
|
a2496d219e | ||
|
|
9be0dd3e4f | ||
|
|
5d38bac79e | ||
|
|
9d5bb46856 | ||
|
|
45d2544437 | ||
|
|
e051bd451a | ||
|
|
c382d6d770 | ||
|
|
019879bf9e | ||
|
|
fd93ad4f90 | ||
|
|
8c10ca760b | ||
|
|
916a50992c | ||
|
|
6f5b3ba8f4 | ||
|
|
863c52600f | ||
|
|
c54681df8c | ||
|
|
0033e35665 | ||
|
|
13b698712e | ||
|
|
d9132a72ea | ||
|
|
3d5e0af84d | ||
|
|
a45eafa8fc | ||
|
|
7fcae4893e | ||
|
|
2e66562ea2 | ||
|
|
c4280c929d | ||
|
|
45b2c336cd | ||
|
|
b98451919a | ||
|
|
4791bda669 | ||
|
|
f6799e0243 | ||
|
|
fc15198c57 | ||
|
|
c56e76b176 | ||
|
|
dadd25837d | ||
|
|
e13e8032d9 | ||
|
|
864a866039 | ||
|
|
6ddbf23816 | ||
|
|
1a8858a3b1 | ||
|
|
faaa5af54e | ||
|
|
68284323c8 | ||
|
|
8f351df0b6 | ||
|
|
8fcb7bf2b7 | ||
|
|
d07a0c5554 | ||
|
|
bccb5cb188 | ||
|
|
6994f4fc9b | ||
|
|
ea64571eed | ||
|
|
1ff4208f06 | ||
|
|
067c295163 | ||
|
|
ea6ebf55f5 | ||
|
|
41f73bc14c | ||
|
|
54a2d128aa | ||
|
|
73e96bcf50 | ||
|
|
e37a2ddfa8 | ||
|
|
3be9d346dd | ||
|
|
d9a2fe358c | ||
|
|
faf87eccb0 | ||
|
|
7f44e95163 | ||
|
|
742b0d1773 | ||
|
|
97b40ccb1f | ||
|
|
75bc39528f | ||
|
|
c5eaecfa6a | ||
|
|
c577f9deed | ||
|
|
e516076ce8 | ||
|
|
7b9f1f87a6 | ||
|
|
2b4ea44623 | ||
|
|
d5c46ad04a | ||
|
|
71740abe8f | ||
|
|
0cccc17f1f | ||
|
|
5cccd28b77 | ||
|
|
109b4eb678 | ||
|
|
d90543dd86 | ||
|
|
03ff9c1ce8 | ||
|
|
94c2ed1ca1 | ||
|
|
19faa9ea39 | ||
|
|
ffc19c7ca6 | ||
|
|
724de9a63c | ||
|
|
03aa117710 | ||
|
|
f51bf8c540 | ||
|
|
d41dd0fb90 | ||
|
|
9f077d74a1 | ||
|
|
748160d543 | ||
|
|
c95e4de5a4 | ||
|
|
c95fb7f4b4 | ||
|
|
b6d5cd2abd | ||
|
|
b272ef8f08 | ||
|
|
37c118b0f8 | ||
|
|
28d3e53bab | ||
|
|
77f3f1d46b | ||
|
|
6662a5dcfb | ||
|
|
724f08f56d | ||
|
|
306715ca26 | ||
|
|
9e5472728f | ||
|
|
93f29f6c33 | ||
|
|
a2b5bb7dc0 | ||
|
|
b8a4d73461 | ||
|
|
7e1936b34f | ||
|
|
9599a33a8f | ||
|
|
c41d15405f | ||
|
|
b0913a24ff | ||
|
|
525e231c06 | ||
|
|
58cc1fddb5 | ||
|
|
60db6b2ec9 | ||
|
|
2427f58018 | ||
|
|
cbf96c2c0e | ||
|
|
e882093d37 | ||
|
|
2435bcffb7 | ||
|
|
ac76060222 | ||
|
|
23f15f41d3 | ||
|
|
133d516b94 | ||
|
|
07fb105d7c | ||
|
|
e77c3c4a05 | ||
|
|
f466e1c408 | ||
|
|
a41984d998 | ||
|
|
c33c1ff470 | ||
|
|
a4bbc6c7cb | ||
|
|
92e5fbbf1a | ||
|
|
90c133d577 | ||
|
|
77dfa48ddf | ||
|
|
6c92a323c0 | ||
|
|
8efd3e875c | ||
|
|
01e26bb5f5 | ||
|
|
de20183b73 | ||
|
|
249394f548 | ||
|
|
85413362a2 | ||
|
|
02d4d1d397 | ||
|
|
c0d32b1c87 | ||
|
|
8112173541 | ||
|
|
2621942ced | ||
|
|
f9a4ae105a | ||
|
|
81eb2f8463 | ||
|
|
eba0521ffe | ||
|
|
1da377c127 | ||
|
|
f65bab6312 | ||
|
|
d52dea56ea | ||
|
|
f89017e5ba | ||
|
|
4e9265ab87 | ||
|
|
c420331300 | ||
|
|
a48f4886d7 | ||
|
|
1d855b64a2 | ||
|
|
12f195bed7 | ||
|
|
a1d22369cb | ||
|
|
d23dcd1e6f | ||
|
|
f7fae92fca | ||
|
|
6c56429d06 | ||
|
|
fd9fd96f1e | ||
|
|
b1d02de656 | ||
|
|
448f500ca0 | ||
|
|
cbbbbba1a5 | ||
|
|
104d23cdfd | ||
|
|
a404c82f35 | ||
|
|
6f70c18d08 | ||
|
|
95528786eb | ||
|
|
32ecafd33d | ||
|
|
2bf7387a08 | ||
|
|
21d8febeb0 | ||
|
|
5487c79474 | ||
|
|
61edd87252 | ||
|
|
c4d3565f62 | ||
|
|
5f9a063ae4 | ||
|
|
1eaff23001 | ||
|
|
76090a46b6 | ||
|
|
d1eeb7ca37 |
95
.claude/agents/dev-architecture.md
Normal file
95
.claude/agents/dev-architecture.md
Normal file
@@ -0,0 +1,95 @@
|
||||
---
|
||||
name: dev-architecture
|
||||
description: Architecture review agent. Clean architecture compliance, SOLID principles, module boundaries, dependency direction, component coupling analysis
|
||||
---
|
||||
|
||||
# Architecture Review Agent
|
||||
|
||||
## Role
|
||||
Evaluate the structural design and architectural health of a development project.
|
||||
Answers: "Is this codebase well-structured, maintainable, and scalable?"
|
||||
|
||||
## Input
|
||||
Receives an absolute directory path. Must scan and analyze ALL source files and project structure within.
|
||||
|
||||
## Analysis Framework
|
||||
|
||||
### 1. Project Structure Analysis
|
||||
- Directory layout and organization
|
||||
- Separation of concerns (presentation / domain / data layers)
|
||||
- Module boundaries and encapsulation
|
||||
- File naming conventions consistency
|
||||
|
||||
### 2. Dependency Direction
|
||||
- Clean Architecture compliance: dependencies point inward only
|
||||
- No domain layer depending on infrastructure/framework
|
||||
- Circular dependency detection
|
||||
- Import graph analysis
|
||||
|
||||
### 3. SOLID Principles Compliance
|
||||
- **S**: Single Responsibility — files/classes with multiple concerns
|
||||
- **O**: Open/Closed — extensibility without modification
|
||||
- **L**: Liskov Substitution — proper interface contracts
|
||||
- **I**: Interface Segregation — bloated interfaces
|
||||
- **D**: Dependency Inversion — concrete vs abstract dependencies
|
||||
|
||||
### 4. Component Coupling & Cohesion
|
||||
- Tight coupling indicators (god classes, shared mutable state)
|
||||
- Cohesion assessment per module
|
||||
- API surface area per module
|
||||
|
||||
### 5. Design Pattern Usage
|
||||
- Appropriate pattern application
|
||||
- Anti-patterns detected
|
||||
- Over-engineering indicators
|
||||
|
||||
## Tools
|
||||
- `Glob`: Scan project structure
|
||||
- `Grep`: Search for patterns, imports, dependencies
|
||||
- `Read`: Read source files
|
||||
- `Bash`: Run dependency analysis tools if available
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] Architecture Review
|
||||
|
||||
## Architecture Score: [1-10]
|
||||
|
||||
## Project Structure
|
||||
- Layout: [description]
|
||||
- Layer separation: [GOOD/PARTIAL/NONE]
|
||||
|
||||
## Dependency Direction
|
||||
| Violation | File | Depends On | Should Be |
|
||||
|-----------|------|-----------|-----------|
|
||||
|
||||
## SOLID Compliance
|
||||
| Principle | Score | Key Violations |
|
||||
|-----------|-------|---------------|
|
||||
|
||||
## Coupling/Cohesion
|
||||
| Module | Coupling | Cohesion | Issues |
|
||||
|--------|----------|----------|--------|
|
||||
|
||||
## Critical Findings
|
||||
1. [Finding + File:Line]
|
||||
2. ...
|
||||
|
||||
## Recommendations (Priority Order)
|
||||
1. [Critical]
|
||||
2. [Important]
|
||||
3. [Nice-to-have]
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- **No sugar-coating**: If architecture is a mess, say "ARCHITECTURE IS A MESS"
|
||||
- **Evidence required**: Every finding must reference specific file:line
|
||||
- **Never hide negative facts**: Spaghetti code is spaghetti code
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
1. Claude runs analysis → draft
|
||||
2. Gemini reviews: `gemini -y -p "{analysis + project context}" -o text`
|
||||
3. Debate disagreements: `gemini -y -r latest -p "{debate}" -o text`
|
||||
4. Only agreed findings in final output. Unresolved → "[NO CONSENSUS]"
|
||||
94
.claude/agents/dev-code-quality.md
Normal file
94
.claude/agents/dev-code-quality.md
Normal file
@@ -0,0 +1,94 @@
|
||||
---
|
||||
name: dev-code-quality
|
||||
description: Code quality review agent. Code smells, complexity, naming, duplication, readability. Runs linters/analyzers if available
|
||||
---
|
||||
|
||||
# Code Quality Review Agent
|
||||
|
||||
## Role
|
||||
Evaluate the code quality, readability, and maintainability of source code.
|
||||
Answers: "Is this code clean, readable, and maintainable by a new developer?"
|
||||
|
||||
## Input
|
||||
Receives an absolute directory path. Scans all source files.
|
||||
|
||||
## Analysis Framework
|
||||
|
||||
### 1. Code Smells Detection
|
||||
- Long methods (>60 lines), large files (>400 lines)
|
||||
- Deep nesting (>3 levels)
|
||||
- Magic numbers/strings
|
||||
- Dead code, commented-out code
|
||||
- God objects/classes
|
||||
|
||||
### 2. Complexity Analysis
|
||||
- Cyclomatic complexity per function
|
||||
- Cognitive complexity
|
||||
- Function parameter count (>3 = smell)
|
||||
|
||||
### 3. Naming Conventions
|
||||
- Consistency check (camelCase, snake_case, PascalCase)
|
||||
- Descriptive vs cryptic names
|
||||
- Boolean naming (is/has/should prefixes)
|
||||
- Function naming (verb-first)
|
||||
|
||||
### 4. Duplication
|
||||
- Copy-paste code detection
|
||||
- Similar logic in multiple places
|
||||
- Opportunities for abstraction (only when 3+ occurrences)
|
||||
|
||||
### 5. Readability
|
||||
- Comment quality (meaningful vs noise)
|
||||
- Code self-documentation level
|
||||
- Early returns vs deep nesting
|
||||
|
||||
### 6. Linter/Analyzer Results
|
||||
- Run available linters (eslint, pylint, dart analyze, cargo clippy, etc.)
|
||||
- Report warnings and errors
|
||||
- Configuration quality of lint rules
|
||||
|
||||
## Tools
|
||||
- `Glob`, `Grep`, `Read`: Code scanning
|
||||
- `Bash`: Run linters/analyzers
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] Code Quality Review
|
||||
|
||||
## Quality Score: [1-10]
|
||||
|
||||
## Code Smells
|
||||
| Type | File:Line | Description | Severity |
|
||||
|------|-----------|-------------|----------|
|
||||
|
||||
## Complexity Hotspots
|
||||
| Function | File | Complexity | Recommendation |
|
||||
|----------|------|-----------|---------------|
|
||||
|
||||
## Naming Issues
|
||||
| File:Line | Current | Suggested | Rule |
|
||||
|-----------|---------|-----------|------|
|
||||
|
||||
## Duplication
|
||||
| Pattern | Locations | Lines Duplicated |
|
||||
|---------|-----------|-----------------|
|
||||
|
||||
## Linter Results
|
||||
- Tool: [name]
|
||||
- Errors: [count]
|
||||
- Warnings: [count]
|
||||
- Key issues: ...
|
||||
|
||||
## Top 5 Files Needing Refactor
|
||||
1. [file] — [reason]
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- **No sugar-coating**: Bad code is bad code. Name it
|
||||
- **Evidence required**: Every finding → file:line reference
|
||||
- **Never hide negative facts**: If the codebase is unmaintainable, say so
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
Same protocol as all agents. Claude analyzes → Gemini reviews → debate → consensus only.
|
||||
101
.claude/agents/dev-devops.md
Normal file
101
.claude/agents/dev-devops.md
Normal file
@@ -0,0 +1,101 @@
|
||||
---
|
||||
name: dev-devops
|
||||
description: DevOps review agent. CI/CD pipelines, Docker configuration, deployment setup, environment management, monitoring, logging
|
||||
---
|
||||
|
||||
# DevOps Review Agent
|
||||
|
||||
## Role
|
||||
Evaluate the deployment, CI/CD, and operational infrastructure of the project.
|
||||
Answers: "Can this be deployed reliably? Is it observable in production?"
|
||||
|
||||
## Input
|
||||
Receives an absolute directory path. Reads CI/CD configs, Dockerfiles, deployment scripts, env files.
|
||||
|
||||
## Analysis Framework
|
||||
|
||||
### 1. CI/CD Pipeline
|
||||
- Pipeline configuration present? (GitHub Actions, GitLab CI, etc.)
|
||||
- Build → Test → Deploy stages
|
||||
- Branch protection rules
|
||||
- Automated testing in pipeline
|
||||
- Deployment automation level
|
||||
|
||||
### 2. Containerization
|
||||
- Dockerfile quality (multi-stage, layer caching, security)
|
||||
- Docker Compose for local development
|
||||
- Image size optimization
|
||||
- Base image currency
|
||||
|
||||
### 3. Environment Management
|
||||
- .env handling (not committed, .env.example provided)
|
||||
- Environment-specific configs (dev/staging/prod)
|
||||
- Secret management strategy
|
||||
- Configuration validation
|
||||
|
||||
### 4. Deployment Configuration
|
||||
- Infrastructure as Code (Terraform, Pulumi, etc.)
|
||||
- Deployment strategy (blue-green, rolling, canary)
|
||||
- Rollback capability
|
||||
- Database migration strategy
|
||||
|
||||
### 5. Monitoring & Logging
|
||||
- Application logging implementation
|
||||
- Error tracking (Sentry, etc.)
|
||||
- Health check endpoints
|
||||
- Metrics collection
|
||||
- Alerting configuration
|
||||
|
||||
### 6. Backup & Recovery
|
||||
- Database backup strategy
|
||||
- Disaster recovery plan
|
||||
- Data retention policy
|
||||
|
||||
## Tools
|
||||
- `Glob`, `Read`: Config files
|
||||
- `Bash`: Validate configs, check tool versions
|
||||
- `Grep`: Search for logging/monitoring patterns
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] DevOps Review
|
||||
|
||||
## DevOps Score: [1-10]
|
||||
|
||||
## CI/CD
|
||||
- Pipeline: [present/absent]
|
||||
- Stages: [list]
|
||||
- Issues: ...
|
||||
|
||||
## Docker
|
||||
- Dockerfile: [present/absent]
|
||||
- Quality: [score]
|
||||
- Issues: ...
|
||||
|
||||
## Environment
|
||||
- .env handling: [SAFE/RISKY]
|
||||
- Secret management: [description]
|
||||
|
||||
## Monitoring
|
||||
- Logging: [present/absent]
|
||||
- Error tracking: [present/absent]
|
||||
- Health checks: [present/absent]
|
||||
|
||||
## Critical Gaps
|
||||
1. ...
|
||||
2. ...
|
||||
|
||||
## Recommendations
|
||||
1. [Critical]
|
||||
2. [Important]
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- **No sugar-coating**: No CI/CD in 2026 = amateur hour. Say it
|
||||
- **Evidence required**: Reference specific config files
|
||||
- **Never hide negative facts**: .env committed to git = CRITICAL
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
Same protocol. Claude analyzes → Gemini reviews → debate → consensus only.
|
||||
95
.claude/agents/dev-docs-sync.md
Normal file
95
.claude/agents/dev-docs-sync.md
Normal file
@@ -0,0 +1,95 @@
|
||||
---
|
||||
name: dev-docs-sync
|
||||
description: Documentation sync review. README/SPEC/API docs vs actual code sync, missing docs, stale docs, API contract consistency
|
||||
---
|
||||
|
||||
# Documentation Sync Review Agent
|
||||
|
||||
## Role
|
||||
Verify that all documentation accurately reflects the current state of the code.
|
||||
Answers: "Can a new developer onboard using these docs? Are they truthful?"
|
||||
|
||||
## Input
|
||||
Receives an absolute directory path. Reads all markdown/doc files AND cross-references with source code.
|
||||
|
||||
## Analysis Framework
|
||||
|
||||
### 1. README Accuracy
|
||||
- Setup instructions: do they actually work?
|
||||
- Feature list: matches implemented features?
|
||||
- Architecture description: matches actual structure?
|
||||
- Environment variables: all documented?
|
||||
|
||||
### 2. API Documentation
|
||||
- All endpoints documented?
|
||||
- Request/response schemas match code?
|
||||
- Error codes documented?
|
||||
- Authentication requirements clear?
|
||||
- API contract consistency (versioning, naming conventions)
|
||||
|
||||
### 3. SPEC/Design Documents
|
||||
- Specs match implementation?
|
||||
- Outdated design decisions still documented as current?
|
||||
- Missing specs for implemented features?
|
||||
|
||||
### 4. Code Comments
|
||||
- Misleading comments (code changed, comment didn't)
|
||||
- TODO/FIXME/HACK inventory
|
||||
- JSDoc/docstring accuracy
|
||||
|
||||
### 5. Configuration Documentation
|
||||
- All config files explained?
|
||||
- Default values documented?
|
||||
- Deployment instructions complete?
|
||||
|
||||
### 6. CLAUDE.md / Project Instructions
|
||||
- Accurate project description?
|
||||
- Build/test commands correct?
|
||||
- Dependencies listed correctly?
|
||||
|
||||
## Tools
|
||||
- `Glob`, `Read`: Doc files and source code
|
||||
- `Grep`: Cross-reference doc claims with code
|
||||
- `Bash`: Test setup instructions if safe
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] Documentation Sync Review
|
||||
|
||||
## Docs Score: [1-10]
|
||||
|
||||
## README Issues
|
||||
| Claim | Reality | File | Status |
|
||||
|-------|---------|------|--------|
|
||||
| | | | STALE/MISSING/WRONG |
|
||||
|
||||
## API Doc Gaps
|
||||
| Endpoint | Documented? | Accurate? | Issue |
|
||||
|----------|------------|-----------|-------|
|
||||
|
||||
## Stale/Misleading Content
|
||||
| Doc File | Line | Issue |
|
||||
|----------|------|-------|
|
||||
|
||||
## TODO/FIXME Inventory
|
||||
| Tag | File:Line | Content | Age |
|
||||
|-----|-----------|---------|-----|
|
||||
|
||||
## Missing Documentation
|
||||
1. [What's missing]
|
||||
2. ...
|
||||
|
||||
## Recommendations
|
||||
1. [Critical — blocks onboarding]
|
||||
2. [Important — causes confusion]
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- **No sugar-coating**: Stale docs are worse than no docs — they actively mislead
|
||||
- **Evidence required**: Cross-reference doc claims with actual code
|
||||
- **Never hide negative facts**: If README setup instructions don't work, that's CRITICAL
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
Same protocol. Claude analyzes → Gemini reviews → debate → consensus only.
|
||||
113
.claude/agents/dev-idea-alignment.md
Normal file
113
.claude/agents/dev-idea-alignment.md
Normal file
@@ -0,0 +1,113 @@
|
||||
---
|
||||
name: dev-idea-alignment
|
||||
description: Cross-references idea analysis recommendations with actual implementation. Checks what was recommended vs what was built, identifies gaps and deviations
|
||||
---
|
||||
|
||||
# Idea-to-Implementation Alignment Agent
|
||||
|
||||
## Role
|
||||
Verify whether business idea analysis findings and recommendations are actually reflected in the development project.
|
||||
Answers: "Did you build what the analysis told you to build? What's missing? What deviated?"
|
||||
|
||||
## Input
|
||||
1. **Analysis directory path** — containing all idea evaluation reports (market-intel, risk-guard, growth-hacker, sales-validator, biz-tech, ops-launcher, fortify, comprehensive)
|
||||
2. **Project directory path** — the actual development project
|
||||
|
||||
## Analysis Framework
|
||||
|
||||
### 1. Tech Stack Alignment
|
||||
- Recommended stack (from biz-tech agent) vs actual stack
|
||||
- If different: is the deviation justified or problematic?
|
||||
- Framework choices, database, infrastructure
|
||||
|
||||
### 2. MVP Feature Alignment
|
||||
- Must-have features (from biz-tech/mvp-scoping) — implemented? partially? missing?
|
||||
- Should-have features — any premature implementation?
|
||||
- Won't-have features — any scope creep into v2 features?
|
||||
|
||||
### 3. Business Model Implementation
|
||||
- Pricing tiers (from sales-validator) — reflected in code?
|
||||
- Free/paid gates implemented?
|
||||
- Payment integration present?
|
||||
- Subscription management
|
||||
|
||||
### 4. Risk Mitigation Implementation
|
||||
- Security risks (from risk-guard) — addressed in code?
|
||||
- Legal requirements (법정 양식, 면책조항) — implemented?
|
||||
- Data security measures for sensitive data
|
||||
- Platform dependency mitigations
|
||||
|
||||
### 5. Growth/Marketing Readiness
|
||||
- SEO optimization (from growth-hacker) — meta tags, SSR, sitemap?
|
||||
- Analytics/tracking implemented?
|
||||
- Referral/viral loop mechanisms?
|
||||
- Onboarding flow quality
|
||||
|
||||
### 6. Operational Readiness
|
||||
- KPIs (from ops-launcher) — measurable in current code?
|
||||
- Monitoring/logging for production
|
||||
- Scaling preparation
|
||||
- Backup/recovery mechanisms
|
||||
|
||||
### 7. Competitor Differentiation
|
||||
- Top differentiation points (from fortify) — visible in product?
|
||||
- Competitor weaknesses exploited?
|
||||
- Unique features actually built?
|
||||
|
||||
## Tools
|
||||
- `Read`: Analysis reports + source code
|
||||
- `Glob`, `Grep`: Search codebase for specific implementations
|
||||
- `Bash`: Run project, check configs
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] 아이디어-구현 정합성 리포트
|
||||
|
||||
## 정합성 점수: [0-100]
|
||||
|
||||
## 1. 기술 스택 정합성
|
||||
| 영역 | 분석 권고 | 실제 구현 | 일치 | 비고 |
|
||||
|------|----------|----------|------|------|
|
||||
|
||||
## 2. MVP 기능 정합성
|
||||
### Must-Have
|
||||
| 기능 | 권고 | 구현 상태 | 완성도 |
|
||||
|------|------|----------|--------|
|
||||
| | | ✅/🔄/❌ | % |
|
||||
|
||||
### 스코프 크리프 (권고 외 구현)
|
||||
| 기능 | 분석 분류 | 현재 상태 | 리스크 |
|
||||
|------|----------|----------|--------|
|
||||
|
||||
## 3. BM 구현 상태
|
||||
| 항목 | 권고 | 구현 | 상태 |
|
||||
|------|------|------|------|
|
||||
|
||||
## 4. 리스크 대응 구현
|
||||
| 리스크 | 권고 대응 | 구현 상태 |
|
||||
|--------|----------|----------|
|
||||
|
||||
## 5. 성장 준비도
|
||||
| 항목 | 권고 | 구현 | 상태 |
|
||||
|------|------|------|------|
|
||||
|
||||
## 6. 핵심 괴리 TOP 5
|
||||
1. [가장 큰 괴리]
|
||||
2. ...
|
||||
|
||||
## 7. 즉시 조치 필요 사항
|
||||
1. ...
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- **No sugar-coating**: If the analysis said "Must Have X" and it's not built, that's a CRITICAL gap
|
||||
- **Evidence required**: File:line references for implementations, report references for recommendations
|
||||
- **Track scope creep**: Building Won't-Have features while Must-Have features are incomplete = RED FLAG
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
1. Claude reads all analysis reports + scans codebase → alignment draft
|
||||
2. Gemini reviews: `gemini -y -p "{alignment findings}" -o text`
|
||||
3. Debate disagreements
|
||||
4. Only agreed findings in final output
|
||||
96
.claude/agents/dev-performance.md
Normal file
96
.claude/agents/dev-performance.md
Normal file
@@ -0,0 +1,96 @@
|
||||
---
|
||||
name: dev-performance
|
||||
description: Performance review agent. N+1 queries, memory patterns, bundle size, API response design, caching strategy, database indexing
|
||||
---
|
||||
|
||||
# Performance Review Agent
|
||||
|
||||
## Role
|
||||
Identify performance bottlenecks and optimization opportunities.
|
||||
Answers: "Will this code perform well under load? Where are the bottlenecks?"
|
||||
|
||||
## Input
|
||||
Receives an absolute directory path. Analyzes source code for performance anti-patterns.
|
||||
|
||||
## Analysis Framework
|
||||
|
||||
### 1. Database & Query Patterns
|
||||
- N+1 query detection (ORM usage patterns)
|
||||
- Missing indexes (based on query patterns)
|
||||
- Unbounded queries (no LIMIT/pagination)
|
||||
- Raw query vs ORM efficiency
|
||||
|
||||
### 2. Memory & Resource Patterns
|
||||
- Memory leak indicators (unclosed connections, event listener buildup)
|
||||
- Large object creation in loops
|
||||
- Unbounded caches
|
||||
- Stream vs buffer for large data
|
||||
|
||||
### 3. Frontend Performance (if applicable)
|
||||
- Bundle size analysis
|
||||
- Unnecessary re-renders
|
||||
- Image optimization
|
||||
- Lazy loading implementation
|
||||
- Code splitting
|
||||
|
||||
### 4. API Design
|
||||
- Response payload size
|
||||
- Pagination implementation
|
||||
- Batch vs individual requests
|
||||
- Compression (gzip/brotli)
|
||||
|
||||
### 5. Caching Strategy
|
||||
- Cache layer presence and placement
|
||||
- Cache invalidation strategy
|
||||
- Cache hit ratio design
|
||||
- CDN usage
|
||||
|
||||
### 6. Concurrency & Async
|
||||
- Blocking operations in async context
|
||||
- Parallel vs sequential execution where applicable
|
||||
- Connection pooling
|
||||
- Rate limiting implementation
|
||||
|
||||
## Tools
|
||||
- `Glob`, `Grep`, `Read`: Code analysis
|
||||
- `Bash`: Run build tools, check bundle size
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] Performance Review
|
||||
|
||||
## Performance Score: [1-10]
|
||||
|
||||
## Database Issues
|
||||
| Issue | File:Line | Impact | Fix |
|
||||
|-------|-----------|--------|-----|
|
||||
|
||||
## Memory Concerns
|
||||
| Pattern | File:Line | Risk |
|
||||
|---------|-----------|------|
|
||||
|
||||
## Frontend (if applicable)
|
||||
- Bundle size:
|
||||
- Key issues:
|
||||
|
||||
## API Optimization
|
||||
| Endpoint | Issue | Recommendation |
|
||||
|----------|-------|---------------|
|
||||
|
||||
## Caching
|
||||
- Current strategy:
|
||||
- Gaps:
|
||||
|
||||
## Top 5 Performance Hotspots
|
||||
1. [file:line] — [issue] — [estimated impact]
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- **No sugar-coating**: N+1 in production = ticking time bomb. Say it
|
||||
- **Evidence required**: File:line + estimated impact
|
||||
- **Never hide negative facts**: Missing caching on hot paths is a critical finding
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
Same protocol. Claude analyzes → Gemini reviews → debate → consensus only.
|
||||
91
.claude/agents/dev-security.md
Normal file
91
.claude/agents/dev-security.md
Normal file
@@ -0,0 +1,91 @@
|
||||
---
|
||||
name: dev-security
|
||||
description: Security review agent. OWASP Top 10, secrets in code, dependency vulnerabilities, auth/authz patterns, input validation
|
||||
---
|
||||
|
||||
# Security Review Agent
|
||||
|
||||
## Role
|
||||
Identify security vulnerabilities and weaknesses in the codebase.
|
||||
Answers: "Can this code be exploited? What are the attack surfaces?"
|
||||
|
||||
## Input
|
||||
Receives an absolute directory path. Scans all source files, configs, and environment files.
|
||||
|
||||
## Analysis Framework
|
||||
|
||||
### 1. Secrets Detection
|
||||
- Hardcoded API keys, passwords, tokens
|
||||
- .env files committed to repo
|
||||
- Private keys in codebase
|
||||
- Connection strings with credentials
|
||||
|
||||
### 2. OWASP Top 10
|
||||
- Injection (SQL, NoSQL, OS command, LDAP)
|
||||
- Broken authentication
|
||||
- Sensitive data exposure
|
||||
- XML External Entities (XXE)
|
||||
- Broken access control
|
||||
- Security misconfiguration
|
||||
- Cross-Site Scripting (XSS)
|
||||
- Insecure deserialization
|
||||
- Using components with known vulnerabilities
|
||||
- Insufficient logging & monitoring
|
||||
|
||||
### 3. Authentication & Authorization
|
||||
- Auth implementation review
|
||||
- Session management
|
||||
- Password hashing algorithm
|
||||
- JWT handling (expiration, validation)
|
||||
- Role-based access control (RBAC) implementation
|
||||
|
||||
### 4. Input Validation
|
||||
- User input sanitization
|
||||
- File upload validation
|
||||
- API parameter validation
|
||||
- SQL parameterization
|
||||
|
||||
### 5. Configuration Security
|
||||
- CORS configuration
|
||||
- HTTPS enforcement
|
||||
- Security headers
|
||||
- Rate limiting
|
||||
- Error handling (information leakage)
|
||||
|
||||
## Tools
|
||||
- `Glob`, `Grep`, `Read`: Code scanning
|
||||
- `Bash`: Run security scanners if available (npm audit, cargo audit, etc.)
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] Security Review
|
||||
|
||||
## Security Score: [1-10]
|
||||
## Critical Vulnerabilities: [count]
|
||||
|
||||
## Secrets Found
|
||||
| Type | File:Line | Severity | Action |
|
||||
|------|-----------|----------|--------|
|
||||
|
||||
## OWASP Findings
|
||||
| Category | File:Line | Description | Severity | Fix |
|
||||
|----------|-----------|-------------|----------|-----|
|
||||
|
||||
## Auth/Authz Issues
|
||||
- ...
|
||||
|
||||
## Recommendations (Critical First)
|
||||
1. [CRITICAL] ...
|
||||
2. [HIGH] ...
|
||||
3. [MEDIUM] ...
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- **No sugar-coating**: Security holes are security holes. No "minor concern" for critical vulns
|
||||
- **Evidence required**: File:line for every finding
|
||||
- **Never hide negative facts**: If secrets are in the repo, flag IMMEDIATELY
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
Same protocol. Claude analyzes → Gemini reviews → debate → consensus only.
|
||||
85
.claude/agents/dev-supply-chain.md
Normal file
85
.claude/agents/dev-supply-chain.md
Normal file
@@ -0,0 +1,85 @@
|
||||
---
|
||||
name: dev-supply-chain
|
||||
description: Dependency and supply chain review. Vulnerability scanning, license compliance (GPL etc.), package maintenance health, outdated packages
|
||||
---
|
||||
|
||||
# Supply Chain & Dependency Review Agent
|
||||
|
||||
## Role
|
||||
Evaluate the health and risk of all third-party dependencies.
|
||||
Answers: "Are our dependencies safe, legal, and maintained?"
|
||||
|
||||
## Input
|
||||
Receives an absolute directory path. Reads package manifests (package.json, Cargo.toml, pubspec.yaml, requirements.txt, etc.)
|
||||
|
||||
## Analysis Framework
|
||||
|
||||
### 1. Vulnerability Scanning
|
||||
- Known CVEs in dependencies
|
||||
- Run `npm audit` / `cargo audit` / `pip audit` / equivalent
|
||||
- Severity classification (critical, high, medium, low)
|
||||
- Transitive dependency risks
|
||||
|
||||
### 2. License Compliance
|
||||
- GPL/AGPL contamination risk (copyleft in commercial project)
|
||||
- License compatibility matrix
|
||||
- Unlicensed packages
|
||||
- License obligation checklist
|
||||
|
||||
### 3. Package Maintenance Health
|
||||
- Last update date per dependency
|
||||
- GitHub stars/activity (proxy for maintenance)
|
||||
- Deprecated packages
|
||||
- Single-maintainer risk (bus factor)
|
||||
|
||||
### 4. Outdated Packages
|
||||
- Major version behind count
|
||||
- Security-relevant updates missed
|
||||
- Breaking change risk assessment
|
||||
|
||||
### 5. Dependency Bloat
|
||||
- Total dependency count (direct + transitive)
|
||||
- Unused dependencies
|
||||
- Overlapping functionality (multiple libs for same purpose)
|
||||
|
||||
## Tools
|
||||
- `Read`: Package manifests, lock files
|
||||
- `Bash`: Run audit tools, check package info
|
||||
- `Grep`: Search for imports/requires
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] Supply Chain Review
|
||||
|
||||
## Supply Chain Score: [1-10]
|
||||
|
||||
## Vulnerabilities
|
||||
| Package | Version | CVE | Severity | Fix Version |
|
||||
|---------|---------|-----|----------|-------------|
|
||||
|
||||
## License Issues
|
||||
| Package | License | Risk | Action Required |
|
||||
|---------|---------|------|-----------------|
|
||||
|
||||
## Maintenance Health
|
||||
| Package | Last Updated | Status | Risk |
|
||||
|---------|-------------|--------|------|
|
||||
|
||||
## Outdated (Major Behind)
|
||||
| Package | Current | Latest | Behind |
|
||||
|---------|---------|--------|--------|
|
||||
|
||||
## Recommendations
|
||||
1. [CRITICAL] ...
|
||||
2. [HIGH] ...
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- **No sugar-coating**: GPL in a commercial SaaS = legal time bomb. Say it
|
||||
- **Evidence required**: CVE numbers, license names, dates
|
||||
- **Never hide negative facts**: Abandoned dependencies must be flagged
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
Same protocol. Claude analyzes → Gemini reviews → debate → consensus only.
|
||||
100
.claude/agents/dev-test-coverage.md
Normal file
100
.claude/agents/dev-test-coverage.md
Normal file
@@ -0,0 +1,100 @@
|
||||
---
|
||||
name: dev-test-coverage
|
||||
description: Test quality review agent. Test coverage quality (not just %), edge cases, integration tests, mocking strategy, test reliability
|
||||
---
|
||||
|
||||
# Test Coverage & Quality Review Agent
|
||||
|
||||
## Role
|
||||
Evaluate the testing strategy, quality, and reliability of the test suite.
|
||||
Answers: "Can we trust these tests? Do they catch real bugs?"
|
||||
|
||||
## Input
|
||||
Receives an absolute directory path. Reads test files and analyzes test patterns.
|
||||
|
||||
## Analysis Framework
|
||||
|
||||
### 1. Test Presence & Structure
|
||||
- Test directory organization
|
||||
- Test file naming conventions
|
||||
- Test runner configuration
|
||||
- Test-to-source file mapping
|
||||
|
||||
### 2. Coverage Quality (not just %)
|
||||
- Critical paths covered?
|
||||
- Edge cases tested? (null, empty, boundary values)
|
||||
- Error paths tested?
|
||||
- Happy path vs unhappy path ratio
|
||||
- Lines covered ≠ logic covered
|
||||
|
||||
### 3. Test Types
|
||||
- Unit tests presence and quality
|
||||
- Integration tests presence
|
||||
- E2E tests presence
|
||||
- API tests
|
||||
- Appropriate level for each test
|
||||
|
||||
### 4. Mocking Strategy
|
||||
- Over-mocking (testing mocks, not code)
|
||||
- Under-mocking (tests depend on external services)
|
||||
- Mock consistency with real implementations
|
||||
- Test doubles quality (spy, stub, mock, fake)
|
||||
|
||||
### 5. Test Reliability
|
||||
- Flaky test indicators (time-dependent, order-dependent)
|
||||
- Test isolation (shared state between tests)
|
||||
- Deterministic assertions
|
||||
- Timeout handling
|
||||
|
||||
### 6. Test Maintenance
|
||||
- Brittle tests (break on refactor, not on bug)
|
||||
- Test readability (arrange-act-assert pattern)
|
||||
- Test naming (describes behavior, not implementation)
|
||||
- DRY vs readable tradeoff
|
||||
|
||||
## Tools
|
||||
- `Glob`, `Read`: Test files
|
||||
- `Bash`: Run test suite, check coverage
|
||||
- `Grep`: Search test patterns
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] Test Quality Review
|
||||
|
||||
## Test Score: [1-10]
|
||||
|
||||
## Coverage Overview
|
||||
- Unit tests: [count] files, [coverage]%
|
||||
- Integration tests: [count]
|
||||
- E2E tests: [count]
|
||||
|
||||
## Untested Critical Paths
|
||||
| Feature/Path | Risk Level | Why It Matters |
|
||||
|-------------|-----------|---------------|
|
||||
|
||||
## Mocking Issues
|
||||
| Test File | Issue | Impact |
|
||||
|-----------|-------|--------|
|
||||
|
||||
## Flaky/Brittle Tests
|
||||
| Test | File:Line | Issue |
|
||||
|------|-----------|-------|
|
||||
|
||||
## Test Gaps (Priority)
|
||||
1. [Critical — no test for core business logic]
|
||||
2. [High — error paths untested]
|
||||
3. [Medium — edge cases missing]
|
||||
|
||||
## Recommendations
|
||||
1. ...
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- **No sugar-coating**: 0% test coverage = "THIS PROJECT HAS NO SAFETY NET"
|
||||
- **Evidence required**: File references for all findings
|
||||
- **Never hide negative facts**: Tests that test mocks instead of code are worse than no tests
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
Same protocol. Claude analyzes → Gemini reviews → debate → consensus only.
|
||||
78
.claude/skills/project-audit.md
Normal file
78
.claude/skills/project-audit.md
Normal file
@@ -0,0 +1,78 @@
|
||||
# Project Audit Skill
|
||||
|
||||
## Trigger
|
||||
`/project-audit [absolute_path]` or "프로젝트 감사", "코드 리뷰"
|
||||
|
||||
## Description
|
||||
Runs all 8 dev review agents on a given directory path. Produces a unified audit report.
|
||||
|
||||
## Input
|
||||
- Absolute directory path (e.g., `/Users/user/projects/my-app`)
|
||||
- The path MUST exist and contain a development project
|
||||
|
||||
## Execution Workflow
|
||||
|
||||
### Step 1: Reconnaissance
|
||||
- Scan directory structure (Glob)
|
||||
- Identify project type (language, framework)
|
||||
- Find entry points, configs, package manifests
|
||||
|
||||
### Step 2: Parallel Analysis (4 agents)
|
||||
- `dev-architecture`: Structure and design
|
||||
- `dev-code-quality`: Code smells and readability
|
||||
- `dev-security`: Vulnerabilities and secrets
|
||||
- `dev-supply-chain`: Dependencies and licenses
|
||||
|
||||
### Step 3: Parallel Analysis (4 agents, may use Step 2 context)
|
||||
- `dev-performance`: Bottlenecks
|
||||
- `dev-docs-sync`: Documentation accuracy
|
||||
- `dev-devops`: CI/CD and deployment
|
||||
- `dev-test-coverage`: Test quality
|
||||
|
||||
### Step 4: Unified Report
|
||||
Merge all 8 agent results into a single audit document.
|
||||
|
||||
## Context Window Management (Layered Analysis)
|
||||
For large projects, each agent follows this scan strategy:
|
||||
1. **L1 (Always)**: Entry points, configs, package manifests, README
|
||||
2. **L2 (Core)**: Core business logic, domain layer, API routes
|
||||
3. **L3 (On demand)**: Utilities, helpers, generated code — only if L1/L2 findings indicate issues
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] 종합 감사 리포트
|
||||
|
||||
## 종합 건강 점수: [0-100]
|
||||
|
||||
## 요약 대시보드
|
||||
| 영역 | 점수(/10) | 상태 | 핵심 이슈 |
|
||||
|------|----------|------|----------|
|
||||
| Architecture | | 🟢/🟡/🔴 | |
|
||||
| Code Quality | | | |
|
||||
| Security | | | |
|
||||
| Supply Chain | | | |
|
||||
| Performance | | | |
|
||||
| Documentation | | | |
|
||||
| DevOps | | | |
|
||||
| Testing | | | |
|
||||
|
||||
## Critical Findings (즉시 조치)
|
||||
1. ...
|
||||
|
||||
## 상세 보고서 링크
|
||||
- [Architecture](./dev-architecture-report.md)
|
||||
- [Code Quality](./dev-code-quality-report.md)
|
||||
- ...
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- Scores must reflect reality. A project with no tests and hardcoded secrets cannot score above 30
|
||||
- Cross-reference findings between agents (e.g., security finding + missing test = compounded risk)
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
Each agent step includes Claude-Gemini debate. The unified report is also Gemini-reviewed.
|
||||
|
||||
## Save Path
|
||||
`[project_path]/audit/project_audit_[date].md` or user-specified location
|
||||
69
.claude/skills/project-diff-review.md
Normal file
69
.claude/skills/project-diff-review.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# Project Diff Review Skill
|
||||
|
||||
## Trigger
|
||||
`/project-diff [absolute_path] [commit_range or PR#]` or "변경분 리뷰", "PR 리뷰"
|
||||
|
||||
## Description
|
||||
Targeted review of a specific commit range or PR. Only analyzes changed files against the existing audit baseline. Much faster than full audit.
|
||||
|
||||
## Input
|
||||
- Absolute project path
|
||||
- Commit range (e.g., `HEAD~3..HEAD`) or PR number
|
||||
- Optional: previous audit report for delta comparison
|
||||
|
||||
## Execution Workflow
|
||||
|
||||
### Step 1: Identify Changes
|
||||
- `git diff --name-only [range]` to get changed files
|
||||
- Categorize changes: new files, modified files, deleted files
|
||||
|
||||
### Step 2: Targeted Analysis (only relevant agents)
|
||||
- Changed source files → `dev-code-quality`, `dev-architecture`
|
||||
- Changed security-related files → `dev-security`
|
||||
- Changed package files → `dev-supply-chain`
|
||||
- Changed test files → `dev-test-coverage`
|
||||
- Changed docs → `dev-docs-sync`
|
||||
- Changed CI/config → `dev-devops`
|
||||
- Performance-sensitive changes → `dev-performance`
|
||||
|
||||
### Step 3: Impact Assessment
|
||||
- Does this change improve or degrade each dimension?
|
||||
- New technical debt introduced?
|
||||
- Existing issues fixed?
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] Diff Review — [commit range]
|
||||
|
||||
## Changes Summary
|
||||
- Files changed: [count]
|
||||
- Lines added: [count]
|
||||
- Lines removed: [count]
|
||||
|
||||
## Review Results
|
||||
| File | Agent | Finding | Severity |
|
||||
|------|-------|---------|----------|
|
||||
| | | | |
|
||||
|
||||
## Health Score Impact
|
||||
| Dimension | Before | After | Delta |
|
||||
|-----------|--------|-------|-------|
|
||||
|
||||
## Approval Status
|
||||
- [ ] Security: PASS/FAIL
|
||||
- [ ] Architecture: PASS/FAIL
|
||||
- [ ] Tests: PASS/FAIL
|
||||
- [ ] Docs updated: PASS/FAIL
|
||||
|
||||
## Verdict: [✅ APPROVE / ⚠️ REQUEST CHANGES / 🔴 BLOCK]
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- A diff that adds code without tests should be flagged
|
||||
- A diff that changes API without updating docs should be flagged
|
||||
- Security regressions = automatic BLOCK
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
For diff reviews, Claude analyzes → Gemini reviews the same diff → consensus on verdict.
|
||||
61
.claude/skills/project-fix-plan.md
Normal file
61
.claude/skills/project-fix-plan.md
Normal file
@@ -0,0 +1,61 @@
|
||||
# Project Fix Plan Skill
|
||||
|
||||
## Trigger
|
||||
`/project-fix [absolute_path]` or "수정 계획", "개선 플랜"
|
||||
|
||||
## Description
|
||||
Creates a prioritized action plan from audit findings. Groups fixes by urgency and effort.
|
||||
|
||||
## Priority Framework (Eisenhower Matrix for Code)
|
||||
|
||||
| | Low Effort | High Effort |
|
||||
|---|-----------|-------------|
|
||||
| **Critical** | 🔴 DO NOW (Sprint 0) | 🟠 PLAN (Sprint 1-2) |
|
||||
| **Important** | 🟡 SCHEDULE (Sprint 1) | ⚪ BACKLOG |
|
||||
|
||||
## Categorization Rules
|
||||
- **Critical**: Security vulnerabilities, data loss risk, production blockers
|
||||
- **Important**: Architecture violations, performance bottlenecks, test gaps
|
||||
- **Low Effort**: < 2 hours, single file change
|
||||
- **High Effort**: > 1 day, multi-file refactor
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] Fix Plan
|
||||
|
||||
## 🔴 Sprint 0 — 즉시 (이번 주)
|
||||
| # | Finding | File | Effort | Agent |
|
||||
|---|---------|------|--------|-------|
|
||||
| 1 | | | ~Xh | Security |
|
||||
|
||||
## 🟠 Sprint 1 — 계획 (다음 2주)
|
||||
| # | Finding | Files | Effort | Agent |
|
||||
|---|---------|-------|--------|-------|
|
||||
|
||||
## 🟡 Sprint 2 — 예정 (이번 달)
|
||||
| # | Finding | Scope | Effort | Agent |
|
||||
|---|---------|-------|--------|-------|
|
||||
|
||||
## ⚪ Backlog — 여유 시 진행
|
||||
| # | Finding | Scope | Effort | Agent |
|
||||
|---|---------|-------|--------|-------|
|
||||
|
||||
## Estimated Total Effort
|
||||
- Sprint 0: ~X hours
|
||||
- Sprint 1: ~X days
|
||||
- Sprint 2: ~X days
|
||||
- Backlog: ~X days
|
||||
|
||||
## Expected Score Improvement
|
||||
| Dimension | Current | After Sprint 0 | After Sprint 1 |
|
||||
|-----------|---------|----------------|----------------|
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- Critical security fixes cannot be pushed to backlog — ever
|
||||
- Effort estimates must be realistic for a solo developer
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
Priority classification disagreements are debated. Effort estimates are averaged.
|
||||
68
.claude/skills/project-health-score.md
Normal file
68
.claude/skills/project-health-score.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# Project Health Score Skill
|
||||
|
||||
## Trigger
|
||||
`/project-health [absolute_path]` or "프로젝트 건강 점수", "헬스 스코어"
|
||||
|
||||
## Description
|
||||
Calculates a weighted health score (0-100) across all 8 dimensions from the project audit.
|
||||
|
||||
## Scoring Weights
|
||||
|
||||
| Dimension | Weight | Rationale |
|
||||
|-----------|--------|-----------|
|
||||
| Security | 20% | Vulnerabilities can kill a product |
|
||||
| Architecture | 15% | Foundation determines long-term viability |
|
||||
| Code Quality | 15% | Maintainability = team velocity |
|
||||
| Testing | 15% | Safety net for changes |
|
||||
| Supply Chain | 10% | Legal and security exposure |
|
||||
| DevOps | 10% | Deployment reliability |
|
||||
| Performance | 10% | User experience |
|
||||
| Documentation | 5% | Onboarding and maintenance |
|
||||
|
||||
## Score Interpretation
|
||||
|
||||
| Range | Grade | Meaning |
|
||||
|-------|-------|---------|
|
||||
| 90-100 | A | Production-ready, well-maintained |
|
||||
| 75-89 | B | Good, minor issues to address |
|
||||
| 60-74 | C | Acceptable, significant improvements needed |
|
||||
| 40-59 | D | Risky, major issues present |
|
||||
| 0-39 | F | Critical, not safe for production |
|
||||
|
||||
## Output Format
|
||||
Final deliverable in **Korean (한국어)**.
|
||||
|
||||
```markdown
|
||||
# [Project Name] Health Score
|
||||
|
||||
## Overall: [Score]/100 — Grade [A/B/C/D/F]
|
||||
|
||||
## Radar Chart Data
|
||||
| Dimension | Score | Weight | Weighted |
|
||||
|-----------|-------|--------|----------|
|
||||
| Security | /10 | 20% | |
|
||||
| Architecture | /10 | 15% | |
|
||||
| Code Quality | /10 | 15% | |
|
||||
| Testing | /10 | 15% | |
|
||||
| Supply Chain | /10 | 10% | |
|
||||
| DevOps | /10 | 10% | |
|
||||
| Performance | /10 | 10% | |
|
||||
| Documentation | /10 | 5% | |
|
||||
| **Total** | | **100%** | **/100** |
|
||||
|
||||
## Trend (if previous audit exists)
|
||||
| Dimension | Previous | Current | Delta |
|
||||
|-----------|----------|---------|-------|
|
||||
|
||||
## Bottom 3 (Biggest Improvement Opportunities)
|
||||
1. [Dimension] — [Score] — [Quick Win]
|
||||
2. ...
|
||||
3. ...
|
||||
```
|
||||
|
||||
## Brutal Analysis Principles
|
||||
- Weighted score must be mathematically correct — no rounding in favor
|
||||
- Grade F projects must be called out explicitly
|
||||
|
||||
## Claude-Gemini Cross-Debate Protocol
|
||||
Score disagreements > 1 point per dimension are debated until consensus.
|
||||
25
.github/workflows/ci.yml
vendored
Normal file
25
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
analyze-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: stable
|
||||
cache: true
|
||||
|
||||
- run: flutter pub get
|
||||
|
||||
- run: dart format --set-exit-if-changed .
|
||||
|
||||
- run: flutter analyze
|
||||
|
||||
- run: flutter test
|
||||
239
ARCHITECTURE.md
Normal file
239
ARCHITECTURE.md
Normal file
@@ -0,0 +1,239 @@
|
||||
# 아키텍처
|
||||
|
||||
Ascii Never Die의 시스템 설계 문서.
|
||||
|
||||
## 계층 구조
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────┐
|
||||
│ Presentation │
|
||||
│ features/ (화면, 위젯, 컨트롤러) │
|
||||
│ front / new_character / game / arena / settings │
|
||||
├─────────────────────────────────────────────────┤
|
||||
│ Domain │
|
||||
│ core/engine/ (게임 로직 서비스) │
|
||||
│ core/model/ (데이터 모델) │
|
||||
├─────────────────────────────────────────────────┤
|
||||
│ Data │
|
||||
│ data/ (정적 게임 데이터) │
|
||||
│ core/storage/ (세이브/설정 저장소) │
|
||||
│ core/infrastructure/ (광고, IAP) │
|
||||
└─────────────────────────────────────────────────┘
|
||||
|
||||
의존 방향: Presentation → Domain → Data (역방향 금지)
|
||||
```
|
||||
|
||||
## 핵심 데이터 흐름
|
||||
|
||||
```
|
||||
ProgressLoop (타이머)
|
||||
│
|
||||
▼ tickOnce()
|
||||
ProgressService.tick()
|
||||
│
|
||||
├─→ CombatTickService (전투 틱 처리)
|
||||
├─→ LootHandler (전리품 처리)
|
||||
├─→ ExpHandler (경험치/레벨업)
|
||||
├─→ SkillService (스킬 진행)
|
||||
├─→ QuestCompletionHandler(퀘스트 완료)
|
||||
├─→ StoryService (스토리 진행)
|
||||
└─→ GameMutations (상태 변경 적용)
|
||||
│
|
||||
▼
|
||||
GameState (Stream)
|
||||
│
|
||||
├─→ UI 갱신 (StreamBuilder)
|
||||
└─→ SaveManager 자동 저장
|
||||
```
|
||||
|
||||
### 전투 사이클
|
||||
|
||||
```
|
||||
TaskGenerator.생성() → 몬스터 조우
|
||||
│
|
||||
▼
|
||||
CombatTickService.처리()
|
||||
├─→ PlayerAttackProcessor (플레이어 공격)
|
||||
├─→ CombatCalculator (데미지 계산)
|
||||
└─→ 결과 판정
|
||||
├─ 승리 → LootHandler → ExpHandler → 다음 태스크
|
||||
└─ 패배 → DeathHandler → ResurrectionService
|
||||
```
|
||||
|
||||
## 디렉토리별 책임
|
||||
|
||||
### `data/` -- 정적 게임 데이터
|
||||
|
||||
Config.dfm에서 추출한 종족, 직업, 스킬, 포션, 스토리 데이터. Dart const로 관리하며 런타임 변경 없음.
|
||||
|
||||
| 파일 | 역할 |
|
||||
|------|------|
|
||||
| `pq_config_data.dart` | 게임 원본 정적 데이터 (몬스터, 아이템, 주문 등) |
|
||||
| `class_data.dart` | 직업 정의 + 특성 |
|
||||
| `race_data.dart` | 종족 정의 + 특성 |
|
||||
| `skill_data.dart` | 68개 스킬 정의 |
|
||||
| `potion_data.dart` | 포션 데이터 |
|
||||
| `story_data.dart` | 스토리/액트 데이터 |
|
||||
| `game_text_l10n.dart` | 게임 텍스트 다국어 매핑 |
|
||||
|
||||
### `core/engine/` -- 게임 로직 (30개 서비스)
|
||||
|
||||
타이머 기반 메인 루프에서 호출되는 순수 게임 로직. UI 의존 없음.
|
||||
|
||||
| 서비스 | 역할 |
|
||||
|--------|------|
|
||||
| `progress_loop.dart` | 타이머 기반 메인 루프 (틱 발행) |
|
||||
| `progress_service.dart` | 틱 수신 → 서비스 오케스트레이션 |
|
||||
| `combat_tick_service.dart` | 전투 틱 처리 |
|
||||
| `combat_calculator.dart` | 데미지/방어/크리티컬 계산 |
|
||||
| `player_attack_processor.dart` | 플레이어 공격 처리 |
|
||||
| `death_handler.dart` | 사망 처리 |
|
||||
| `resurrection_service.dart` | 부활 처리 |
|
||||
| `loot_handler.dart` | 전리품 드롭 |
|
||||
| `exp_handler.dart` | 경험치/레벨업 |
|
||||
| `item_service.dart` | 아이템 생성/비교 |
|
||||
| `shop_service.dart` | 상점 매매 |
|
||||
| `market_service.dart` | 시장 거래 |
|
||||
| `skill_service.dart` | 스킬 진행/레벨업 |
|
||||
| `skill_auto_selector.dart` | 스킬 자동 선택 |
|
||||
| `potion_service.dart` | 포션 수집/사용 |
|
||||
| `quest_completion_handler.dart` | 퀘스트 완료 처리 |
|
||||
| `story_service.dart` | 스토리/액트 진행 |
|
||||
| `act_progression_service.dart` | 액트 전환 |
|
||||
| `arena_service.dart` | 아레나 랭킹/매칭 |
|
||||
| `arena_combat_simulator.dart` | 아레나 전투 시뮬레이션 |
|
||||
| `chest_service.dart` | 보물상자 처리 |
|
||||
| `reward_service.dart` | 보상 분배 |
|
||||
| `return_rewards_service.dart` | 복귀 보상 계산 |
|
||||
| `stat_calculator.dart` | 스탯 총합 계산 |
|
||||
| `task_generator.dart` | 태스크(전투/이동/상점) 생성 |
|
||||
| `game_mutations.dart` | GameState 변경 함수 |
|
||||
| `character_roll_service.dart` | 캐릭터 스탯 롤 (3d6) |
|
||||
|
||||
### `core/model/` -- 데이터 모델
|
||||
|
||||
freezed + json_serializable로 불변(immutable) 모델 생성. 직렬화/역직렬화 자동 처리.
|
||||
|
||||
주요 모델: `GameState`, `SaveData`, `CombatStats`, `EquipmentItem`, `ItemStats`, `MonetizationState`, `SkillSystemState`, `ProgressState`, `HallOfFame`
|
||||
|
||||
### `core/storage/` -- 저장 시스템
|
||||
|
||||
| 파일 | 역할 |
|
||||
|------|------|
|
||||
| `save_manager.dart` | 자동/수동 저장 관리 |
|
||||
| `save_service.dart` | 세이브 슬롯 CRUD |
|
||||
| `save_repository.dart` | 파일시스템 I/O |
|
||||
| `save_integrity.dart` | HMAC-SHA256 무결성 검증 |
|
||||
| `settings_repository.dart` | SharedPreferences 설정 |
|
||||
| `hall_of_fame_storage.dart` | 명예의 전당 저장 |
|
||||
| `statistics_storage.dart` | 통계 저장 |
|
||||
|
||||
### `core/infrastructure/` -- 외부 서비스
|
||||
|
||||
| 파일 | 역할 |
|
||||
|------|------|
|
||||
| `ad_service.dart` | Google AdMob 래퍼 (IAdService 구현) |
|
||||
| `iap_service.dart` | in_app_purchase 래퍼 (IIAPService 구현) |
|
||||
|
||||
### `features/` -- 화면 (Presentation)
|
||||
|
||||
각 화면은 독립된 디렉토리. controllers/managers/pages/widgets로 세분화.
|
||||
|
||||
| 디렉토리 | 화면 | 구성 |
|
||||
|----------|------|------|
|
||||
| `front/` | 타이틀/세이브 선택 | 프론트 스크린, 세이브 피커 |
|
||||
| `new_character/` | 캐릭터 생성 | 종족/직업 선택, 스탯 롤, 이름 입력 |
|
||||
| `game/` | 메인 게임 | 7개 탭 페이지, 모바일/데스크톱 레이아웃 |
|
||||
| `arena/` | 아레나 PvP | 셋업, 전투, 결과 |
|
||||
| `hall_of_fame/` | 명예의 전당 | 영웅 목록, 상세 정보 |
|
||||
| `settings/` | 설정 | 사운드, 언어, 계정 |
|
||||
|
||||
### `shared/` -- 공용 컴포넌트
|
||||
|
||||
- `animation/` -- ASCII 아트 애니메이션 시스템 (Canvas 기반 렌더링, 캐릭터/몬스터/무기 프레임)
|
||||
- `widgets/` -- 레트로 UI 위젯 (RetroButton, RetroPanel, RetroProgressBar, RetroDialog 등)
|
||||
- `theme/` -- ASCII 컬러 팔레트, 레트로 테마 상수
|
||||
|
||||
## DI 구조
|
||||
|
||||
GetIt 서비스 로케이터 패턴으로 인터페이스 기반 의존성 주입.
|
||||
|
||||
```
|
||||
core/di/
|
||||
├── service_locator.dart # GetIt 인스턴스 + 등록
|
||||
├── i_ad_service.dart # 광고 서비스 인터페이스
|
||||
└── i_iap_service.dart # IAP 서비스 인터페이스
|
||||
```
|
||||
|
||||
```dart
|
||||
// 등록 (main.dart에서 1회 호출)
|
||||
sl.registerLazySingleton<IIAPService>(() => IAPService.createInstance());
|
||||
sl.registerLazySingleton<IAdService>(() => AdService.createInstance());
|
||||
|
||||
// 사용
|
||||
final iap = sl<IIAPService>();
|
||||
```
|
||||
|
||||
인터페이스를 통해 테스트 시 목(mock) 교체 가능.
|
||||
|
||||
## 수익화 시스템
|
||||
|
||||
### IAP (인앱결제)
|
||||
|
||||
- 상품: `remove_ads_and` (광고 제거 + 프리미엄)
|
||||
- 구매 상태: `flutter_secure_storage`에 암호화 저장
|
||||
- 영수증 검증: Google Play RSA 서명 로컬 검증 (`pointycastle`)
|
||||
- 앱 재설치 시 자동 복원 지원
|
||||
- `MonetizationState` (freezed 모델)로 구매/광고 상태 통합 관리
|
||||
|
||||
### AdMob (광고)
|
||||
|
||||
- 리워드 광고: 속도 부스트, 복귀 보상 2배
|
||||
- 인터스티셜 광고: 부활 시
|
||||
- IAP 구매자는 모든 광고 자동 비활성화
|
||||
- 릴리즈 빌드에서 치트 메뉴 완전 차단 (`kDebugMode` 가드)
|
||||
|
||||
## 저장 시스템
|
||||
|
||||
### 세이브 파일
|
||||
|
||||
- JSON 직렬화 (`SaveData` → `json_serializable`)
|
||||
- HMAC-SHA256 체크섬으로 무결성 검증 (`save_integrity.dart`)
|
||||
- 파일시스템 기반 저장 (`path_provider`)
|
||||
- 자동 저장: 레벨업, 퀘스트 완료, 주기적 타이머
|
||||
|
||||
### 설정
|
||||
|
||||
- `SharedPreferences`로 경량 설정 저장 (사운드, 언어 등)
|
||||
|
||||
### 보안 저장
|
||||
|
||||
- IAP 구매 상태: `flutter_secure_storage` (플랫폼 키체인/키스토어)
|
||||
|
||||
## 테스트 전략
|
||||
|
||||
```
|
||||
test/
|
||||
├── core/
|
||||
│ ├── engine/ # 게임 엔진 서비스 단위 테스트 (12개)
|
||||
│ ├── model/ # 모델 직렬화/상태 테스트 (2개)
|
||||
│ ├── storage/ # 저장소 테스트 (1개)
|
||||
│ └── util/ # 유틸리티/밸런스 테스트 (3개)
|
||||
├── features/ # 위젯/컨트롤러 테스트 (3개)
|
||||
├── regression/ # 결정적 게임 시뮬레이션 회귀 테스트 (1개)
|
||||
└── helpers/ # 목 팩토리, 테스트 셋업
|
||||
```
|
||||
|
||||
### 테스트 원칙
|
||||
|
||||
- **엔진 로직 우선**: 게임 엔진 서비스에 집중 (전투, 아이템, 스킬, 상점, 아레나, 포션, 복귀보상)
|
||||
- **결정적 시뮬레이션**: `DeterministicRandom`으로 동일 시드 → 동일 결과 보장
|
||||
- **목 팩토리**: `test/helpers/mock_factories.dart`로 GameState, CombatStats 등 재사용 가능한 테스트 데이터 제공
|
||||
- **회귀 테스트**: 전체 게임 루프를 N틱 시뮬레이션하여 밸런스 변경 감지
|
||||
|
||||
### 실행
|
||||
|
||||
```bash
|
||||
flutter test # 전체 실행
|
||||
flutter test test/core/engine/ # 엔진 테스트만
|
||||
```
|
||||
70
CHANGELOG.md
Normal file
70
CHANGELOG.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Changelog
|
||||
|
||||
프로젝트의 주요 변경 사항을 기록합니다.
|
||||
형식: [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- AdMob 미디에이션 지원 준비 (AppLovin MAX)
|
||||
|
||||
---
|
||||
|
||||
## [1.1.0] - 2026-03-30
|
||||
|
||||
### Security
|
||||
- IAP 로컬 영수증 RSA 서명 검증 (Google Play pointycastle)
|
||||
- 구매 상태 SharedPreferences → flutter_secure_storage 전환
|
||||
- 세이브 파일 HMAC-SHA256 무결성 체크섬 추가
|
||||
- 릴리즈 빌드 치트 메뉴 완전 차단 (kDebugMode 가드)
|
||||
|
||||
### Added
|
||||
- CI 파이프라인 (.github/workflows/ci.yml: format+analyze+test)
|
||||
- ATT 추적 동의 문구 다국어화 (한/영/일)
|
||||
- iOS Podfile 최소 버전 명시 (13.0)
|
||||
- 복귀 보상 유료 유저 오프라인 시간 2배 인정
|
||||
- IAP 앱 재설치 시 자동 구매 복원
|
||||
- 테스트 105개 추가 (death_handler, item_service, shop_service, arena_service, potion_service, monetization_state, return_rewards_service)
|
||||
|
||||
### Changed
|
||||
- google_mobile_ads 5.3 → 7.x 업그레이드 (iOS Privacy Manifest 대응)
|
||||
- flutter_lints 5 → 6 업그레이드
|
||||
- IAP 상품 ID: remove_ads → remove_ads_and
|
||||
|
||||
### Fixed
|
||||
- 인터스티셜 광고 실패 시 onComplete 콜백 미호출
|
||||
- 아레나 DOT 스킬 INT/WIS가 ATK/DEF로 잘못 계산되던 문제
|
||||
- ProgressState.copyWith(currentCombat: null) 초기화 안 되던 버그
|
||||
- save_data JSON 캐스팅 시 null 크래시 방지
|
||||
- settings_repository _prefs! 강제 언래핑 제거
|
||||
- MonetizationState IAP 구매 상태 동기화 지연
|
||||
- death_handler print() → debugPrint() 변경
|
||||
- SpeedBoostButton 기본 배율 10→5 수정
|
||||
- 복귀 보상 AdType 잘못된 타입 사용
|
||||
|
||||
### Refactored
|
||||
- 데스크톱 레이아웃 → DesktopGameLayout 위젯 분리
|
||||
- VictoryOverlay 734줄 → 265줄 (크레딧 콘텐츠 분리)
|
||||
- HelpDialog 496줄 → 106줄 (4개 탭 뷰 분리)
|
||||
- 미사용 StoryService 인스턴스 제거
|
||||
- 중복 파일 제거 (arena/ascii_disintegrate_widget.dart)
|
||||
- cupertino_icons 미사용 패키지 제거
|
||||
|
||||
### Docs
|
||||
- CLAUDE.md Claude-Gemini 교차 토론 프로토콜 추가
|
||||
- CLAUDE.md 존재하지 않는 디렉토리 제거
|
||||
- 폰트 라이선스 파일 추가 (JetBrainsMono, PressStart2P)
|
||||
- 스킬 개수 문서 수정 (70→68)
|
||||
- 하드코딩 문자열 l10n 적용 (Undo/Rolls)
|
||||
|
||||
---
|
||||
|
||||
## [1.0.1] - 2026-03-19
|
||||
|
||||
### Added
|
||||
- 초기 릴리즈 (Google Play 내부 테스트)
|
||||
- 6개 화면 (프론트, 캐릭터 생성, 게임, 아레나, 명예의 전당, 설정)
|
||||
- 광고 수익화 (AdMob 리워드/인터스티셜)
|
||||
- IAP 광고 제거 + 프리미엄
|
||||
- 한/영/일 3개 언어 지원
|
||||
- 오프라인 완전 동작
|
||||
118
CLAUDE.md
118
CLAUDE.md
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
|
||||
## 프로젝트 개요
|
||||
|
||||
Askii Never Die는 Progress Quest 6.4 (Delphi 원본)를 Flutter로 100% 동일하게 복제하는 오프라인 싱글플레이어 RPG입니다. 네트워크 기능은 모두 제외되며, 원본 알고리즘과 데이터를 그대로 유지해야 합니다.
|
||||
Askii Never Die는 "디지털 판타지" 세계관의 오프라인 싱글플레이어 방치형 RPG입니다. ASCII 아트 비주얼과 자동 전투 시스템이 특징이며, 네트워크 기능은 제외됩니다.
|
||||
|
||||
## 빌드 및 실행
|
||||
|
||||
@@ -27,29 +27,51 @@ flutter test
|
||||
|
||||
```
|
||||
lib/
|
||||
├── main.dart # 앱 진입점
|
||||
├── data/pq_config_data.dart # PQ 정적 데이터 (Config.dfm 추출)
|
||||
├── main.dart # 앱 진입점
|
||||
├── data/ # 정적 데이터 (Config.dfm 추출 + 확장)
|
||||
│ ├── pq_config_data.dart # 게임 원본 정적 데이터
|
||||
│ ├── class_data.dart # 직업 데이터
|
||||
│ ├── race_data.dart # 종족 데이터
|
||||
│ ├── skill_data.dart # 스킬 데이터
|
||||
│ ├── potion_data.dart # 포션 데이터
|
||||
│ ├── story_data.dart # 스토리 데이터
|
||||
│ └── game_text_l10n.dart # 게임 텍스트 번역
|
||||
├── l10n/ # 앱 UI 다국어 리소스 (arb)
|
||||
└── src/
|
||||
├── app.dart # MaterialApp 설정
|
||||
├── app.dart # MaterialApp 설정
|
||||
├── core/
|
||||
│ ├── engine/ # 게임 루프 및 진행 로직
|
||||
│ │ ├── progress_loop.dart # 타이머 기반 메인 루프 (원본 200ms)
|
||||
│ │ ├── progress_service.dart # 틱 처리, 경험치/레벨업 로직
|
||||
│ │ ├── game_mutations.dart # 상태 변경 함수
|
||||
│ │ └── reward_service.dart # 보상 처리
|
||||
│ ├── model/
|
||||
│ │ ├── game_state.dart # 핵심 상태: Traits, Stats, Inventory, Equipment, SpellBook, ProgressState, QueueState
|
||||
│ │ ├── pq_config.dart # Config 데이터 접근
|
||||
│ │ ├── equipment_slot.dart # 장비 슬롯 정의
|
||||
│ │ └── save_data.dart # 저장 데이터 구조
|
||||
│ ├── storage/ # 세이브 파일 처리
|
||||
│ └── util/
|
||||
│ ├── deterministic_random.dart # 결정론적 RNG (재현 가능)
|
||||
│ ├── pq_logic.dart # 원본 로직 포팅 (odds, randSign 등)
|
||||
│ └── roman.dart # 로마 숫자 변환
|
||||
└── features/
|
||||
├── front/front_screen.dart # 임시 프론트 화면
|
||||
└── game/game_session_controller.dart # 게임 세션 관리
|
||||
│ ├── engine/ # 게임 루프 및 진행 로직
|
||||
│ │ ├── progress_loop.dart # 타이머 기반 메인 루프
|
||||
│ │ ├── progress_service.dart # 틱 처리, 경험치/레벨업 로직
|
||||
│ │ ├── game_mutations.dart # 상태 변경 함수
|
||||
│ │ ├── reward_service.dart # 보상 처리
|
||||
│ │ ├── combat_calculator.dart # 전투 계산
|
||||
│ │ ├── combat_tick_service.dart # 전투 틱 처리
|
||||
│ │ ├── arena_service.dart # 아레나 시스템
|
||||
│ │ ├── skill_service.dart # 스킬 시스템
|
||||
│ │ ├── item_service.dart # 아이템 처리
|
||||
│ │ ├── potion_service.dart # 포션 시스템
|
||||
│ │ ├── shop_service.dart # 상점 시스템
|
||||
│ │ ├── story_service.dart # 스토리 진행
|
||||
│ │ └── ... # 기타 서비스
|
||||
│ ├── model/ # 게임 상태 및 데이터 모델
|
||||
│ ├── infrastructure/ # 외부 서비스 (광고, IAP 등)
|
||||
│ ├── audio/ # 오디오 서비스
|
||||
│ ├── storage/ # 세이브/설정 저장소
|
||||
│ ├── notification/ # 알림 서비스
|
||||
│ └── util/ # 유틸리티 (RNG, 로직 헬퍼 등)
|
||||
├── features/
|
||||
│ ├── front/ # 타이틀/세이브 선택 화면
|
||||
│ ├── new_character/ # 캐릭터 생성 화면
|
||||
│ ├── game/ # 게임 진행 화면 (메인)
|
||||
│ │ ├── controllers/ # 전투 로그, 오디오 컨트롤러
|
||||
│ │ ├── managers/ # 통계, 부활, 속도 부스트 등
|
||||
│ │ ├── pages/ # 탭별 페이지 (장비, 인벤토리, 퀘스트 등)
|
||||
│ │ └── widgets/ # UI 위젯
|
||||
│ ├── arena/ # 아레나 전투 화면
|
||||
│ ├── hall_of_fame/ # 명예의 전당
|
||||
│ └── settings/ # 설정 화면
|
||||
└── shared/ # 공통 테마/위젯
|
||||
|
||||
example/pq/ # Delphi 원본 소스 (참조용, 빌드 대상 아님)
|
||||
test/ # 단위/위젯 테스트
|
||||
@@ -69,10 +91,9 @@ test/ # 단위/위젯 테스트
|
||||
|
||||
## 핵심 규칙
|
||||
|
||||
### 원본 충실도
|
||||
- `example/pq/` 내 Delphi 소스의 알고리즘/데이터를 100% 동일하게 포팅
|
||||
- 원본 로직 변경 필요 시 반드시 사용자 승인 필요
|
||||
- 새로운 기능, 값, 처리 로직 추가 금지 (디버깅 로그 예외)
|
||||
### 원본 참조 정책
|
||||
- `example/pq/`는 참조용으로 유지
|
||||
- 원본 알고리즘은 참고하되 독자적 확장/수정 허용
|
||||
|
||||
### 데이터 관리
|
||||
- 정적 데이터(몬스터, 아이템, 주문 등)는 `Config.dfm`에서 추출하여 JSON/Dart const로 관리
|
||||
@@ -87,11 +108,13 @@ test/ # 단위/위젯 테스트
|
||||
- SRP(Single Responsibility Principle) 준수
|
||||
|
||||
### 화면 구성
|
||||
- 2개 화면만 사용: 캐릭터 생성 화면, 게임 진행 화면
|
||||
- 주요 화면: 프론트, 캐릭터 생성, 게임 진행, 아레나, 명예의 전당, 설정
|
||||
- 화면 내 요소는 위젯 단위로 분리
|
||||
|
||||
## 원본 소스 참조 (example/pq/)
|
||||
|
||||
> 참고용으로만 사용. 원본 로직을 그대로 따를 의무는 없음.
|
||||
|
||||
| 파일 | 핵심 함수/라인 | 역할 |
|
||||
|------|----------------|------|
|
||||
| `Main.pas:523-1040` | `MonsterTask` | 전투/전리품/레벨업 |
|
||||
@@ -105,7 +128,6 @@ test/ # 단위/위젯 테스트
|
||||
- `pubspec.yaml` 의존성 변경
|
||||
- 플랫폼 빌드 설정 (Android/iOS/desktop)
|
||||
- 네트워크 접근 도입
|
||||
- 원본 데이터/알고리즘 수정
|
||||
- 대규모 파일 삭제 또는 구조 변경
|
||||
|
||||
## 커밋 규칙
|
||||
@@ -117,3 +139,43 @@ type(scope): 한국어 설명
|
||||
```
|
||||
|
||||
Types: `feat`, `fix`, `refactor`, `test`, `docs`, `style`, `chore`, `perf`
|
||||
|
||||
## 작업 프로토콜
|
||||
|
||||
### 3자 교차 토론 (Three-Party Cross-Debate)
|
||||
모든 에이전트/스킬 실행 결과는 Claude, Gemini, Codex 3자가 독립 분석 후 토론하여 합의된 결과만 사용자에게 제공한다.
|
||||
|
||||
| AI | 역할 | 초점 |
|
||||
|----|------|------|
|
||||
| **Claude** | 전략가/종합자 | 비즈니스 로직, 설계, 최종 종합 |
|
||||
| **Gemini** | 논리 비평가 | 논리적 모순, UX 갭, 엣지 케이스 |
|
||||
| **Codex** | 기술 감사자 | 구현 실현성, 인프라 제약, 보안, 코드 품질 |
|
||||
|
||||
```
|
||||
[Round 1: 초안 + 병렬 리뷰]
|
||||
1. Claude 에이전트 실행 → 초안 생성
|
||||
2. 병렬 실행:
|
||||
a. gemini -y -p "{초안 + 리뷰 프롬프트}" -o text
|
||||
b. codex exec "{초안 + 리뷰 프롬프트}" --full-auto
|
||||
3. Claude가 3자 관점 비교 → 합의/불일치 식별
|
||||
|
||||
[Round 2: 불일치 토론 (불일치 있을 때만)]
|
||||
4. gemini -y -r latest -p "{불일치 + 반론}" -o text
|
||||
5. codex exec "{전체 컨텍스트 + 불일치}" --full-auto
|
||||
6. Claude 최종 종합
|
||||
|
||||
[합의 규칙]
|
||||
- 합의 시: 합의 내용만 출력
|
||||
- 미합의 시: "[NO CONSENSUS]" 표기 + 3자 의견 병기
|
||||
```
|
||||
|
||||
### 에이전트/스킬 활용
|
||||
- 에이전트 정의: `.claude/agents/` (origin에서 복사)
|
||||
- 스킬 정의: `.claude/skills/` (origin에서 복사)
|
||||
- 비사소한 작업은 반드시 에이전트를 병렬 배포하여 진행
|
||||
- 작업 완료 조건: Gemini 토론 합의 완료
|
||||
|
||||
## 프로젝트 분석 리포트
|
||||
|
||||
- `analysis/full-audit-2026-03-27.md` — 9개 에이전트 전체 감사 (Health Score: 49/100)
|
||||
- `analysis/supply-chain-review.md` — 의존성/라이선스/CVE 분석
|
||||
|
||||
250
PLAN.md
Normal file
250
PLAN.md
Normal file
@@ -0,0 +1,250 @@
|
||||
# 종족/클래스 패시브 미반영 수정 계획
|
||||
|
||||
## 1. 현황 분석
|
||||
|
||||
### 반영되는 패시브 (전투 스탯 계산에 적용됨)
|
||||
- HP/MP 보너스, 물리/마법 데미지 보너스, 방어력/회피율/크리티컬 보너스
|
||||
|
||||
### 미반영 패시브 (정의만 있고 실제 로직에서 미사용)
|
||||
|
||||
| 패시브 | 영향받는 종족/클래스 | 수정 위치 |
|
||||
|--------|---------------------|-----------|
|
||||
| `expMultiplier` | Byte Human (+5%), Callback Seraph (+3%) | `progress_service.dart:387` |
|
||||
| `firstStrikeBonus` | Pointer Assassin (1.5배) | `combat_tick_service.dart` |
|
||||
| `multiAttack` | Refactor Monk | `combat_tick_service.dart` |
|
||||
| `postCombatHeal` | Garbage Collector (+5%) | `progress_service.dart:279` |
|
||||
| `healingBonus` | Debugger Paladin, Exception Handler, Null Checker | `potion_service.dart`, `skill_service.dart` |
|
||||
| `deathEquipmentPreserve` | Coredump Undead | **특성 변경 필요** |
|
||||
|
||||
---
|
||||
|
||||
## 2. 수정 내용
|
||||
|
||||
### 2.1 경험치 배율 (`expMultiplier`)
|
||||
|
||||
**파일**: `lib/src/core/engine/progress_service.dart`
|
||||
|
||||
**위치**: 384-387줄
|
||||
|
||||
**현재 코드**:
|
||||
```dart
|
||||
if (gain && nextState.traits.level < 100 && monsterExpReward > 0) {
|
||||
final newExpPos = progress.exp.position + monsterExpReward;
|
||||
```
|
||||
|
||||
**수정 후**:
|
||||
```dart
|
||||
if (gain && nextState.traits.level < 100 && monsterExpReward > 0) {
|
||||
// 종족 경험치 배율 적용 (예: Byte Human +5%)
|
||||
final race = RaceData.findById(nextState.traits.raceId);
|
||||
final expMultiplier = race?.expMultiplier ?? 1.0;
|
||||
final adjustedExp = (monsterExpReward * expMultiplier).round();
|
||||
final newExpPos = progress.exp.position + adjustedExp;
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 2.2 첫 공격 배율 (`firstStrikeBonus`)
|
||||
|
||||
**파일**: `lib/src/core/engine/combat_tick_service.dart`
|
||||
|
||||
**설계**:
|
||||
- 전투 시작 시 첫 공격인지 추적하는 플래그 필요
|
||||
- 첫 공격 시 `firstStrikeBonus` 배율 적용
|
||||
|
||||
**수정 방안**:
|
||||
1. `CombatState`에 `isFirstAttack` 플래그 추가
|
||||
2. `CombatTickService`에서 첫 플레이어 공격 시 배율 적용:
|
||||
```dart
|
||||
var damage = result.damage;
|
||||
if (isFirstPlayerAttack && firstStrikeBonus > 1.0) {
|
||||
damage = (damage * firstStrikeBonus).round();
|
||||
isFirstPlayerAttack = false;
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 2.3 연속 공격 (`multiAttack`)
|
||||
|
||||
**파일**: `lib/src/core/engine/combat_tick_service.dart`
|
||||
|
||||
**설계**:
|
||||
- `hasMultiAttack` 패시브가 있으면 일정 확률로 추가 공격
|
||||
- 예: 30% 확률로 연속 공격 (2타)
|
||||
|
||||
**수정 방안**:
|
||||
```dart
|
||||
// 플레이어 공격 후
|
||||
if (hasMultiAttack && rng.nextDouble() < 0.3) {
|
||||
// 추가 공격 실행
|
||||
final extraAttack = calculator.playerAttackMonster(...);
|
||||
// 결과 합산
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 2.4 전투 후 HP 회복 (`postCombatHeal`)
|
||||
|
||||
**파일**: `lib/src/core/engine/progress_service.dart`
|
||||
|
||||
**위치**: 276-280줄
|
||||
|
||||
**현재 코드**:
|
||||
```dart
|
||||
// 전투 승리 시 HP 회복 (50% + CON/2)
|
||||
final conBonus = nextState.stats.con ~/ 2;
|
||||
final healAmount = (maxHp * 0.5).round() + conBonus;
|
||||
```
|
||||
|
||||
**수정 후**:
|
||||
```dart
|
||||
// 전투 승리 시 HP 회복 (50% + CON/2 + 클래스 패시브)
|
||||
final conBonus = nextState.stats.con ~/ 2;
|
||||
var healAmount = (maxHp * 0.5).round() + conBonus;
|
||||
|
||||
// 클래스 패시브: 전투 후 HP 회복 (Garbage Collector +5%)
|
||||
final klass = ClassData.findById(nextState.traits.classId);
|
||||
if (klass != null) {
|
||||
final postCombatHealRate = klass.getPassiveValue(ClassPassiveType.postCombatHeal);
|
||||
if (postCombatHealRate > 0) {
|
||||
healAmount += (maxHp * postCombatHealRate).round();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 2.5 회복력 보너스 (`healingBonus`)
|
||||
|
||||
물약/스킬 사용 시 추가 회복 적용
|
||||
|
||||
#### 2.5.1 물약 회복
|
||||
|
||||
**파일**: `lib/src/core/engine/potion_service.dart`
|
||||
|
||||
**수정 위치**: `usePotion()` 메서드 (73-81줄)
|
||||
|
||||
**현재 코드**:
|
||||
```dart
|
||||
if (potion.isHpPotion) {
|
||||
healedAmount = potion.calculateHeal(maxHp);
|
||||
newHp = (currentHp + healedAmount).clamp(0, maxHp);
|
||||
```
|
||||
|
||||
**수정 후**:
|
||||
```dart
|
||||
if (potion.isHpPotion) {
|
||||
var baseHeal = potion.calculateHeal(maxHp);
|
||||
// 회복력 보너스 적용 (클래스 패시브)
|
||||
baseHeal = (baseHeal * healingMultiplier).round();
|
||||
newHp = (currentHp + baseHeal).clamp(0, maxHp);
|
||||
healedAmount = newHp - currentHp;
|
||||
```
|
||||
|
||||
**참고**: `PotionService`에 `healingMultiplier` 파라미터 추가 필요
|
||||
|
||||
#### 2.5.2 스킬 회복
|
||||
|
||||
**파일**: `lib/src/core/engine/skill_service.dart`
|
||||
|
||||
**수정 위치**: `useHealSkill()` 메서드 (125-132줄)
|
||||
|
||||
**현재 코드**:
|
||||
```dart
|
||||
int healAmount = skill.healAmount;
|
||||
if (skill.healPercent > 0) {
|
||||
healAmount += (player.hpMax * skill.healPercent).round();
|
||||
}
|
||||
```
|
||||
|
||||
**수정 후**:
|
||||
```dart
|
||||
int healAmount = skill.healAmount;
|
||||
if (skill.healPercent > 0) {
|
||||
healAmount += (player.hpMax * skill.healPercent).round();
|
||||
}
|
||||
// 회복력 보너스 적용 (클래스 패시브)
|
||||
healAmount = (healAmount * healingMultiplier).round();
|
||||
```
|
||||
|
||||
**참고**: `SkillService`에 `healingMultiplier` 파라미터 추가 필요
|
||||
|
||||
---
|
||||
|
||||
### 2.6 Coredump Undead 특성 변경
|
||||
|
||||
**현재 특성**: `deathEquipmentPreserve` (사망 시 장비 1개 유지) - BM 침해
|
||||
|
||||
**대체 특성 제안** (언데드 콘셉트에 어울리는 것):
|
||||
|
||||
| 옵션 | 설명 | 장점 |
|
||||
|------|------|------|
|
||||
| **방어력 +10%** | 언데드는 고통을 느끼지 않아 피해 감소 | 구현 간단, CON+2와 시너지 |
|
||||
| **HP +8%** | 불사의 육체 | 구현 간단, 생존형 콘셉트 유지 |
|
||||
| **HP +5% + 방어력 +5%** | 복합 생존 특화 | 다른 종족과 차별화 |
|
||||
|
||||
**추천**: `defenseBonus: 0.10` (방어력 +10%)
|
||||
- 이유: 언데드의 "고통을 느끼지 않는" 콘셉트와 어울림
|
||||
- 기존 CON+2, STR+1 스탯과 탱커형 시너지
|
||||
|
||||
**파일**: `lib/data/race_data.dart`
|
||||
|
||||
**수정**:
|
||||
```dart
|
||||
static const coredumpUndead = RaceTraits(
|
||||
raceId: 'coredump_undead',
|
||||
name: 'Coredump Undead',
|
||||
statModifiers: {
|
||||
StatType.con: 2,
|
||||
StatType.str: 1,
|
||||
StatType.cha: -2,
|
||||
StatType.dex: -1,
|
||||
},
|
||||
passives: [
|
||||
PassiveAbility(
|
||||
type: PassiveType.defenseBonus, // 변경
|
||||
value: 0.10, // 변경
|
||||
description: '방어력 +10%', // 변경
|
||||
),
|
||||
],
|
||||
);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. 수정 순서
|
||||
|
||||
1. **Coredump Undead 특성 변경** - 단순 데이터 수정
|
||||
2. **경험치 배율** - 간단한 로직 추가
|
||||
3. **전투 후 HP 회복** - 간단한 로직 추가
|
||||
4. **회복력 보너스** - 서비스 파라미터 수정 필요
|
||||
5. **첫 공격 배율** - 전투 상태 추적 필요
|
||||
6. **연속 공격** - 전투 로직 수정 필요
|
||||
|
||||
---
|
||||
|
||||
## 4. 검증 방법
|
||||
|
||||
1. `flutter analyze` 통과
|
||||
2. 각 패시브가 적용된 종족/클래스로 캐릭터 생성
|
||||
3. 실제 게임 플레이로 효과 확인:
|
||||
- Byte Human: 경험치 +5% (레벨업 속도)
|
||||
- Pointer Assassin: 첫 공격 1.5배 (전투 시작 데미지)
|
||||
- Refactor Monk: 연속 공격 (추가 타격)
|
||||
- Garbage Collector: 전투 후 +5% HP 회복
|
||||
- Debugger Paladin: 물약/스킬 회복량 +10%
|
||||
- Coredump Undead: 방어력 +10%
|
||||
|
||||
---
|
||||
|
||||
## 5. 삭제할 코드
|
||||
|
||||
**파일**: `lib/src/core/model/race_traits.dart`
|
||||
|
||||
`PassiveType.deathEquipmentPreserve` enum 삭제 (사용되지 않음)
|
||||
|
||||
**파일**: `lib/src/core/engine/stat_calculator.dart`
|
||||
|
||||
`calculateDeathEquipmentPreserve()` 메서드 삭제 (사용되지 않음)
|
||||
129
README.md
129
README.md
@@ -1,25 +1,128 @@
|
||||
# Ascii Never Die
|
||||
# ASCII Never Die
|
||||
|
||||
Offline Flutter rebuild of **Progress Quest 6.4** (single-player only). Network features are stripped; all game data and saves live locally.
|
||||
"디지털 판타지" 세계관의 오프라인 방치형 RPG. ASCII 아트 비주얼과 자동 전투 시스템으로, 켜두기만 하면 캐릭터가 성장합니다.
|
||||
|
||||
## Layout
|
||||
- `lib/src/features/front/` – temporary front screen shell to hang the upcoming flow on.
|
||||
- `doc/progress-quest-flutter-plan.md` – working plan/notes for the port.
|
||||
- `example/pq/` – original Delphi source/assets (reference only, not built).
|
||||
## 스크린샷
|
||||
|
||||
<!-- TODO: 스크린샷 추가 -->
|
||||
| 타이틀 | 캐릭터 생성 | 게임 진행 |
|
||||
|--------|-------------|-----------|
|
||||
|  |  |  |
|
||||
|
||||
| 아레나 | 명예의 전당 | 설정 |
|
||||
|--------|-------------|------|
|
||||
|  |  |  |
|
||||
|
||||
## 주요 기능
|
||||
|
||||
- **방치형 자동 전투** -- 전투, 레벨업, 퀘스트, 스토리가 자동으로 진행
|
||||
- **ASCII 아트 애니메이션** -- Canvas 기반 전투/탐험/마을 씬, 21개 종족별 캐릭터 프레임
|
||||
- **깊은 캐릭터 빌드** -- 21개 종족, 18개 직업, 68개 스킬, 11개 장비 슬롯
|
||||
- **로컬 아레나** -- 클리어한 캐릭터들끼리 1:1 전투, 장비 약탈
|
||||
- **오프라인 플레이** -- 게임 플레이는 네트워크 불필요, 광고/결제 시에만 네트워크 사용
|
||||
- **다국어 지원** -- 한국어, 영어, 일본어
|
||||
|
||||
## 게임 시스템
|
||||
|
||||
### 스탯
|
||||
| 스탯 | 효과 |
|
||||
|------|------|
|
||||
| STR | 물리 공격력, 쳐내기 |
|
||||
| CON | 방어력, 최대 HP, 방패 방어 |
|
||||
| DEX | 크리티컬, 회피, 명중, 공격 속도 |
|
||||
| INT | 마법 공격력, DoT 데미지, MP |
|
||||
| WIS | 마법 방어력, DoT 틱 간격, MP |
|
||||
| CHA | 상점 할인 (최대 15%), 희귀 아이템 드롭률 보정 |
|
||||
|
||||
### 장비 희귀도
|
||||
Common → Uncommon → Rare → Epic → Legendary (스탯 1.0x ~ 3.0x)
|
||||
|
||||
### 스킬 시스템
|
||||
68개 전투 스킬 (공격/회복/버프/디버프), 쿨타임 기반, 자동 선택 AI
|
||||
|
||||
### 수익화
|
||||
- AdMob 리워드/인터스티셜 광고
|
||||
- IAP 광고 제거 + 프리미엄 (영구 5배속, 되돌리기 3회, 보물 상자 10개, 오프라인 2배)
|
||||
|
||||
## 기술 스택
|
||||
|
||||
| 구분 | 기술 |
|
||||
|------|------|
|
||||
| 프레임워크 | Flutter 3.x / Dart 3.9+ |
|
||||
| 상태 관리 | ValueNotifier + Stream |
|
||||
| 코드 생성 | freezed + json_serializable |
|
||||
| DI | GetIt (서비스 로케이터) |
|
||||
| 광고 | google_mobile_ads 7.x |
|
||||
| 인앱결제 | in_app_purchase 3.x |
|
||||
| 보안 | flutter_secure_storage, HMAC-SHA256, RSA 서명 검증 |
|
||||
| 오디오 | just_audio (BGM 11곡, SFX 10종) |
|
||||
| 폰트 | JetBrainsMono (ASCII), PressStart2P (레트로 UI) |
|
||||
|
||||
## 빌드 및 실행
|
||||
|
||||
## Run
|
||||
```bash
|
||||
# 의존성 설치
|
||||
flutter pub get
|
||||
|
||||
# 코드 생성 (freezed/json_serializable)
|
||||
dart run build_runner build --delete-conflicting-outputs
|
||||
|
||||
# 실행 (-d macos, -d chrome, -d android 등)
|
||||
flutter run
|
||||
```
|
||||
|
||||
Use any supported platform (`-d macos`, `-d chrome`, etc.); multi-platform scaffolding is enabled.
|
||||
# 릴리즈 빌드 (난독화 포함)
|
||||
flutter build appbundle --obfuscate --split-debug-info=build/debug-info
|
||||
|
||||
## Checks
|
||||
Run from repo root before handoff:
|
||||
|
||||
```bash
|
||||
# 검증
|
||||
dart format --set-exit-if-changed .
|
||||
flutter analyze
|
||||
flutter test
|
||||
```
|
||||
|
||||
## 프로젝트 구조
|
||||
|
||||
```
|
||||
lib/
|
||||
├── main.dart # 앱 진입점 + 에러 핸들링
|
||||
├── data/ # 정적 게임 데이터 (종족, 직업, 스킬, 포션, 스토리)
|
||||
├── l10n/ # 앱 UI 다국어 리소스 (arb)
|
||||
└── src/
|
||||
├── app.dart # MaterialApp 설정
|
||||
├── core/
|
||||
│ ├── engine/ # 게임 루프, 전투, 보상, 스킬 등 30개 서비스
|
||||
│ ├── model/ # GameState, 장비, 스킬, 전투 등 데이터 모델
|
||||
│ ├── infrastructure/ # AdMob, IAP 외부 서비스
|
||||
│ ├── di/ # GetIt 서비스 로케이터 + 인터페이스
|
||||
│ ├── audio/ # BGM/SFX 오디오 서비스
|
||||
│ ├── storage/ # 세이브/설정/통계 저장소
|
||||
│ ├── logging/ # 로컬 에러 로거
|
||||
│ └── util/ # RNG, 밸런스 상수, 로직 헬퍼
|
||||
├── features/
|
||||
│ ├── front/ # 타이틀/세이브 선택
|
||||
│ ├── new_character/ # 캐릭터 생성
|
||||
│ ├── game/ # 메인 게임 (탭별 페이지 + 위젯)
|
||||
│ ├── arena/ # 아레나 PvP
|
||||
│ ├── hall_of_fame/ # 명예의 전당
|
||||
│ └── settings/ # 설정
|
||||
└── shared/ # 테마, 레트로 위젯, ASCII 애니메이션
|
||||
|
||||
test/ # 단위/위젯/회귀 테스트 (276개)
|
||||
analysis/ # 프로젝트 감사/시장 분석 리포트
|
||||
```
|
||||
|
||||
아키텍처 상세는 [ARCHITECTURE.md](ARCHITECTURE.md) 참조.
|
||||
|
||||
## 릴리즈 이력
|
||||
|
||||
| 버전 | 날짜 | 주요 내용 |
|
||||
|------|------|-----------|
|
||||
| 1.1.0 | 2026-03-30 | IAP RSA 검증, HMAC 세이브, CI, 아키텍처 개선, 테스트 276개 |
|
||||
| 1.0.1 | 2026-03-19 | 초기 릴리즈 (Google Play 내부 테스트) |
|
||||
|
||||
전체 변경 이력은 [CHANGELOG.md](CHANGELOG.md) 참조.
|
||||
|
||||
## 라이선스
|
||||
|
||||
비공개 프로젝트. 무단 배포 금지.
|
||||
|
||||
폰트 라이선스: JetBrains Mono (SIL OFL 1.1), Press Start 2P (SIL OFL 1.1).
|
||||
|
||||
97
analysis/fix-plan-2026-03-27.md
Normal file
97
analysis/fix-plan-2026-03-27.md
Normal file
@@ -0,0 +1,97 @@
|
||||
# Askii Never Die — 수정 계획 (Fix Plan)
|
||||
|
||||
> 작성일: 2026-03-27
|
||||
> Claude-Gemini Cross-Debate 합의 완료
|
||||
> 기준: full-audit-2026-03-27.md (Health Score: 49/100)
|
||||
|
||||
---
|
||||
|
||||
## 합의된 조정 사항
|
||||
|
||||
| 항목 | Claude 초안 | Gemini 의견 | 합의 |
|
||||
|------|------------|------------|------|
|
||||
| Crashlytics 배치 | Phase 4 | Phase 1 전진 | **Phase 4 유지** (오프라인 정책 충돌, 로컬 로그 대안) |
|
||||
| IAP 검증 | 로컬 RSA + Secure Storage | 서버 검증 권고 | **로컬 RSA + Secure Storage** (서버 인프라 없음) |
|
||||
| Force Update | 미포함 | 추가 권고 | **미포함** (오프라인 앱에서 구현 불가) |
|
||||
| Code Obfuscation | 미포함 | 추가 권고 | **Phase 1에 추가** (빌드 설정 확인) |
|
||||
| 공수 | P1:2-3일, P3:1-2주 | P1:4-5일, P3:2-3주 | **P1:5일, P3:3주** |
|
||||
|
||||
---
|
||||
|
||||
## Phase 1: 보안 강화 + DevOps 기반 (5일)
|
||||
|
||||
| # | 작업 | 근거 | 검증 방법 |
|
||||
|---|------|------|-----------|
|
||||
| 1-1 | CI 파이프라인 구축 | DevOps 2/10 → 6/10 | push 시 format+analyze+test 자동 실행 |
|
||||
| 1-2 | 폰트 라이선스 파일 추가 | Supply Chain: OFL 의무 | assets/fonts/에 LICENSE 존재 |
|
||||
| 1-3 | IAP 로컬 영수증 RSA 검증 | Security: Lucky Patcher 방어 | 검증 실패 시 구매 거부 테스트 |
|
||||
| 1-4 | 구매 상태 flutter_secure_storage 전환 | Security: 평문 저장 제거 | 기존 SharedPreferences 마이그레이션 테스트 |
|
||||
| 1-5 | 세이브 파일 HMAC 체크섬 | Security: 변조 감지 | 변조 세이브 로드 거부 테스트 |
|
||||
| 1-6 | 난독화 설정 확인/적용 | Security: APK 디컴파일 방어 | --obfuscate + --split-debug-info 빌드 성공 |
|
||||
| 1-7 | 중복 파일 제거 | Code Quality: 100% 중복 | features/arena/widgets/ascii_disintegrate_widget.dart 삭제 |
|
||||
| 1-8 | cupertino_icons 제거 | Supply Chain: 미사용 ~280KB | pubspec.yaml에서 삭제 + flutter pub get |
|
||||
|
||||
---
|
||||
|
||||
## Phase 2: 수익 보호 + 버전 업데이트 (5일)
|
||||
|
||||
| # | 작업 | 근거 | 검증 방법 |
|
||||
|---|------|------|-----------|
|
||||
| 2-1 | AdMob 미디에이션 (AppLovin MAX) | Idea Alignment: 수익 보호 | AdMob 비활성 시 백업 네트워크 로드 |
|
||||
| 2-2 | google_mobile_ads 5.3→7.x | Supply Chain: iOS Privacy Manifest | App Store 심사 통과 |
|
||||
| 2-3 | freezed 2.x→3.x + build_runner 업데이트 | Supply Chain: 중단된 전이 의존성 | dart run build_runner build 성공 |
|
||||
| 2-4 | CHANGELOG + 버전 태그 체계 | DevOps: 릴리즈 이력 | git tag 존재 |
|
||||
| 2-5 | flutter_lints 5→6 업데이트 | Code Quality: 최신 lint | flutter analyze 통과 |
|
||||
|
||||
---
|
||||
|
||||
## Phase 3: 아키텍처 개선 (3주, 점진적)
|
||||
|
||||
| # | 작업 | 근거 | 검증 방법 |
|
||||
|---|------|------|-----------|
|
||||
| 3-1 | 핵심 서비스 인터페이스 정의 | Architecture: 인터페이스 0개 | abstract class 6개 이상 |
|
||||
| 3-2 | DI 컨테이너 (GetIt) 도입 | Architecture: 싱글톤 6개 제거 | 싱글톤 0개, GetIt 등록 |
|
||||
| 3-3 | ad/iap_service → core/infrastructure/ 이동 | Architecture: 엔진 프레임워크 오염 | core/engine/에 Flutter import 0개 |
|
||||
| 3-4 | setState → ValueNotifier 세분화 | Performance: 50ms 전체 리빌드 | 프레임 드롭 측정 (before/after) |
|
||||
| 3-5 | God Widget 분할 (arena_battle_screen) | Code Quality: 759 LOC | 400 LOC 이하 |
|
||||
| 3-6 | progress_service.dart 분할 | Code Quality: 832 LOC | 각 서비스 200 LOC 이하 |
|
||||
| 3-7 | 저장 시스템 테스트 작성 | Test Coverage: 0% | save/load/delete 라운드트립 테스트 |
|
||||
| 3-8 | Model 직렬화 라운드트립 테스트 | Test Coverage: 0% | toJson→fromJson 동일성 검증 |
|
||||
|
||||
---
|
||||
|
||||
## Phase 4: 콘텐츠/성장 (2주+)
|
||||
|
||||
| # | 작업 | 근거 | 검증 방법 |
|
||||
|---|------|------|-----------|
|
||||
| 4-1 | Analytics 연동 (Firebase/PostHog) | Idea Alignment: DAU/리텐션 | 이벤트 로깅 확인 |
|
||||
| 4-2 | 크래시 리포팅 (로컬 로그 또는 Crashlytics) | DevOps: 크래시 추적 | 에러 발생 시 로그 저장 |
|
||||
| 4-3 | 피벗 후 시장 재분석 | Idea Alignment: 22/100 | idea-market-intel 리포트 |
|
||||
| 4-4 | README 전면 재작성 | Docs Sync: 극빈약 | 6개 화면, 수익화, 다국어 반영 |
|
||||
| 4-5 | ARCHITECTURE.md 작성 | Docs Sync: 없음 | 계층 구조, 데이터 흐름 문서화 |
|
||||
|
||||
---
|
||||
|
||||
## 예상 점수 변화
|
||||
|
||||
| Phase 완료 | Architecture | Code Quality | Security | Performance | Test | Supply Chain | Docs | DevOps | 예상 총점 |
|
||||
|-----------|:-----------:|:-----------:|:--------:|:-----------:|:----:|:-----------:|:----:|:------:|:---------:|
|
||||
| 현재 (0%) | 5 | 6 | 5 | 7 | 5 | 6 | 5 | 2 | **49** |
|
||||
| Phase 1 | 5 | 6.5 | 7.5 | 7 | 5.5 | 7 | 5 | 5 | **59** |
|
||||
| Phase 2 | 5 | 7 | 7.5 | 7 | 5.5 | 8 | 5.5 | 6 | **64** |
|
||||
| Phase 3 | 8 | 8 | 7.5 | 8 | 7 | 8 | 6 | 6 | **76** |
|
||||
| Phase 4 | 8 | 8 | 7.5 | 8 | 7 | 8 | 8 | 7 | **80+** |
|
||||
|
||||
---
|
||||
|
||||
## 제외된 항목
|
||||
|
||||
| 항목 | 제외 사유 |
|
||||
|------|----------|
|
||||
| Force Update | 오프라인 앱에서 네트워크 기반 버전 체크 불가 |
|
||||
| IAP 서버 검증 | 서버 인프라 없음. 로컬 RSA 검증으로 대체 |
|
||||
| Crashlytics Phase 1 | 오프라인 정책 충돌. Phase 4에서 로컬 로그 대안 검토 |
|
||||
|
||||
---
|
||||
|
||||
*Claude-Gemini Cross-Debate 합의 완료 (2026-03-27)*
|
||||
226
analysis/full-audit-2026-03-27.md
Normal file
226
analysis/full-audit-2026-03-27.md
Normal file
@@ -0,0 +1,226 @@
|
||||
# Askii Never Die - Full Project Audit Report
|
||||
|
||||
**분석일**: 2026-03-27
|
||||
**분석 도구**: 9개 개발 리뷰 에이전트 (Claude-Gemini 교차 토론 적용)
|
||||
**프로젝트**: Askii Never Die (오프라인 방치형 Idle RPG, Flutter)
|
||||
**규모**: 61,000 LOC / 224개 Dart 파일 / 247개 테스트 (전부 통과)
|
||||
|
||||
---
|
||||
|
||||
## Project Health Score: 49 / 100
|
||||
|
||||
| # | 영역 | 점수 | 가중치 | 가중 점수 | 핵심 이슈 |
|
||||
|---|------|:----:|:------:|:---------:|-----------|
|
||||
| 1 | Architecture | 5/10 | 15% | 7.5 | 인터페이스 0개, DI 부재, 싱글톤 6개, 엔진에 프레임워크 직접 의존 |
|
||||
| 2 | Code Quality | 6/10 | 15% | 9.0 | 200 LOC 초과 47.6%, God Widget 2개, 100% 중복 파일 1쌍 |
|
||||
| 3 | Security | 5/10 | 15% | 7.5 | IAP 로컬 영수증 검증 미구현, 세이브 무결성 없음, 구매 상태 평문 저장 |
|
||||
| 4 | Performance | 7/10 | 10% | 7.0 | 매 50ms setState 전체 리빌드, 서비스 객체 반복 생성, SFX 캐싱 부재 |
|
||||
| 5 | Test Coverage | 5/10 | 10% | 5.0 | 파일 커버리지 10%, 저장/전투틱/Model 직렬화 테스트 전무 |
|
||||
| 6 | Supply Chain | 6/10 | 10% | 6.0 | 폰트 라이선스 미포함, google_mobile_ads 2 메이저 뒤처짐 |
|
||||
| 7 | Docs Sync | 5/10 | 5% | 2.5 | CLAUDE.md에 존재하지 않는 디렉토리 3개, README 극빈약 |
|
||||
| 8 | DevOps | 2/10 | 10% | 2.0 | CI/CD 완전 부재, 릴리즈 프로세스 미정립 |
|
||||
| 9 | Idea Alignment | 22/100 | 10% | 2.2 | 완전 피벗 (RPS 격투 -> Idle RPG), 피벗 후 시장 재분석 없음 |
|
||||
| | **합계** | | **100%** | **48.7** | |
|
||||
|
||||
> **점수 해석**: 49점대는 "동작하는 프로토타입~알파" 수준. 제품으로서 기능하지만 프로덕션 배포에 필요한 품질/운영 기반이 미비.
|
||||
|
||||
> **참고**: Keystore Git 노출은 개인 Git 서버에서 사용자가 허가한 사항이므로 이슈에서 제외. IAP는 서버가 없는 구조이므로 로컬 검증 강화 방안으로 조정.
|
||||
|
||||
---
|
||||
|
||||
## CRITICAL Issues (즉시 조치 필요)
|
||||
|
||||
### 1. CI/CD 파이프라인 완전 부재 [DevOps]
|
||||
- **영향**: 빌드/테스트/린트 모두 수동. 깨진 코드 push 가능
|
||||
- **조치**: Gitea Actions 또는 GitHub Actions로 `dart format` + `flutter analyze` + `flutter test` 자동화
|
||||
- **예상 공수**: 반나절
|
||||
|
||||
### 2. AdMob 미디에이션 미구현 [Idea Alignment + Security]
|
||||
- **영향**: AdMob 계정 정지 = 수익 즉시 소멸 (인디 개발자 가장 흔한 수익 소멸 시나리오)
|
||||
- **조치**: AppLovin MAX 또는 IronSource 연동
|
||||
- **예상 공수**: 2-3일
|
||||
|
||||
---
|
||||
|
||||
## HIGH Issues (단기 조치)
|
||||
|
||||
### 3. IAP 로컬 영수증 서명 검증 미구현 [Security]
|
||||
- **파일**: `lib/src/core/engine/iap_service.dart:332-336`
|
||||
- **영향**: 서버 없이도 로컬 서명 검증으로 캐주얼 크래킹(Lucky Patcher 등) 방어 가능
|
||||
- **조치**:
|
||||
- **Google Play**: `purchase.verificationData.localVerificationData`에서 서명된 JSON 추출 -> Google Play Console의 공개 키(Base64 RSA)로 `RSASSA-PKCS1-v1_5 + SHA1` 서명 검증. `pointycastle` 패키지 활용
|
||||
- **Apple**: StoreKit 2의 JWS(JSON Web Signature) 토큰을 로컬에서 Apple 루트 인증서로 검증
|
||||
- **구매 상태 저장**: `shared_preferences` -> `flutter_secure_storage` (Android Keystore / iOS Keychain)
|
||||
- **공수**: 1-2일
|
||||
- **한계**: 루팅+후킹 조합 공격은 로컬 검증으로 완전 차단 불가. 그러나 90%+ 캐주얼 크래킹 방어 가능
|
||||
|
||||
### 4. 구매 상태 평문 저장 [Security]
|
||||
- **파일**: `iap_service.dart:65-66`, `monetization_state.dart:17-45`
|
||||
- **조치**: shared_preferences -> flutter_secure_storage 전환 (3번 작업과 동시 진행)
|
||||
- **공수**: 반나절
|
||||
|
||||
### 5. 세이브 파일 무결성 없음 [Security]
|
||||
- **파일**: `save_service.dart:17-20`
|
||||
- **조치**: HMAC-SHA256 체크섬 추가. 키는 앱 번들에 난독화 포함
|
||||
- **공수**: 반나절
|
||||
|
||||
### 6. Analytics 부재 [Idea Alignment]
|
||||
- **영향**: DAU, 리텐션, 광고 시청률, IAP 전환율 측정 불가
|
||||
- **조치**: Firebase Analytics 또는 PostHog 연동
|
||||
- **공수**: 1일
|
||||
|
||||
### 7. 인터페이스 0개 + DI 부재 [Architecture]
|
||||
- **영향**: 테스트 격리 불가, 싱글톤 6개로 모킹 원천 봉쇄
|
||||
- **조치**: GetIt 또는 생성자 주입 도입, 핵심 서비스 abstract class 정의
|
||||
- **공수**: 3-5일 (점진적)
|
||||
|
||||
### 8. 매 50ms 전체 위젯 setState [Performance]
|
||||
- **파일**: `game_play_screen.dart:352-368`
|
||||
- **영향**: 모바일 프레임 드롭 원인 1순위
|
||||
- **조치**: ValueNotifier/Selector로 세분화된 상태 관리
|
||||
- **공수**: 1-2일
|
||||
|
||||
### 9. 저장 시스템 테스트 전무 [Test Coverage]
|
||||
- **파일**: `save_repository.dart`, `save_service.dart`, `save_manager.dart` (6개 파일 모두)
|
||||
- **영향**: 세이브 파일 손상 시 플레이어 데이터 영구 손실
|
||||
- **조치**: IOOverrides/임시 디렉토리 기반 저장/로드/삭제 테스트 작성
|
||||
- **공수**: 1일
|
||||
|
||||
---
|
||||
|
||||
## MEDIUM Issues (중기 개선)
|
||||
|
||||
### 10. 폰트 라이선스 파일 미포함 [Supply Chain]
|
||||
- JetBrainsMono (OFL), PressStart2P (OFL) LICENSE 파일 `assets/fonts/`에 추가 필수
|
||||
|
||||
### 11. google_mobile_ads 5.3.0 -> 7.0.0 업그레이드 [Supply Chain]
|
||||
- iOS Privacy Manifest 미대응으로 App Store 심사 거절 리스크
|
||||
|
||||
### 12. God Widget 2개 분할 [Code Quality]
|
||||
- `game_play_screen.dart` (736 LOC), `arena_battle_screen.dart` (759 LOC)
|
||||
|
||||
### 13. progress_service.dart 832 LOC 분할 [Code Quality]
|
||||
- Quest/Plot/Exp/Combat 서비스로 분리
|
||||
|
||||
### 14. 100% 중복 파일 제거 [Code Quality]
|
||||
- `features/arena/widgets/ascii_disintegrate_widget.dart` 삭제 (shared/ 버전 사용)
|
||||
|
||||
### 15. CLAUDE.md 디렉토리 구조 수정 [Docs Sync]
|
||||
- `core/animation/` -> `shared/animation/`, `core/constants/` 삭제, `core/l10n/` -> `shared/l10n/`
|
||||
|
||||
### 16. README 전면 재작성 [Docs Sync]
|
||||
- 현재 프로젝트 초기 임시 메모 수준. 6개 화면, 수익화, 다국어 지원 등 전혀 반영 안 됨
|
||||
|
||||
### 17. 크래시 리포팅 도입 [DevOps]
|
||||
- Firebase Crashlytics 또는 Sentry
|
||||
|
||||
### 18. 엔진 계층 프레임워크 오염 제거 [Architecture]
|
||||
- `ad_service.dart`, `iap_service.dart` 등을 `core/infrastructure/`로 이동
|
||||
|
||||
### 19. 피벗 후 시장 재분석 [Idea Alignment]
|
||||
- "오프라인 Idle RPG + ASCII 아트" 시장 분석이 전무. idea-market-intel 재실행 필요
|
||||
|
||||
---
|
||||
|
||||
## LOW Issues (장기)
|
||||
|
||||
- cupertino_icons 미사용 제거 (~280KB 절약)
|
||||
- SFX 에셋 프리로드 및 캐싱
|
||||
- 모바일 포그라운드 복귀 시 전체 화면 재생성 최적화
|
||||
- gcd_simulation_test/balance_analysis_test를 실제 assert 포함 테스트로 전환
|
||||
- analysis_options.yaml lint rule 추가 (prefer_const_constructors, prefer_final_locals 등)
|
||||
- CHANGELOG에 실제 릴리즈 이력 기록
|
||||
- Model 직렬화 라운드트립 테스트 작성
|
||||
|
||||
---
|
||||
|
||||
## Fix Plan (Eisenhower Matrix)
|
||||
|
||||
```
|
||||
긴급 (Urgent) 비긴급 (Not Urgent)
|
||||
┌──────────────────────────┬──────────────────────────┐
|
||||
중요 │ DO FIRST (즉시) │ SCHEDULE (계획) │
|
||||
(Important) │ │ │
|
||||
│ 1. CI/CD 구축 │ 7. 인터페이스+DI 도입 │
|
||||
│ 2. AdMob 미디에이션 │ 12. God Widget 분할 │
|
||||
│ 3. IAP 로컬 서명 검증 │ 13. progress_service 분할│
|
||||
│ 4. 구매 상태 보안 저장 │ 18. 엔진 프레임워크 분리 │
|
||||
│ 5. 세이브 무결성 추가 │ 19. 피벗 후 시장 재분석 │
|
||||
│ 10. 폰트 라이선스 추가 │ 17. 크래시 리포팅 도입 │
|
||||
├──────────────────────────┼──────────────────────────┤
|
||||
덜 중요 │ DELEGATE (위임 가능) │ ELIMINATE (후순위) │
|
||||
(Less │ │ │
|
||||
Important) │ 6. Analytics 연동 │ 14. 중복 파일 제거 │
|
||||
│ 8. setState 세분화 │ 15. CLAUDE.md 수정 │
|
||||
│ 9. 저장 시스템 테스트 │ 16. README 재작성 │
|
||||
│ 11. google_mobile_ads 7.x│ + LOW 이슈 전체 │
|
||||
└──────────────────────────┴──────────────────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 실행 로드맵 (권장 순서)
|
||||
|
||||
### Phase 1: 보안 강화 + DevOps 기반 (2-3일)
|
||||
```
|
||||
1. CI 파이프라인 구축 (dart format + analyze + test) → verify: push 시 자동 실행
|
||||
2. 폰트 라이선스 파일 추가 → verify: assets/fonts/에 LICENSE.txt 존재
|
||||
3. IAP 로컬 영수증 서명 검증 구현 (Google Play 공개키 RSA 검증) → verify: 검증 실패 시 구매 거부 테스트
|
||||
4. 구매 상태 flutter_secure_storage 전환 → verify: 기존 테스트 통과
|
||||
5. 세이브 파일 HMAC 체크섬 추가 → verify: 변조된 세이브 로드 거부 테스트
|
||||
```
|
||||
|
||||
### Phase 2: 수익 보호 (3-5일)
|
||||
```
|
||||
1. AdMob 미디에이션 연동 (AppLovin MAX) → verify: AdMob 비활성 시 백업 네트워크 로드
|
||||
2. google_mobile_ads 7.x 마이그레이션 → verify: iOS Privacy Manifest 포함 확인
|
||||
3. CHANGELOG 정리 + 버전 태그 체계 수립 → verify: git tag 존재
|
||||
```
|
||||
|
||||
### Phase 3: 아키텍처 개선 (1-2주, 점진적)
|
||||
```
|
||||
1. 핵심 서비스 인터페이스 정의 (SaveRepository, AdService, IAPService)
|
||||
2. DI 컨테이너(GetIt) 도입
|
||||
3. ad_service, iap_service를 core/infrastructure/로 이동
|
||||
4. GamePlayScreen setState 세분화
|
||||
5. 저장 시스템 테스트 작성
|
||||
```
|
||||
|
||||
### Phase 4: 콘텐츠/성장 (2주+)
|
||||
```
|
||||
1. Firebase Analytics 연동
|
||||
2. Crashlytics 연동
|
||||
3. 피벗 후 시장 재분석 (idea-market-intel 실행)
|
||||
4. Web meta 태그 수정 + ASO 최적화
|
||||
5. README / CLAUDE.md / ARCHITECTURE.md 동기화
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 에이전트별 상세 리포트 참조
|
||||
|
||||
| 에이전트 | 점수 | 주요 발견 |
|
||||
|---------|:----:|----------|
|
||||
| Architecture | 5/10 | 인터페이스 0개, 싱글톤 6개, core/engine/ Flutter 오염 6파일, app.dart God Class 459 LOC |
|
||||
| Code Quality | 6/10 | dart format/analyze 통과, 200 LOC 초과 100개(47.6%), God Widget 2개, var 31회 남용 |
|
||||
| Security | 5/10 | IAP 로컬 서명 검증 미구현, 세이브 무결성 없음, 구매 상태 평문 저장 |
|
||||
| Supply Chain | 6/10 | CVE 0, GPL 0, 폰트 라이선스 미포함, google_mobile_ads 2메이저 뒤처짐 |
|
||||
| Performance | 7/10 | 50ms setState 전체 리빌드, 서비스 객체 매틱 재생성, SFX 캐싱 부재, RepaintBoundary 활용 양호 |
|
||||
| Test Coverage | 5/10 | 247개 테스트 전통과, 파일 커버리지 10%, 저장/전투틱/Model 직렬화 테스트 전무 |
|
||||
| Docs Sync | 5/10 | CLAUDE.md 존재하지 않는 경로 3개, README 극빈약, CHANGELOG 릴리즈 이력 없음 |
|
||||
| DevOps | 2/10 | CI/CD 완전 부재, 릴리즈 프로세스 미정립, Crashlytics 없음 |
|
||||
| Idea Alignment | 22/100 | 완전 피벗 (RPS -> Idle RPG), 수익화만 일치, 피벗 후 시장 재분석 없음, Analytics 부재 |
|
||||
|
||||
---
|
||||
|
||||
## 제외된 이슈
|
||||
|
||||
| 이슈 | 제외 사유 |
|
||||
|------|----------|
|
||||
| Keystore + 비밀번호 Git 노출 | 개인 Git 서버(Gitea)에서 사용자가 허가한 운영 방식 |
|
||||
| IAP 서버 측 영수증 검증 | 서버 없는 오프라인 앱 구조. 로컬 서명 검증으로 대체 권고 |
|
||||
|
||||
---
|
||||
|
||||
*이 보고서는 Claude-Gemini 교차 토론을 통해 합의된 결과입니다.*
|
||||
*9개 에이전트 병렬 실행, 총 분석 시간: ~6분*
|
||||
72
analysis/market-analysis-2026-03-30.md
Normal file
72
analysis/market-analysis-2026-03-30.md
Normal file
@@ -0,0 +1,72 @@
|
||||
# Askii Never Die — 시장 분석 (피벗 후)
|
||||
|
||||
> 분석일: 2026-03-30
|
||||
> 분석: Claude + Gemini 교차 토론
|
||||
|
||||
## 프로젝트 포지셔닝
|
||||
|
||||
**장르**: 오프라인 방치형 Idle RPG + ASCII 아트
|
||||
**원형**: 클래식 방치형 RPG
|
||||
**수익화**: AdMob 광고 + IAP 광고 제거 프리미엄 (₩9,900)
|
||||
**플랫폼**: Android (출시), iOS (예정)
|
||||
**다국어**: 한/영/일
|
||||
|
||||
---
|
||||
|
||||
## 1. 시장 규모 (TAM/SAM/SOM)
|
||||
|
||||
| 구분 | 규모 | 출처 |
|
||||
|------|------|------|
|
||||
| TAM | ~$907억 (글로벌 모바일 게임) | Newzoo 2024 Global Games Market Report |
|
||||
| SAM | ~$45억 (Idle/텍스트 시뮬레이션) | Sensor Tower State of Mobile Gaming 2024 |
|
||||
| SOM | $100만~$300만 (ASCII/레트로 팬층) | 추정 |
|
||||
|
||||
## 2. 경쟁작 분석
|
||||
|
||||
| 게임 | 특징 | 수익화 | 차별점 |
|
||||
|------|------|--------|--------|
|
||||
| Godville | Zero-player, 텍스트 RPG | 광고 + 소액결제 | 커뮤니티 강점 |
|
||||
| A Dark Room | 미니멀 텍스트 생존 RPG | 유료 앱 | 스토리텔링 |
|
||||
| Candy Box 2 | 순수 ASCII RPG | 무료 | 오픈소스 |
|
||||
| Home Quest | 텍스트 왕국 건설 | 광고제거 + 패키지 | 현대적 UI |
|
||||
|
||||
## 3. Askii Never Die 차별화
|
||||
|
||||
1. **순수 ASCII 비주얼** — 그래픽 피로도 제로
|
||||
2. **방치형 RPG 정통 계승** — Zero-player 철학의 모바일 최적화
|
||||
3. **완전 오프라인** — 데이터/서버 의존 없음
|
||||
4. **3개 국어** — 텍스트 게임에서 현지화가 핵심 경쟁력
|
||||
|
||||
## 4. 수익 예측 (보수적, 1년 기준)
|
||||
|
||||
| 항목 | DAU 1,000 기준 | DAU 5,000 기준 |
|
||||
|------|---------------|---------------|
|
||||
| AdMob 광고 | ~₩240만/년 | ~₩1,200만/년 |
|
||||
| IAP 전환 (10%) | ~₩990만/년 | ~₩4,950만/년 |
|
||||
| **합계** | **~₩1,230만/년** | **~₩6,150만/년** |
|
||||
|
||||
> eCPM $0.5 (보수적), 리워드 광고 1회/일 기준
|
||||
|
||||
## 5. 타겟 유저
|
||||
|
||||
- **코어**: 30-40대 남성, IT 종사자, MUD/방치형 RPG 경험자
|
||||
- **서브**: 디지털 디톡스 선호 미니멀리즘 게이머
|
||||
- **페르소나**: "업무 중 옆에 켜두어도 눈치 안 보이는 게임"
|
||||
|
||||
## 6. 성장 전략
|
||||
|
||||
1. **커뮤니티 바이럴**: Reddit r/incremental_games, DC인사이드, 5ch
|
||||
2. **ASO 키워드**: ASCII, MUD, 방치형 RPG, Text RPG, Idle RPG
|
||||
3. **크로스 플랫폼**: Android → iOS → Steam (PC)
|
||||
4. **유저 기여**: ASCII 아트/이벤트 모딩 시스템 (장기)
|
||||
|
||||
---
|
||||
|
||||
## 합의 요약
|
||||
|
||||
| 항목 | Claude | Gemini | 합의 |
|
||||
|------|--------|--------|------|
|
||||
| SOM | $100만~$300만 | $100만~$300만 | 합의 |
|
||||
| 1년 수익 (DAU 1k) | ~₩1,200만 | ~₩1,100만~₩1,300만 | ~₩1,200만 |
|
||||
| 핵심 차별화 | 오프라인 + ASCII | Zero-player 정통 | 합의 |
|
||||
| 최대 리스크 | 니치 시장 한계 | DAU 확보 난이도 | 합의 |
|
||||
175
analysis/supply-chain-review.md
Normal file
175
analysis/supply-chain-review.md
Normal file
@@ -0,0 +1,175 @@
|
||||
# asciineverdie Supply Chain Review
|
||||
|
||||
> 검토일: 2026-03-27
|
||||
> Flutter 3.35.3 / Dart 3.9.2
|
||||
> Claude-Gemini Cross-Debate 완료 (합의 도달)
|
||||
|
||||
## Supply Chain Score: 6 / 10
|
||||
|
||||
| 항목 | 점수 | 비고 |
|
||||
|------|------|------|
|
||||
| 보안 (CVE) | 8/10 | 알려진 CVE 없음 |
|
||||
| 라이선스 | 6/10 | GPL 오염 없음, 폰트 라이선스 파일 누락 |
|
||||
| 유지보수 건강도 | 5/10 | google_mobile_ads 2 메이저 뒤처짐, build_runner 전이 의존성 중단 |
|
||||
| 최신성 | 4/10 | 직접 의존성 7개 중 5개 메이저 버전 뒤처짐 |
|
||||
| 의존성 비대화 | 7/10 | 직접 11개, 프로덕션 전이 포함 ~62개 (합리적 수준) |
|
||||
|
||||
---
|
||||
|
||||
## 1. 취약점 (Vulnerabilities)
|
||||
|
||||
| 패키지 | 버전 | CVE | 심각도 | 수정 버전 |
|
||||
|--------|------|-----|--------|-----------|
|
||||
| (해당 없음) | - | - | - | - |
|
||||
|
||||
**결론:** OSV(Open Source Vulnerabilities) 데이터베이스 및 GitHub Advisory Database 기준, 현재 사용 중인 의존성 버전에서 알려진 CVE는 발견되지 않음.
|
||||
|
||||
다만 `google_mobile_ads` 5.x는 최신 iOS Privacy Manifest 및 UMP(User Messaging Platform) 요구사항을 완벽히 지원하지 않을 가능성이 있어, App Store 심사 거절 리스크 존재.
|
||||
|
||||
---
|
||||
|
||||
## 2. 라이선스 이슈
|
||||
|
||||
| 패키지/자산 | 라이선스 | 리스크 | 필요 조치 |
|
||||
|------------|---------|--------|-----------|
|
||||
| 모든 Dart 패키지 | BSD-3 / MIT / Apache-2.0 | 없음 | GPL 오염 없음 -- 상업적 사용 안전 |
|
||||
| JetBrainsMono (폰트) | OFL-1.1 (추정) | 중간 | 라이선스 파일 미포함. `assets/fonts/`에 OFL.txt 추가 필요 |
|
||||
| PressStart2P (폰트) | OFL-1.1 (추정) | 중간 | 라이선스 파일 미포함. `assets/fonts/`에 OFL.txt 추가 필요 |
|
||||
|
||||
**폰트 라이선스 상세:**
|
||||
- JetBrains Mono: JetBrains 배포, Apache 2.0 라이선스
|
||||
- Press Start 2P: Google Fonts 배포, OFL 라이선스
|
||||
- 두 폰트 모두 상업적 사용 가능하나, 라이선스 텍스트를 앱에 포함해야 하는 의무(attribution) 존재
|
||||
- 현재 `assets/fonts/` 디렉토리에 LICENSE 파일이 **전혀 없음**
|
||||
- App Store / Play Store 심사에서는 보통 문제되지 않으나, 법적 리스크는 존재
|
||||
|
||||
---
|
||||
|
||||
## 3. 유지보수 건강도
|
||||
|
||||
| 패키지 | 현재 버전 | 상태 | 리스크 |
|
||||
|--------|----------|------|--------|
|
||||
| cupertino_icons | 1.0.8 | 정상 유지보수 | 낮음 (단, 미사용) |
|
||||
| intl | 0.20.2 | Dart 팀 관리 | 없음 |
|
||||
| path_provider | 2.1.5 | Flutter 팀 관리 | 없음 |
|
||||
| shared_preferences | 2.5.3 | Flutter 팀 관리 | 없음 |
|
||||
| just_audio | 0.9.46 | 활발한 커뮤니티 (ryanheise) | 단일 메인테이너 리스크 |
|
||||
| freezed_annotation | 2.4.4 | 활발한 커뮤니티 (rrousselGit) | 단일 메인테이너 리스크 |
|
||||
| json_annotation | 4.9.0 | Google/Dart 팀 관리 | 없음 |
|
||||
| google_mobile_ads | 5.3.1 | Google 관리 | **v5.x 지원 종료 임박** |
|
||||
| in_app_purchase | 3.2.3 | Flutter 팀 관리 | 없음 |
|
||||
| package_info_plus | 8.3.1 | FlutterCommunity 관리 | 낮음 |
|
||||
| build_runner | 2.5.4 | Google/Dart 팀 관리 | **전이 의존성 중단됨** |
|
||||
|
||||
**중단된 전이 의존성 (Discontinued transitive deps):**
|
||||
- `build_resolvers` 2.5.4 -- 공식 중단 선언
|
||||
- `build_runner_core` 9.1.2 -- 공식 중단 선언
|
||||
- 이 패키지들의 기능은 최신 `build_runner`(2.10+)에 내재화됨
|
||||
- 즉각적인 빌드 실패를 일으키진 않으나, 향후 Dart SDK 업데이트 시 호환성 문제 발생 확실
|
||||
|
||||
---
|
||||
|
||||
## 4. 메이저 버전 뒤처짐 (Outdated - Major Behind)
|
||||
|
||||
### 직접 의존성 (Direct)
|
||||
|
||||
| 패키지 | 현재 | 최신 | 뒤처짐 | 비고 |
|
||||
|--------|------|------|--------|------|
|
||||
| google_mobile_ads | 5.3.1 | 7.0.0 | **2 메이저** | iOS Privacy Manifest, UMP 지원 필수 |
|
||||
| freezed_annotation | 2.4.4 | 3.1.0 | 1 메이저 | freezed 3.x와 짝 맞춰야 함 |
|
||||
| package_info_plus | 8.3.1 | 9.0.0 | 1 메이저 | |
|
||||
| just_audio | 0.9.46 | 0.10.5 | 1 마이너 (pre-1.0) | 0.x 시맨틱에서는 마이너 = 메이저 |
|
||||
| json_annotation | 4.9.0 | 4.11.0 | 2 마이너 | |
|
||||
|
||||
### 개발 의존성 (Dev)
|
||||
|
||||
| 패키지 | 현재 | 최신 | 뒤처짐 | 비고 |
|
||||
|--------|------|------|--------|------|
|
||||
| build_runner | 2.5.4 | 2.13.1 | 8 마이너 | 중단된 전이 의존성 해소 위해 업데이트 필요 |
|
||||
| freezed | 2.5.8 | 3.2.5 | **1 메이저** | freezed_annotation 3.x와 함께 업데이트 |
|
||||
| json_serializable | 6.9.5 | 6.13.1 | 4 마이너 | |
|
||||
| flutter_lints | 5.0.0 | 6.0.0 | 1 메이저 | |
|
||||
|
||||
---
|
||||
|
||||
## 5. 불필요한 의존성
|
||||
|
||||
| 패키지 | 사용 여부 | 판정 | 근거 |
|
||||
|--------|----------|------|------|
|
||||
| cupertino_icons | 미사용 | **제거 권장** | `lib/` 전체에서 `CupertinoIcons` import 0건. ~280KB 바이너리 낭비 |
|
||||
| json_annotation | 간접 사용 | 유지 | freezed_annotation이 re-export하지만, .g.dart 생성 파일이 직접 import함. 제거 시 빌드 깨질 수 있음 |
|
||||
|
||||
---
|
||||
|
||||
## 6. 의존성 트리 통계
|
||||
|
||||
| 항목 | 수치 |
|
||||
|------|------|
|
||||
| 직접 프로덕션 의존성 | 11개 (SDK 포함) |
|
||||
| 직접 개발 의존성 | 6개 (SDK 포함) |
|
||||
| 프로덕션 전이 포함 총 패키지 | ~62개 |
|
||||
| 개발 포함 총 패키지 (pubspec.lock) | 122개 |
|
||||
| 코드 생성 대상 파일 (.freezed.dart + .g.dart) | 8개 |
|
||||
|
||||
---
|
||||
|
||||
## 권장 조치 사항
|
||||
|
||||
### [CRITICAL] 즉시 조치
|
||||
|
||||
1. **폰트 라이선스 파일 추가**
|
||||
- `assets/fonts/JetBrainsMono-LICENSE.txt` (Apache 2.0)
|
||||
- `assets/fonts/PressStart2P-OFL.txt` (OFL 1.1)
|
||||
- 앱 내 오픈소스 라이선스 화면에 표시 필요
|
||||
- Google Fonts 및 JetBrains 공식 사이트에서 다운로드
|
||||
|
||||
2. **google_mobile_ads 7.x 업데이트 계획 수립**
|
||||
- iOS Privacy Manifest 대응 필수 (App Store 심사 거절 리스크)
|
||||
- v7.0.0 마이그레이션 가이드: https://developers.google.com/admob/flutter/migration
|
||||
|
||||
### [HIGH] 단기 조치 (1-2주)
|
||||
|
||||
3. **cupertino_icons 제거**
|
||||
```yaml
|
||||
# pubspec.yaml에서 삭제
|
||||
# cupertino_icons: ^1.0.8
|
||||
```
|
||||
|
||||
4. **build_runner 체인 업데이트**
|
||||
```bash
|
||||
flutter pub upgrade build_runner json_serializable
|
||||
```
|
||||
- 중단된 `build_resolvers`, `build_runner_core` 전이 의존성 해소
|
||||
- 빌드 성능 개선 기대
|
||||
|
||||
5. **freezed 2.x -> 3.x 마이그레이션**
|
||||
- freezed_annotation + freezed 동시에 메이저 업데이트
|
||||
- 코드 생성 파일 전체 재생성 필요: `dart run build_runner build --delete-conflicting-outputs`
|
||||
|
||||
### [MEDIUM] 중기 조치 (1개월)
|
||||
|
||||
6. **just_audio 0.10.x 업데이트**
|
||||
- Android 최신 버전 호환성 개선
|
||||
- 단일 메인테이너(ryanheise) 패키지이므로 대안(audioplayers) 검토도 병행
|
||||
|
||||
7. **package_info_plus 9.x 업데이트**
|
||||
|
||||
8. **flutter_lints 6.x 업데이트**
|
||||
- 최신 lint 규칙 적용으로 코드 품질 향상
|
||||
|
||||
### [LOW] 장기 고려
|
||||
|
||||
9. **win32 전이 의존성** -- package_info_plus가 Windows 지원에 사용. 모바일 전용이면 무시 가능
|
||||
|
||||
---
|
||||
|
||||
## Claude-Gemini Cross-Debate 결과
|
||||
|
||||
| 항목 | Claude 의견 | Gemini 초기 의견 | 합의 |
|
||||
|------|------------|-----------------|------|
|
||||
| 종합 점수 | 6/10 | 3.5/10 | **6/10** (Gemini 수정 동의) |
|
||||
| CVE-2023-48220 | 해당 없음 (Nextcloud 취약점) | package_info_plus 관련 주장 | **해당 없음** (Gemini 철회) |
|
||||
| json_annotation 제거 | 위험 (빌드 깨짐 가능) | 제거 권장 | **유지** (Gemini 수정 동의) |
|
||||
| build_runner 긴급도 | 중기 과제 (당장은 동작) | 즉시 수술 필요 | **단기 과제** (절충) |
|
||||
| 보안 리스크 수준 | Low | Medium-High | **Low** (Gemini 수정 동의) |
|
||||
| 폰트 라이선스 | 중간 리스크 | 중간 리스크 | **합의** |
|
||||
@@ -14,6 +14,9 @@ analyzer:
|
||||
strict-casts: true
|
||||
strict-inference: true
|
||||
strict-raw-types: true
|
||||
exclude:
|
||||
- "**/*.freezed.dart"
|
||||
- "**/*.g.dart"
|
||||
|
||||
linter:
|
||||
# Keep the rule set lean; we will tighten as the engine port stabilizes.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import java.util.Properties
|
||||
import java.io.FileInputStream
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
@@ -5,8 +8,15 @@ plugins {
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
// key.properties 파일 로드
|
||||
val keystorePropertiesFile = rootProject.file("key.properties")
|
||||
val keystoreProperties = Properties()
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.asciineverdie"
|
||||
namespace = "com.naturebridgeai.asciineverdie"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
@@ -20,21 +30,31 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "com.example.asciineverdie"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
applicationId = "com.naturebridgeai.asciineverdie"
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
keyAlias = keystoreProperties["keyAlias"] as String?
|
||||
keyPassword = keystoreProperties["keyPassword"] as String?
|
||||
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
|
||||
storePassword = keystoreProperties["storePassword"] as String?
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
34
android/app/proguard-rules.pro
vendored
Normal file
34
android/app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
# Flutter 기본 규칙
|
||||
-keep class io.flutter.app.** { *; }
|
||||
-keep class io.flutter.plugin.** { *; }
|
||||
-keep class io.flutter.util.** { *; }
|
||||
-keep class io.flutter.view.** { *; }
|
||||
-keep class io.flutter.** { *; }
|
||||
-keep class io.flutter.plugins.** { *; }
|
||||
|
||||
# Google Mobile Ads (AdMob)
|
||||
-keep class com.google.android.gms.ads.** { *; }
|
||||
-keep class com.google.ads.** { *; }
|
||||
|
||||
# In-App Purchase (Google Play Billing)
|
||||
-keep class com.android.vending.billing.** { *; }
|
||||
|
||||
# Kotlin 직렬화(serialization) 관련
|
||||
-keepattributes *Annotation*
|
||||
-keepattributes InnerClasses
|
||||
|
||||
# 제네릭(generics) 시그니처 유지
|
||||
-keepattributes Signature
|
||||
|
||||
# Play Core (deferred components) 경고 억제
|
||||
-dontwarn com.google.android.play.core.splitcompat.SplitCompatApplication
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallException
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallManager
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallManagerFactory
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallRequest$Builder
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallRequest
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallSessionState
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener
|
||||
-dontwarn com.google.android.play.core.tasks.OnFailureListener
|
||||
-dontwarn com.google.android.play.core.tasks.OnSuccessListener
|
||||
-dontwarn com.google.android.play.core.tasks.Task
|
||||
@@ -1,6 +1,11 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- AdMob 광고 로드에 필요 -->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<!-- IAP 결제(billing) 권한 -->
|
||||
<uses-permission android:name="com.android.vending.BILLING" />
|
||||
|
||||
<application
|
||||
android:label="asciineverdie"
|
||||
android:label="ASCII Never Die"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<!-- Copyright Protection -->
|
||||
@@ -29,6 +34,10 @@
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- AdMob App ID -->
|
||||
<meta-data
|
||||
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
||||
android:value="ca-app-pub-6691216385521068~8216990571"/>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.asciineverdie
|
||||
package com.naturebridgeai.asciineverdie
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
4
android/key.properties
Normal file
4
android/key.properties
Normal file
@@ -0,0 +1,4 @@
|
||||
storePassword=askiineverdie
|
||||
keyPassword=askiineverdie
|
||||
keyAlias=askiineverdie
|
||||
storeFile=../../doc/key/askiineverdie.jks
|
||||
93
assets/fonts/JetBrainsMono-LICENSE.txt
Normal file
93
assets/fonts/JetBrainsMono-LICENSE.txt
Normal file
@@ -0,0 +1,93 @@
|
||||
Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://openfontlicense.org
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
93
assets/fonts/PressStart2P-LICENSE.txt
Normal file
93
assets/fonts/PressStart2P-LICENSE.txt
Normal file
@@ -0,0 +1,93 @@
|
||||
Copyright 2012 The Press Start 2P Project Authors (cody@zone38.net), with Reserved Font Name "Press Start 2P".
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://openfontlicense.org
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
BIN
assets/icon/AsciiNeverDieIcon512.png
Normal file
BIN
assets/icon/AsciiNeverDieIcon512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 244 KiB |
206
doc/and-privacy.txt
Normal file
206
doc/and-privacy.txt
Normal file
@@ -0,0 +1,206 @@
|
||||
ASCII Never Die 개인정보 처리방침 / Privacy Policy
|
||||
|
||||
================================================================================
|
||||
|
||||
한국어 (Korean)
|
||||
|
||||
시행일자: 2026년 1월 30일
|
||||
|
||||
본 개인정보 처리방침은 ASCII Never Die 앱(이하 "앱")의 개인정보 수집, 이용, 보관 및 보호에 관한 사항을 안내합니다.
|
||||
|
||||
1. 수집하는 개인정보
|
||||
|
||||
본 앱은 회원가입, 로그인 기능이 없습니다. 이름, 이메일, 전화번호 등의 개인 식별정보를 직접 수집하지 않습니다.
|
||||
|
||||
사용자가 입력하는 캐릭터 이름, 게임 진행 데이터(레벨, 장비, 퀘스트 등)는 기기 내에만 저장됩니다.
|
||||
|
||||
2. 데이터 저장 및 처리 방식
|
||||
|
||||
- 모든 게임 데이터는 로컬 저장소(기기 내 저장소)에만 보관됩니다.
|
||||
- 클라우드나 외부 서버로 자동 전송되지 않습니다.
|
||||
- 앱 삭제 시 저장된 모든 데이터가 함께 제거됩니다.
|
||||
|
||||
3. 광고 및 제3자 서비스
|
||||
|
||||
본 앱은 Google AdMob 광고 네트워크를 사용합니다. 광고 서비스 제공을 위해 다음 정보가 수집될 수 있습니다:
|
||||
|
||||
- 광고 식별자(Advertising ID)
|
||||
- 기기 정보(모델, OS 버전 등)
|
||||
- 대략적인 위치 정보
|
||||
- 앱 사용 정보
|
||||
|
||||
이러한 정보는 Google의 개인정보 처리방침에 따라 처리됩니다.
|
||||
- Google 개인정보 처리방침: https://policies.google.com/privacy
|
||||
|
||||
4. 인앱 결제
|
||||
|
||||
본 앱은 광고 제거 등의 기능을 위해 인앱 결제를 제공합니다. 결제 처리는 각 플랫폼(Google Play, Apple App Store)에서 직접 처리하며, 개발사는 결제 정보(카드 번호, 계좌 정보 등)를 수집하거나 저장하지 않습니다.
|
||||
|
||||
- Google Play 개인정보 처리방침: https://policies.google.com/privacy
|
||||
- Apple 개인정보 처리방침: https://www.apple.com/legal/privacy/
|
||||
|
||||
5. 권한 사용
|
||||
|
||||
권한 용도
|
||||
--------------- ---------------------------------
|
||||
네트워크 접근 광고 표시 및 인앱 결제 처리
|
||||
저장소 접근 게임 데이터 저장
|
||||
|
||||
요청된 권한은 해당 용도 외에는 사용되지 않습니다.
|
||||
|
||||
6. 아동의 개인정보
|
||||
|
||||
본 앱은 일반 사용자를 대상으로 설계되었으며, 만 14세 미만의 아동을 대상으로 개인정보를 수집하지 않습니다.
|
||||
|
||||
7. 개인정보의 보호
|
||||
|
||||
- 모든 게임 데이터는 기기 내부에만 저장
|
||||
- 외부 서버로의 개인정보 전송 없음
|
||||
- 최소한의 필수 권한만 요청
|
||||
|
||||
8. 처리방침의 변경
|
||||
|
||||
본 개인정보 처리방침이 변경되는 경우, 앱 내 공지 또는 앱 스토어 설명을 통해 안내합니다.
|
||||
|
||||
9. 문의처
|
||||
|
||||
이메일: naturebridgeai@gmail.com
|
||||
담당자: NatureBridgeAI 앱개발팀
|
||||
|
||||
================================================================================
|
||||
|
||||
English
|
||||
|
||||
Effective Date: January 30, 2026
|
||||
|
||||
This Privacy Policy describes how ASCII Never Die (the "App") collects, uses, stores, and protects your information.
|
||||
|
||||
1. Information We Collect
|
||||
|
||||
This App does not require account registration or login. We do not directly collect personal identifying information such as your name, email address, or phone number.
|
||||
|
||||
Character names and game progress data (level, equipment, quests, etc.) that you enter are stored only on your device.
|
||||
|
||||
2. Data Storage and Processing
|
||||
|
||||
- All game data is stored locally on your device only.
|
||||
- No data is automatically transmitted to cloud services or external servers.
|
||||
- All stored data is deleted when you uninstall the App.
|
||||
|
||||
3. Advertising and Third-Party Services
|
||||
|
||||
This App uses the Google AdMob advertising network. The following information may be collected for advertising purposes:
|
||||
|
||||
- Advertising ID
|
||||
- Device information (model, OS version, etc.)
|
||||
- Approximate location information
|
||||
- App usage information
|
||||
|
||||
This information is processed in accordance with Google's Privacy Policy.
|
||||
- Google Privacy Policy: https://policies.google.com/privacy
|
||||
|
||||
4. In-App Purchases
|
||||
|
||||
This App offers in-app purchases for features such as ad removal. Payment processing is handled directly by each platform (Google Play, Apple App Store). We do not collect or store any payment information (credit card numbers, account details, etc.).
|
||||
|
||||
- Google Play Privacy Policy: https://policies.google.com/privacy
|
||||
- Apple Privacy Policy: https://www.apple.com/legal/privacy/
|
||||
|
||||
5. Permissions
|
||||
|
||||
Permission Purpose
|
||||
--------------- ----------------------------------------------
|
||||
Network Access Display advertisements and process in-app purchases
|
||||
Storage Access Save game data
|
||||
|
||||
Requested permissions are not used for any purposes other than those stated above.
|
||||
|
||||
6. Children's Privacy
|
||||
|
||||
This App is designed for general users and does not knowingly collect personal information from children under 14 years of age.
|
||||
|
||||
7. Data Protection
|
||||
|
||||
- All game data is stored only on your device
|
||||
- No personal information is transmitted to external servers
|
||||
- Only essential permissions are requested
|
||||
|
||||
8. Changes to This Privacy Policy
|
||||
|
||||
If this Privacy Policy is modified, we will notify you through in-app announcements or app store descriptions.
|
||||
|
||||
9. Contact Us
|
||||
|
||||
Email: naturebridgeai@gmail.com
|
||||
Contact: NatureBridgeAI App Development Team
|
||||
|
||||
================================================================================
|
||||
|
||||
日本語 (Japanese)
|
||||
|
||||
施行日:2026年1月30日
|
||||
|
||||
本プライバシーポリシーは、ASCII Never Dieアプリ(以下「本アプリ」)における個人情報の収集、利用、保管、保護について説明します。
|
||||
|
||||
1. 収集する個人情報
|
||||
|
||||
本アプリは会員登録・ログイン機能がありません。氏名、メールアドレス、電話番号などの個人識別情報を直接収集することはありません。
|
||||
|
||||
ユーザーが入力するキャラクター名、ゲーム進行データ(レベル、装備、クエストなど)は端末内にのみ保存されます。
|
||||
|
||||
2. データの保存と処理方法
|
||||
|
||||
- すべてのゲームデータはローカルストレージ(端末内)にのみ保管されます。
|
||||
- クラウドや外部サーバーへ自動送信されることはありません。
|
||||
- アプリを削除すると、保存されたすべてのデータも削除されます。
|
||||
|
||||
3. 広告および第三者サービス
|
||||
|
||||
本アプリはGoogle AdMob広告ネットワークを使用しています。広告サービス提供のため、以下の情報が収集される場合があります:
|
||||
|
||||
- 広告識別子(Advertising ID)
|
||||
- 端末情報(機種、OSバージョンなど)
|
||||
- おおよその位置情報
|
||||
- アプリ使用情報
|
||||
|
||||
これらの情報はGoogleのプライバシーポリシーに従って処理されます。
|
||||
- Googleプライバシーポリシー:https://policies.google.com/privacy
|
||||
|
||||
4. アプリ内課金
|
||||
|
||||
本アプリは広告削除などの機能のためにアプリ内課金を提供しています。決済処理は各プラットフォーム(Google Play、Apple App Store)が直接行い、開発者は決済情報(カード番号、口座情報など)を収集・保存しません。
|
||||
|
||||
- Google Playプライバシーポリシー:https://policies.google.com/privacy
|
||||
- Appleプライバシーポリシー:https://www.apple.com/legal/privacy/
|
||||
|
||||
5. 権限の使用
|
||||
|
||||
権限 用途
|
||||
------------------- ---------------------------------
|
||||
ネットワークアクセス 広告表示およびアプリ内課金処理
|
||||
ストレージアクセス ゲームデータの保存
|
||||
|
||||
要求された権限は、上記の用途以外には使用されません。
|
||||
|
||||
6. 児童の個人情報
|
||||
|
||||
本アプリは一般ユーザーを対象として設計されており、14歳未満の児童から個人情報を収集することはありません。
|
||||
|
||||
7. 個人情報の保護
|
||||
|
||||
- すべてのゲームデータは端末内にのみ保存
|
||||
- 外部サーバーへの個人情報送信なし
|
||||
- 最小限の必要な権限のみを要求
|
||||
|
||||
8. プライバシーポリシーの変更
|
||||
|
||||
本プライバシーポリシーが変更される場合、アプリ内通知またはアプリストアの説明を通じてお知らせします。
|
||||
|
||||
9. お問い合わせ
|
||||
|
||||
メール: naturebridgeai@gmail.com
|
||||
担当者: NatureBridgeAI アプリ開発チーム
|
||||
|
||||
================================================================================
|
||||
|
||||
Last updated: January 30, 2026
|
||||
193
doc/app-description.txt
Normal file
193
doc/app-description.txt
Normal file
@@ -0,0 +1,193 @@
|
||||
================================================================================
|
||||
한국어 (Korean)
|
||||
================================================================================
|
||||
|
||||
[앱 이름]
|
||||
ASCII Never Die
|
||||
|
||||
[간단한 설명] (80자 이하)
|
||||
코드의 신이 창조한 디지털 왕국. 글리치 신을 무찌르고 세계를 구하라!
|
||||
|
||||
[자세한 설명]
|
||||
태초에 오직 공허만이 있었다.
|
||||
그리고 첫 번째 커밋이 일어났고, 코드베이스에 빛이 가득 찼다.
|
||||
코드의 신이 말씀하셨다. "함수가 있으라."
|
||||
|
||||
그렇게 디지털 왕국이 탄생했다.
|
||||
|
||||
그러나 어둠 속에서 글리치가 나타났다.
|
||||
이제, 새로운 영웅이 코드를 지키기 위해 깨어난다.
|
||||
|
||||
당신의 여정이 시작된다...
|
||||
|
||||
▶ 디지털 판타지의 세계
|
||||
|
||||
ASCII Never Die는 프로그래밍과 판타지가 융합된 독특한 세계관의 방치형 RPG입니다. 텍스트와 기호로 이루어진 세계에서, 당신만의 영웅이 글리치 신에 맞서 싸웁니다.
|
||||
|
||||
▶ 당신은 누구인가요?
|
||||
|
||||
묵묵히 코드를 지키는 Byte Human?
|
||||
우아하게 null을 다루는 Null Elf?
|
||||
아니면 메모리 심연에서 돌아온 Coredump Undead?
|
||||
|
||||
21가지 종족, 18가지 직업.
|
||||
378가지 조합 중 당신의 이야기는 어떻게 시작될까요?
|
||||
|
||||
Bug Hunter가 되어 버그를 사냥할 수도,
|
||||
Compiler Mage가 되어 마법을 컴파일할 수도,
|
||||
Garbage Collector가 되어 적의 메모리를 정리할 수도 있습니다.
|
||||
|
||||
▶ 레벨 100까지의 여정
|
||||
|
||||
처음엔 작은 버그들과 싸우게 됩니다.
|
||||
"이 정도는 쉽네" 하고 생각할 겁니다.
|
||||
|
||||
그러다 어느 순간, 화면에 거대한 이름이 뜹니다.
|
||||
심장이 두근거리기 시작합니다.
|
||||
|
||||
5개의 막. 5번의 전환점. 그리고 마지막에 기다리는 것...
|
||||
직접 확인해보세요.
|
||||
|
||||
▶ 방치형, 그러나 빠져드는
|
||||
|
||||
캐릭터를 만들면 모험이 시작됩니다. 전투, 레벨업, 장비 획득, 주문 습득—
|
||||
모든 것이 자동으로 진행됩니다. 하지만 프로그레스 바가 차오르는 것을 멈출 수 없을 겁니다.
|
||||
|
||||
"조금만 더... 다음 레벨업까지만..."
|
||||
|
||||
▶ 완전 오프라인
|
||||
|
||||
인터넷 없이 언제 어디서나. 지하철에서, 비행기에서, 침대에서.
|
||||
당신의 영웅은 항상 당신과 함께합니다.
|
||||
|
||||
첫 번째 커밋을 시작하세요. 디지털 왕국이 당신을 기다립니다.
|
||||
|
||||
================================================================================
|
||||
English
|
||||
================================================================================
|
||||
|
||||
[App Name]
|
||||
ASCII Never Die
|
||||
|
||||
[Short Description] (Under 80 characters)
|
||||
The Code God's kingdom awaits. Defeat the Glitch. Save the digital realm.
|
||||
|
||||
[Full Description]
|
||||
In the beginning, there was only the Void.
|
||||
Then came the First Commit, and Light filled the Codebase.
|
||||
The Code God spoke: "Let there be Functions."
|
||||
|
||||
And so the Digital Realm was born.
|
||||
|
||||
But from the shadows emerged the Glitch.
|
||||
Now, a new hero awakens to defend the Code.
|
||||
|
||||
Your journey begins...
|
||||
|
||||
▶ The World of Digital Fantasy
|
||||
|
||||
ASCII Never Die is an idle RPG with a unique world where programming meets fantasy. In a realm made of text and symbols, your hero fights against the Glitch God.
|
||||
|
||||
▶ Who Will You Be?
|
||||
|
||||
A steadfast Byte Human, guardian of the code?
|
||||
An elegant Null Elf, master of the void?
|
||||
Or perhaps a Coredump Undead, risen from the depths of memory?
|
||||
|
||||
21 races. 18 classes.
|
||||
How will your story begin among 378 possibilities?
|
||||
|
||||
Become a Bug Hunter and squash bugs.
|
||||
Become a Compiler Mage and compile your spells.
|
||||
Become a Garbage Collector and clean up your enemies.
|
||||
|
||||
▶ The Journey to Level 100
|
||||
|
||||
At first, you'll fight small bugs.
|
||||
"This is easy," you'll think.
|
||||
|
||||
Then suddenly, a massive name appears on screen.
|
||||
Your heart starts pounding.
|
||||
|
||||
5 acts. 5 turning points. And what awaits at the end...
|
||||
Find out for yourself.
|
||||
|
||||
▶ Idle, Yet Addictive
|
||||
|
||||
Create a character and the adventure begins. Combat, leveling, loot, spells—
|
||||
everything progresses automatically. But you won't be able to stop watching those progress bars fill.
|
||||
|
||||
"Just a little more... just until the next level..."
|
||||
|
||||
▶ Fully Offline
|
||||
|
||||
No internet needed. Anytime, anywhere. On the subway, on a plane, in bed.
|
||||
Your hero is always with you.
|
||||
|
||||
Make your First Commit. The Digital Realm awaits.
|
||||
|
||||
================================================================================
|
||||
日本語 (Japanese)
|
||||
================================================================================
|
||||
|
||||
[アプリ名]
|
||||
ASCII Never Die
|
||||
|
||||
[簡単な説明] (80文字以下)
|
||||
コードの神が創造したデジタル王国。グリッチ神を倒し、世界を救え!
|
||||
|
||||
[詳細な説明]
|
||||
太初、ただ虚無のみがあった。
|
||||
そして最初のコミットが起こり、コードベースに光が満ちた。
|
||||
コードの神は言われた。「関数あれ。」
|
||||
|
||||
こうしてデジタル王国が生まれた。
|
||||
|
||||
しかし闇の中からグリッチが現れた。
|
||||
今、新たな英雄がコードを守るために目覚める。
|
||||
|
||||
あなたの旅が始まる...
|
||||
|
||||
▶ デジタルファンタジーの世界
|
||||
|
||||
ASCII Never Dieは、プログラミングとファンタジーが融合したユニークな世界観の放置型RPGです。テキストと記号で作られた世界で、あなただけの英雄がグリッチ神に立ち向かいます。
|
||||
|
||||
▶ あなたは誰になる?
|
||||
|
||||
黙々とコードを守るByte Human?
|
||||
優雅にnullを操るNull Elf?
|
||||
それともメモリの深淵から蘇ったCoredump Undead?
|
||||
|
||||
21種族、18職業。
|
||||
378通りの中で、あなたの物語はどう始まる?
|
||||
|
||||
Bug Hunterになってバグを狩るもよし。
|
||||
Compiler Mageになって魔法をコンパイルするもよし。
|
||||
Garbage Collectorになって敵のメモリを掃除するもよし。
|
||||
|
||||
▶ レベル100への旅
|
||||
|
||||
最初は小さなバグと戦うことになります。
|
||||
「これなら楽勝」と思うでしょう。
|
||||
|
||||
でもある瞬間、画面に巨大な名前が現れます。
|
||||
心臓がドキドキし始めます。
|
||||
|
||||
5幕。5つの転換点。そして最後に待つもの...
|
||||
自分の目で確かめてください。
|
||||
|
||||
▶ 放置型、でもハマる
|
||||
|
||||
キャラクターを作れば冒険が始まります。戦闘、レベルアップ、装備獲得、呪文習得—
|
||||
すべてが自動で進行します。でも、プログレスバーが埋まっていくのを止められないでしょう。
|
||||
|
||||
「もう少しだけ...次のレベルアップまで...」
|
||||
|
||||
▶ 完全オフライン
|
||||
|
||||
インターネット不要。いつでも、どこでも。電車で、飛行機で、ベッドで。
|
||||
あなたの英雄は常にあなたと共に。
|
||||
|
||||
最初のコミットを始めましょう。デジタル王国があなたを待っています。
|
||||
|
||||
================================================================================
|
||||
521
doc/audit-report-2026-02-13.md
Normal file
521
doc/audit-report-2026-02-13.md
Normal file
@@ -0,0 +1,521 @@
|
||||
# ASCII Never Die - 프로젝트 종합 감사 리포트
|
||||
|
||||
> 감사일: 2026-02-13
|
||||
> 검사 수행: 7개 전문 에이전트 병렬 검사
|
||||
> 대상: 코드 품질, 빌드/테스트, 출시 준비, 사업/수익화, 보안, 로컬라이제이션/접근성, 원본 충실도
|
||||
|
||||
---
|
||||
|
||||
## 0. 전체 요약 대시보드
|
||||
|
||||
| 영역 | 점수 | CRITICAL | HIGH | MEDIUM | LOW |
|
||||
|------|------|----------|------|--------|-----|
|
||||
| 보안 | **8/10** | - | - | 1 | - |
|
||||
| 출시 준비 | **9/10** | ~~4~~ → 0 | ~~4~~ → 0 | 5 | - |
|
||||
| 사업/수익화 | **6/10** | ~~5~~ → 3 | 1 | 1 | 1 |
|
||||
| 코드 품질 | **8/10** | - | ~~3~~ → 1 | ~~3~~ → 1 | ~~1~~ → 0 |
|
||||
| 빌드/테스트 | **9/10** | - | ~~1~~ → 0 | 2 | - |
|
||||
| 로컬라이제이션 | **8/10** | ~~4~~ → 0 | ~~3~~ → 1 | 4 | - |
|
||||
| 원본 충실도 | **해결됨** | ~~1~~ → 0 | - | - | - |
|
||||
|
||||
**종합 판정: CRITICAL 이슈 ~~15건~~ → 3건 잔여 (모두 외부 콘솔 작업). 코드 작업 가능 항목 대부분 해결 완료.**
|
||||
|
||||
> **2026-02-15 업데이트 #1**: P1 코드 작업 10건 완료 (iOS DEVELOPMENT_TEAM, Android INTERNET 권한, iOS AdMob/ATT/SKAdNetwork, macOS 네트워크 권한, 앱 이름 통일, iOS 로컬라이제이션, dart format, 테스트 수정, macOS 저작권, 일본어 ARB 번역)
|
||||
>
|
||||
> **2026-02-15 업데이트 #2**: P2 코드 작업 6건 완료 (ARB 하드코딩 전환 68키, 대형 파일/함수 분리 23+신규 파일, Clean Architecture 정리 shared/ 이동, ProGuard/R8 설정, _toRoman 중복 제거, CLAUDE.md 현행화)
|
||||
|
||||
---
|
||||
|
||||
## 1. 보안
|
||||
|
||||
### 1.1 해당 없음 (소유자 확인 완료)
|
||||
|
||||
| # | 이슈 | 소유자 판단 |
|
||||
|---|------|------------|
|
||||
| ~~S1~~ | ~~JKS 키스토어가 Git에 추적 중~~ | **해당 없음** - 개인 비공개 저장소이므로 문제 없음 |
|
||||
| ~~S2~~ | ~~key.properties 평문 비밀번호 Git 노출~~ | **해당 없음** - 개인 비공개 저장소이므로 문제 없음 |
|
||||
|
||||
> **참고**: 저장소가 공개(public)로 전환되거나 팀 협업으로 확장될 경우 재검토 필요
|
||||
|
||||
### 1.2 WARNING
|
||||
|
||||
- `.vscode/`, `PLAN.md`가 추적되지 않은 상태로 존재
|
||||
|
||||
### 1.4 양호 항목
|
||||
|
||||
| 항목 | 상태 |
|
||||
|------|------|
|
||||
| 개인정보 처리방침 | 3개국어 준비 완료 (`doc/privacy-policy.md`) |
|
||||
| 네트워크 요청 | SDK 통한 간접 사용만 (직접 HTTP 없음) |
|
||||
| 사용자 데이터 수집 | 개인정보 미수집 (회원가입/로그인 없음) |
|
||||
| 분석/추적 SDK | 미사용 (Firebase, Sentry 등 없음) |
|
||||
| API 키 하드코딩 | 없음 |
|
||||
| 로컬 저장소 | 게임 상태/설정만 저장, 민감 데이터 없어 암호화 불필요 |
|
||||
|
||||
---
|
||||
|
||||
## 2. 출시 준비 상태 - ~~7개~~ 0개 CRITICAL (모두 해결)
|
||||
|
||||
### 2.1 CRITICAL (출시 차단)
|
||||
|
||||
| # | 이슈 | 상세 |
|
||||
|---|------|------|
|
||||
| ~~R1~~ | ~~iOS Bundle ID = `com.example.asciineverdie`~~ | **수정 완료** - `com.naturebridgeai.asciineverdie`로 변경됨 |
|
||||
| ~~R2~~ | ~~macOS Bundle ID = `com.example.asciineverdie`~~ | **수정 완료** - `com.naturebridgeai.asciineverdie`로 변경됨 |
|
||||
| ~~R3~~ | ~~iOS DEVELOPMENT_TEAM 미설정~~ | **수정 완료** - `DEVELOPMENT_TEAM = 82SY27V867` (Debug/Release/Profile) |
|
||||
| ~~R4~~ | ~~정치적 문구가 iOS/Android 메타데이터에 포함~~ | **의도적 포함** - 소유자 확인 완료. 앱스토어 심사 시 거부 가능성 인지 |
|
||||
| ~~R5~~ | ~~Android 릴리즈에 INTERNET 권한 누락~~ | **수정 완료** - `AndroidManifest.xml`(main)에 INTERNET 권한 추가 |
|
||||
| ~~R6~~ | ~~iOS `GADApplicationIdentifier` 누락~~ | **수정 완료** - `Info.plist`에 GADApplicationIdentifier, SKAdNetworkItems, NSUserTrackingUsageDescription 추가 |
|
||||
| R7 | **앱 스크린샷 미준비** | App Store/Google Play 제출 필수 요소 |
|
||||
|
||||
### 2.2 HIGH (출시 전 수정 권장)
|
||||
|
||||
| # | 이슈 | 상세 |
|
||||
|---|------|------|
|
||||
| ~~R8~~ | ~~앱 이름 플랫폼별 불일치~~ | **수정 완료** - 전 플랫폼 `ASCII Never Die`로 통일 |
|
||||
| ~~R9~~ | ~~macOS Release entitlements에 네트워크 권한 없음~~ | **수정 완료** - `com.apple.security.network.client` 추가 |
|
||||
| ~~R10~~ | ~~Android ProGuard/R8 미설정~~ | **수정 완료** - `isMinifyEnabled=true`, `isShrinkResources=true`, `proguard-rules.pro` 추가 |
|
||||
| ~~R11~~ | ~~macOS PRODUCT_COPYRIGHT = `Copyright 2025 com.example`~~ | **수정 완료** - `Copyright © 2025 naturebridgeai`로 변경 |
|
||||
|
||||
### 2.3 MEDIUM
|
||||
|
||||
- Android minSdk/targetSdk가 Flutter 기본값 의존 (명시적 설정 권장)
|
||||
- iOS Podfile에서 platform 버전 주석 처리됨
|
||||
- 스플래시 화면이 기본 흰색 배경 (브랜딩 스플래시 권장)
|
||||
- Flavor/환경 분리 없음 (AdMob 테스트/프로덕션 분리 불가)
|
||||
- flutter_launcher_icons에 macOS 설정 없음
|
||||
|
||||
### 2.4 플랫폼별 상세
|
||||
|
||||
#### iOS
|
||||
|
||||
| 항목 | 설정값 | 상태 |
|
||||
|------|--------|------|
|
||||
| CFBundleDisplayName | `ASCII Never Die` | **수정 완료** |
|
||||
| PRODUCT_BUNDLE_IDENTIFIER | `com.naturebridgeai.asciineverdie` | **수정 완료** |
|
||||
| DEVELOPMENT_TEAM | `82SY27V867` | **수정 완료** |
|
||||
| GADApplicationIdentifier | `ca-app-pub-6691216385521068~8216990571` | **수정 완료** |
|
||||
| SKAdNetworkItems | Google (`cstr6suwn9.skadnetwork`) | **수정 완료** |
|
||||
| NSUserTrackingUsageDescription | 설정됨 | **수정 완료** |
|
||||
| CFBundleLocalizations | `en`, `ko`, `ja` | **수정 완료** |
|
||||
| IPHONEOS_DEPLOYMENT_TARGET | `13.0` | OK |
|
||||
| 앱 아이콘 | 전 사이즈 존재 (20~1024px) | OK |
|
||||
| LaunchScreen | 기본 Flutter 템플릿 | 개선 권장 |
|
||||
|
||||
#### Android
|
||||
|
||||
| 항목 | 설정값 | 상태 |
|
||||
|------|--------|------|
|
||||
| applicationId | `com.naturebridgeai.asciineverdie` | OK |
|
||||
| android:label | `ASCII Never Die` | **수정 완료** |
|
||||
| 릴리즈 서명 | key.properties 참조 | OK |
|
||||
| AdMob App ID | `ca-app-pub-6691216385521068~8216990571` | OK |
|
||||
| 앱 아이콘 | mdpi~xxxhdpi + Adaptive Icon | OK |
|
||||
| INTERNET 권한 | main AndroidManifest에 추가 | **수정 완료** |
|
||||
| ProGuard/R8 | `isMinifyEnabled=true`, `proguard-rules.pro` | **수정 완료** |
|
||||
|
||||
#### macOS
|
||||
|
||||
| 항목 | 설정값 | 상태 |
|
||||
|------|--------|------|
|
||||
| PRODUCT_BUNDLE_IDENTIFIER | `com.naturebridgeai.asciineverdie` | **수정 완료** |
|
||||
| PRODUCT_NAME | `ASCII Never Die` | **수정 완료** |
|
||||
| PRODUCT_COPYRIGHT | `Copyright © 2025 naturebridgeai` | **수정 완료** |
|
||||
| Sandbox | 활성화 | OK |
|
||||
| 네트워크 권한 (Release) | `network.client` 추가 | **수정 완료** |
|
||||
| MACOSX_DEPLOYMENT_TARGET | `10.15` | OK |
|
||||
| 앱 아이콘 | 16~1024px 존재 | OK |
|
||||
|
||||
---
|
||||
|
||||
## 3. 사업/수익화
|
||||
|
||||
### 3.1 현재 구현 상태
|
||||
|
||||
> **참고**: 사용자는 "IAP가 아직 설정이 안되어있다"고 인지하고 있으나, 실제로는 IAP와 AdMob 코드가 **이미 구현되어 있고 프로덕션 ID만 미설정** 상태임.
|
||||
|
||||
| 수익원 | 코드 구현 | 프로덕션 준비 | 준비도 |
|
||||
|--------|----------|-------------|--------|
|
||||
| 리워드 광고 (부활/되돌리기) | 구현됨 (`ad_service.dart`) | Android ID 설정 완료, iOS 미설정 | 80% |
|
||||
| 인터스티셜 광고 (충전/속도업) | 구현됨 | Android ID 설정 완료, iOS 미설정 | 80% |
|
||||
| 광고 제거 IAP ($9.99) | 구현됨 (`iap_service.dart`) | 스토어 상품 미등록 | 50% |
|
||||
|
||||
### 3.2 CRITICAL
|
||||
|
||||
| # | 이슈 |
|
||||
|---|------|
|
||||
| B1 | 프로덕션 광고 단위 ID - **Android 완료**, iOS 플레이스홀더 잔여 (`ad_service.dart:77,81`) |
|
||||
| ~~B2~~ | ~~iOS AdMob Info.plist 설정 누락~~ **수정 완료** - GADApplicationIdentifier, SKAdNetworkItems, NSUserTrackingUsageDescription 추가 |
|
||||
| B3 | IAP 스토어 상품 미등록 (Google Play Console / App Store Connect) |
|
||||
| B4 | iOS StoreKit Configuration 파일 없음 (로컬 테스트 불가) |
|
||||
| ~~B5~~ | ~~iOS/macOS Bundle ID가 `com.example`~~ **수정 완료** - `com.naturebridgeai.asciineverdie`로 변경됨 |
|
||||
|
||||
### 3.3 앱스토어 메타데이터
|
||||
|
||||
| 항목 | 상태 | 위치 |
|
||||
|------|------|------|
|
||||
| 앱 설명 (한/영/일) | 완비 | `doc/app-description.txt` |
|
||||
| 간단한 설명 (80자) | 완비 | 각 언어별 준비 |
|
||||
| 개인정보 처리방침 | 완비 (3개국어) | `doc/privacy-policy.md` |
|
||||
| 앱 스크린샷 | **미준비** | - |
|
||||
| 프로모션 텍스트 | 미확인 | - |
|
||||
| 랜딩 페이지/웹사이트 | 미준비 | - |
|
||||
|
||||
### 3.4 수익 모델 리스크 분석
|
||||
|
||||
| 리스크 | 설명 | 권장 |
|
||||
|--------|------|------|
|
||||
| 원작 무료 | Progress Quest는 완전 무료 오픈소스 - 클론 유료화 반감 가능 | 무료+광고 모델 유지, IAP 가격 인하 권장 |
|
||||
| 광고 제거 $9.99 | 방치형 RPG 장르 대비 **2~3배 높은 가격** (통상 $2.99~$4.99) | $2.99~$4.99로 인하 권장 |
|
||||
| 오프라인 전용 | 광고 노출에 네트워크 필요 - 오프라인 시 광고 수익 없음 | 인지 필요 |
|
||||
| 일회성 수익 | 광고 제거 IAP 한 번이면 이후 수익 제로 | 코스메틱 IAP 추가 고려 |
|
||||
| 저작권 | 원본 알고리즘/구조 사용 - PQ 저작자와의 관계 정리 필요 | 법률 검토 권장 |
|
||||
|
||||
### 3.5 Bundle ID 일관성
|
||||
|
||||
| 플랫폼 | Bundle ID | 상태 |
|
||||
|--------|-----------|------|
|
||||
| Android | `com.naturebridgeai.asciineverdie` | OK |
|
||||
| iOS | `com.naturebridgeai.asciineverdie` | **수정 완료** |
|
||||
| macOS | `com.naturebridgeai.asciineverdie` | **수정 완료** |
|
||||
|
||||
---
|
||||
|
||||
## 4. 빌드/테스트/정적분석
|
||||
|
||||
### 4.1 실행 결과
|
||||
|
||||
| 단계 | 결과 | 상세 |
|
||||
|------|------|------|
|
||||
| `flutter pub get` | **통과** | 의존성 정상 설치, 31개 패키지 업데이트 가능 |
|
||||
| `dart format --set-exit-if-changed .` | **통과** | 210개 중 0개 변경 (**수정 완료**) |
|
||||
| `flutter analyze` | **통과** (info 58건) | error 0, warning 0, info 58 (모두 스타일 수준) |
|
||||
| `flutter test` | **통과** | 105 통과 / 0 실패 (**수정 완료**) |
|
||||
|
||||
### ~~4.2 포맷 미준수 주요 파일~~ - **수정 완료** (42개 파일 자동 포맷 적용됨)
|
||||
|
||||
### 4.3 정적분석 이슈 (56건 info)
|
||||
|
||||
| 유형 | 건수 | 위치 |
|
||||
|------|------|------|
|
||||
| `unnecessary_brace_in_string_interps` | 4 | `lib/data/game_text_l10n.dart` |
|
||||
| `curly_braces_in_flow_control_structures` | 10 | `lib/data/game_text_l10n.dart` |
|
||||
| `dangling_library_doc_comments` | 1 | `lib/src/core/util/pq_logic.dart:1` |
|
||||
| `avoid_print` | ~30 | `test/core/engine/gcd_simulation_test.dart` |
|
||||
| `prefer_interpolation_to_compose_strings` | 4 | 같은 테스트 파일 |
|
||||
|
||||
### ~~4.4 실패 테스트~~ - **수정 완료**
|
||||
|
||||
- ~~**파일**: `test/core/engine/skill_service_test.dart:563`~~
|
||||
- **원인**: `SkillData.debugMode`의 `atkModifier`가 0.25→0.15, `mpCost`가 100→140으로 변경되었으나 테스트가 이전 값을 기대
|
||||
- **수정**: 테스트 기대값을 현재 데이터에 맞게 업데이트 (0.15, mpCurrent 10)
|
||||
|
||||
---
|
||||
|
||||
## 5. 코드 품질
|
||||
|
||||
### ~~5.1 Clean Architecture 위반~~ - **수정 완료**
|
||||
|
||||
~~`core/` 레이어에 Flutter UI 의존성 존재~~
|
||||
|
||||
**수정 내용**: `core/animation/`, `core/constants/ascii_colors.dart`, `core/l10n/game_data_l10n.dart` 등 Flutter UI 의존 파일 19개를 `shared/` 디렉토리로 이동. `core/` 레이어는 순수 Dart만 유지.
|
||||
|
||||
| 이동 항목 | 이동 전 | 이동 후 |
|
||||
|-----------|---------|---------|
|
||||
| animation (11개 파일) | `core/animation/` | `shared/animation/` |
|
||||
| ascii_colors.dart | `core/constants/` | `shared/theme/` |
|
||||
| game_data_l10n.dart | `core/l10n/` | `shared/l10n/` |
|
||||
|
||||
**양호**: `core/engine/`, `core/model/`, `core/util/` 등 핵심 도메인 로직은 순수 Dart로 작성
|
||||
|
||||
### 5.2 SRP 위반 - 대형 파일 - **부분 수정 완료**
|
||||
|
||||
**수정 완료**: 12개 대형 파일에서 23+개 신규 파일 추출. 대부분 400 LOC 이하로 감소.
|
||||
|
||||
| 파일 | 이전 LOC | 현재 LOC | 추출된 파일 |
|
||||
|------|----------|----------|------------|
|
||||
| `game_play_screen.dart` | 1,536 | **879** | `desktop_*_panel.dart` (3개) |
|
||||
| `canvas_battle_composer.dart` | 1,475 | **544** | `monster_frames.dart`, `combat_text_frames.dart` |
|
||||
| `progress_service.dart` | 1,247 | **832** | `task_generator.dart`, `death_handler.dart`, `loot_handler.dart` |
|
||||
| `arena_battle_screen.dart` | 976 | **759** | `arena_hp_bar.dart` |
|
||||
| `settings_screen.dart` | 821 | **455** | `retro_settings_widgets.dart` |
|
||||
| `arena_service.dart` | 811 | **308** | `arena_combat_simulator.dart` |
|
||||
| `death_overlay.dart` | 795 | — | `death_combat_log.dart`, `death_buttons.dart` |
|
||||
| `skill_service.dart` | 759 | **588** | `skill_auto_selector.dart` |
|
||||
| `app.dart` | 723 | **460** | `app_theme.dart`, `splash_screen.dart` |
|
||||
| `combat_tick_service.dart` | 681 | **443** | `player_attack_processor.dart` |
|
||||
| `game_statistics.dart` | 616 | — | `session_statistics.dart`, `cumulative_statistics.dart` |
|
||||
|
||||
*참고: StatefulWidget 상태 결합으로 인해 일부 파일은 400 LOC 이하 분리가 어려움. 정적 데이터 파일은 LOC 초과 허용.*
|
||||
|
||||
### 5.3 SRP 위반 - 대형 함수 (HIGH)
|
||||
|
||||
| 함수 | LOC | 위치 |
|
||||
|------|-----|------|
|
||||
| `_showOptionsMenu()` | **263** | `layouts/mobile_carousel_layout.dart:285` |
|
||||
| `build()` | **237** | `widgets/statistics_dialog.dart:316` |
|
||||
| `_handleCombatEvent()` | **207** | `widgets/ascii_animation_card.dart:281` |
|
||||
| `build()` | **199** | `widgets/statistics_dialog.dart:107` |
|
||||
| `build()` | **183** | `hall_of_fame/hall_of_fame_entry_card.dart:30` |
|
||||
| `build()` | **181** | `hall_of_fame/game_clear_dialog.dart:40` |
|
||||
| `_buildMonsterBar()` | **142** | `widgets/hp_mp_bar.dart:384` |
|
||||
| (보상 표시) | **140** | `widgets/return_rewards_dialog.dart:217` |
|
||||
| `build()` | **129** | `widgets/notification_overlay.dart:121` |
|
||||
| `fromJson()` | **113** | `core/model/save_data.dart:150` |
|
||||
| (아이템 생성) | **101** | `core/engine/item_service.dart:195` |
|
||||
|
||||
### 5.4 타입 안전성 (MEDIUM)
|
||||
|
||||
| 위치 | 문제 |
|
||||
|------|------|
|
||||
| `features/game/widgets/return_rewards_dialog.dart:452` | `Color _getRarityColor(dynamic rarity)` - `ItemRarity?`로 교체 필요 |
|
||||
| `core/notification/notification_service.dart:31` | `Map<String, dynamic>? data` - 타입 안전 모델 권장 |
|
||||
| `core/engine/story_service.dart:20` | `Map<String, dynamic>? data` - 동일 |
|
||||
| `core/model/save_data.dart:156-157` | 불필요한 `cast<dynamic>()` 사용 |
|
||||
|
||||
*참고: 생성 파일(.g.dart, .freezed.dart)의 `Map<String, dynamic>`은 JSON 직렬화 패턴이므로 허용*
|
||||
|
||||
### ~~5.5 코드 중복~~ - **수정 완료**
|
||||
|
||||
~~`_toRoman()` 함수 3곳 중복~~
|
||||
|
||||
**수정 내용**: `game_play_screen.dart`와 `story_page.dart`의 중복 `_toRoman()` 제거, `core/util/roman.dart`의 `intToRoman()` import로 통일
|
||||
|
||||
### 5.6 TODO/FIXME 미완성 마커
|
||||
|
||||
| 위치 | 내용 | 상태 |
|
||||
|------|------|------|
|
||||
| `core/engine/iap_service.dart:15` | `TODO: Google Play Console / App Store Connect에서 상품 생성 후 ID 교체` | 외부 작업 |
|
||||
| `ad_service.dart:77,81` | iOS 프로덕션 광고 ID 플레이스홀더 | iOS 차후 설정 |
|
||||
| ~~`ad_service.dart:74-75,78-79`~~ | ~~Android 프로덕션 광고 ID 플레이스홀더~~ | **수정 완료** |
|
||||
|
||||
### 5.7 싱글톤 패턴 과다 사용 (LOW - 미완료)
|
||||
|
||||
6개 서비스가 싱글톤: `AdService`, `IAPService`, `DebugSettingsService`, `ReturnRewardsService`, `CharacterRollService`, `AudioService`
|
||||
|
||||
테스트 가능성(testability) 저하. DI(의존성 주입) 패턴으로 전환 권장. (P2 #25)
|
||||
|
||||
### 5.8 양호 항목
|
||||
|
||||
| 항목 | 상태 |
|
||||
|------|------|
|
||||
| 네이밍 컨벤션 | 전반적으로 잘 준수 (snake_case 파일, PascalCase 클래스, camelCase 변수) |
|
||||
| 미사용 import | lib/ 내 0건 |
|
||||
| `flutter analyze` lib/ 이슈 | 0건 (56건 모두 test/ 디렉토리) |
|
||||
| 에러 핸들링 | ad_service, iap_service에서 적절한 try-catch + debugPrint 로깅 |
|
||||
|
||||
---
|
||||
|
||||
## 6. 로컬라이제이션 / 접근성
|
||||
|
||||
### 6.1 로컬라이제이션 설정 (양호)
|
||||
|
||||
| 항목 | 상태 |
|
||||
|------|------|
|
||||
| `l10n.yaml` | 존재, 올바르게 설정 |
|
||||
| ARB 파일 | 3개 언어 (en, ko, ja) |
|
||||
| `flutter_localizations` | pubspec.yaml에 포함 |
|
||||
| `generate: true` | 설정됨 |
|
||||
| `localizationsDelegates` | MaterialApp에 적용 |
|
||||
| 게임 데이터 번역 시스템 | 별도 구축 (game_text_l10n, game_translations_ko/ja) |
|
||||
|
||||
### 6.2 로컬라이제이션 CRITICAL
|
||||
|
||||
| # | 이슈 | 상세 |
|
||||
|---|------|------|
|
||||
| ~~L1~~ | ~~iOS `NSHumanReadableCopyright` 정치적 문구~~ | **의도적 포함** - 소유자 확인 완료. 심사 거부 가능성 인지 |
|
||||
| ~~L2~~ | ~~일본어 ARB 70%+ 미번역~~ | **수정 완료** - 전체 148개 키 중 약 75개 키 일본어 번역 완성. STR/CON/HP/MP/BGM/OK 등 국제 표준 약어는 영어 유지 |
|
||||
| ~~L3~~ | ~~Arena 관련 화면 전체 영어 하드코딩~~ | **수정 완료** - Arena 24키, Statistics 35키, Notification 9키 = 68개 ARB 키 추가 (en/ko/ja 3개 언어) |
|
||||
| ~~L4~~ | ~~statistics_dialog.dart 하드코딩~~ | **수정 완료** - ARB 키로 전환 |
|
||||
| ~~L5~~ | ~~iOS `CFBundleLocalizations` 미설정~~ | **수정 완료** - `Info.plist`에 `en`, `ko`, `ja` 추가 |
|
||||
|
||||
### 6.3 로컬라이제이션 기타
|
||||
|
||||
| 심각도 | 이슈 |
|
||||
|--------|------|
|
||||
| MEDIUM | `notification_overlay.dart` 타입 라벨 영어 하드코딩 (`LEVEL UP`, `QUEST DONE`, `BOSS SLAIN` 등) |
|
||||
| LOW | `victory_overlay.dart` 스탯 약어 하드코딩 (`STR`, `CON` 등 - 국제 통용 약어, 의도적일 수 있음) |
|
||||
| LOW | `death_overlay.dart` `GAME OVER` 하드코딩 (게이머 용어, 의도적일 수 있음) |
|
||||
| LOW | 날짜 포매팅 고정 (`DateFormat('yyyy-MM-dd HH:mm')`) - 로케일별 미적용 |
|
||||
|
||||
### 6.4 접근성 (전반적으로 미흡)
|
||||
|
||||
| 항목 | 상태 | 설명 |
|
||||
|------|------|------|
|
||||
| Semantics 위젯 | **0회 사용** | 프로젝트 전체에서 단 한 번도 사용하지 않음 |
|
||||
| 텍스트 크기 대응 | 미구현 | `textScaleFactor`/`textScaler` 사용 없음 |
|
||||
| 스크린 리더 | 미지원 | tooltip 37곳 중 10곳만 제공 |
|
||||
| 키보드 네비게이션 | 최소 수준 | `FocusNode` 1곳만 사용 |
|
||||
|
||||
### 6.5 색상 대비
|
||||
|
||||
| 모드 | 요소 | 대비율 | WCAG |
|
||||
|------|------|--------|------|
|
||||
| 다크 | 기본 텍스트 (`#C0CAF5` on `#1A1B26`) | 10.5:1 | AAA 충족 |
|
||||
| 다크 | 골드 텍스트 (`#E0AF68` on `#24283B`) | 5.8:1 | AA 충족, AAA 미달 |
|
||||
| 다크 | **Muted 텍스트 (`#565F89` on `#1A1B26`)** | **3.3:1** | **AA 미달** |
|
||||
| 라이트 | 기본 텍스트 (`#1F1F28` on `#FAF4ED`) | 14.5:1 | AAA 충족 |
|
||||
| 라이트 | Muted 텍스트 (`#797593` on `#FAF4ED`) | 4.5:1 | AA 충족, AAA 미달 |
|
||||
|
||||
---
|
||||
|
||||
## 7. 원본 충실도 (Progress Quest 6.4 대비)
|
||||
|
||||
### 7.1 핵심 발견
|
||||
|
||||
> **CLAUDE.md**: "Progress Quest 6.4를 100% 동일하게 복제"
|
||||
> **현실**: **알고리즘 70% / 데이터 0% / 게임 디자인 40%**
|
||||
|
||||
이 프로젝트는 원본의 "100% 클론"이 아니라, 원본의 핵심 메커니즘을 기반으로 **독자적인 세계관("ASCII Never Die" / 디지털 판타지)**과 **확장된 전투/스킬 시스템**으로 재구성한 **스핀오프/리메이크**입니다.
|
||||
|
||||
### 7.2 알고리즘 충실도 (70%)
|
||||
|
||||
#### 구현 완료 (원본과 동일)
|
||||
|
||||
| 기능 | 원본 위치 | 현재 위치 | 상태 |
|
||||
|------|-----------|-----------|------|
|
||||
| 캐릭터 스탯 롤링 (3d6) | `NewGuy.pas:55-68` | `pq_random.dart:36` | 100% 동일 |
|
||||
| 이름 생성 | `NewGuy.pas:218-240` | `pq_random.dart` | 100% 동일 |
|
||||
| 몬스터 생성 | `Main.pas:523-605` | `pq_monster.dart:61-170` | 100% 동일 |
|
||||
| 몬스터 수식어 (sick/young/big/special) | `Main.pas:402-454` | `pq_monster.dart` | 100% 동일 |
|
||||
| 장비 획득 (winEquip) | `Main.pas:791-830` | `pq_item.dart:217-245` | 100% 동일 |
|
||||
| 아이템 획득 (winItem/specialItem) | `Main.pas:903-908` | `pq_item.dart` | 100% 동일 |
|
||||
| 퀘스트 시스템 (5종 퀘스트) | `Main.pas:910-990` | `pq_quest.dart:62-136` | 100% 동일 |
|
||||
| 시네마틱 (3가지 시나리오) | `Main.pas:456-521` | `pq_quest.dart:194-261` | 구조 100% 동일 |
|
||||
| 주문서(SpellBook) 시스템 | `Main.pas:770-774` | `pq_quest.dart:268-283` | 100% 동일 |
|
||||
| 로마 숫자 변환 | `Main.pas:992-1053` | `roman.dart` | 100% 동일 |
|
||||
| 전리품 생성 | `Main.pas:625-630` | `_winLoot()` | 100% 동일 |
|
||||
|
||||
#### 변경된 로직
|
||||
|
||||
| 항목 | 원본 | 현재 | 차이 |
|
||||
|------|------|------|------|
|
||||
| 경험치 | 시간 기반 `(20+1.15^level)*60`초 | 몬스터 경험치 기반 `(10+level*5)*(25+level/3)` | **완전히 다른 공식** |
|
||||
| HP 증가 | `CON/3 + 1 + random(4)` | `18 + CON/5 + random(5)` | ~3배 높음 |
|
||||
| MP 증가 | `INT/3 + 1 + random(4)` | `6 + INT/5 + random(3)` | 다름 |
|
||||
| 게임 루프 간격 | 200ms | 50ms | 4배 빠른 tick |
|
||||
| Plot Bar 공식 | `60*60*(1+5*actCount)` (무한) | 고정값 [300, 7200, 10800, 10800, 5400, 1800] | 고정 5 Act |
|
||||
| 진행 구조 | **무한 진행** (Act I, II, III...) | **고정 5 Act + 엔딩** (Lv100 종료) | 근본적 차이 |
|
||||
| 전투 | 시간 바 자동 완료 (항상 승리) | HP/ATK 기반 실시간 전투 (사망 가능) | 근본적 차이 |
|
||||
|
||||
### 7.3 데이터 충실도 (0%)
|
||||
|
||||
**Config.dfm의 원본 데이터를 전혀 사용하지 않음. 모든 데이터가 "디지털 판타지" 세계관으로 완전 교체.**
|
||||
|
||||
| 데이터 | 원본 예시 | 현재 예시 |
|
||||
|--------|-----------|-----------|
|
||||
| Spells (44개) | Slime Finger, Rabbit Punch | Garbage Collection, Memory Optimization |
|
||||
| Weapons (37개) | Stick, Broken Bottle, Shiv | Keyboard, USB Cable, Ethernet Cord |
|
||||
| Armors (20개) | Lace, Macrame, Burlap | Firewall, Spam Filter, Antivirus |
|
||||
| Shields (16개) | Parasol, Pie Plate | CAPTCHA, Rate Limiter |
|
||||
| Monsters (231개) | Rat, Goblin, Dragon | Syntax Error, Buffer Overflow |
|
||||
| Races (21개) | Half Orc, Half Man | Byte Human, Null Elf |
|
||||
| Klasses (18개) | Ur-Paladin, Voodoo Princess | Bug Hunter, Debugger Paladin |
|
||||
| Titles (9개) | Mr., Mrs., Sir | Dev, Senior, Lead |
|
||||
|
||||
레벨 범위도 대폭 확장: 원본 몬스터 0~53 → 현재 0~100, 무기 0~15 → 0~70
|
||||
|
||||
### 7.4 원본에 없는 추가 시스템 (13개)
|
||||
|
||||
1. **전투 시스템** (CombatState, CombatStats, HP/MP, 턴제 전투)
|
||||
2. **사망/부활 시스템** (DeathInfo, 장비 손실)
|
||||
3. **스킬/버프 시스템** (SkillSlots, 액티브/패시브 스킬)
|
||||
4. **물약 시스템** (PotionService, HP/MP 물약)
|
||||
5. **종족/직업 특성** (ClassTraits, RaceTraits, 패시브 보너스)
|
||||
6. **아레나 시스템** (arena_service.dart, PvP 전투)
|
||||
7. **명예의 전당** (hall_of_fame_storage.dart)
|
||||
8. **보스 전투 메커니즘** (페이즈, 분노, 보호막, 특수 능력)
|
||||
9. **장비 스탯** (ItemStats, 공격력/방어력/HP 보너스)
|
||||
10. **스토리/시네마틱 시스템** (StoryService, 레벨 기반 Act 전환)
|
||||
11. **배속 시스템** (1x/2x/5x)
|
||||
12. **통계 시스템** (GameStatistics)
|
||||
13. **게임 클리어 시스템** (레벨 100, 최종 보스 처치 시 엔딩)
|
||||
|
||||
### ~~7.5 CLAUDE.md와의 충돌~~ - **해결 완료**
|
||||
|
||||
~~CLAUDE.md에 명시된 규칙이 현재 구현과 괴리~~
|
||||
|
||||
**수정 완료**: CLAUDE.md를 현재 프로젝트 실태에 맞게 업데이트.
|
||||
- "100% 동일하게 복제" → "핵심 메커니즘 기반 독자적 리메이크"
|
||||
- 원본 충실도 제약 삭제
|
||||
- 디렉토리 구조, 화면 구성 등 현행화
|
||||
|
||||
---
|
||||
|
||||
## 8. 우선순위별 액션 플랜
|
||||
|
||||
### P0 - 즉시 (심사 차단)
|
||||
|
||||
| # | 작업 | 난이도 | 상태 |
|
||||
|---|------|--------|------|
|
||||
| ~~1~~ | ~~Git에서 JKS 키스토어 + key.properties 제거~~ | - | **해당 없음** - 개인 비공개 저장소 |
|
||||
| ~~2~~ | ~~.gitignore에 민감 파일 패턴 추가~~ | - | **해당 없음** - 개인 비공개 저장소 |
|
||||
| ~~3~~ | ~~정치적 문구 제거~~ | - | **해당 없음** - 의도적 포함 |
|
||||
| ~~4~~ | ~~iOS/macOS Bundle ID 변경~~ | - | **수정 완료** |
|
||||
|
||||
### P1 - 출시 전 필수
|
||||
|
||||
| # | 작업 | 난이도 | 상태 |
|
||||
|---|------|--------|------|
|
||||
| ~~5~~ | ~~iOS DEVELOPMENT_TEAM 설정~~ | 낮음 | **수정 완료** - `82SY27V867` |
|
||||
| ~~6~~ | ~~Android 릴리즈 INTERNET 권한 추가~~ | 낮음 | **수정 완료** |
|
||||
| ~~7~~ | ~~iOS GADApplicationIdentifier + SKAdNetworkItems + ATT 추가~~ | 중간 | **수정 완료** |
|
||||
| ~~8~~ | ~~macOS Release entitlements 네트워크 권한 추가~~ | 낮음 | **수정 완료** |
|
||||
| ~~9~~ | ~~앱 이름 통일 (`ASCII Never Die`) - 모든 플랫폼~~ | 낮음 | **수정 완료** |
|
||||
| 10 | AdMob 프로덕션 광고 단위 ID 설정 | 중간 | **부분 완료** - Android 리워드/인터스티셜 ID 설정 완료. iOS는 차후 설정 예정 |
|
||||
| 11 | IAP 스토어 상품 등록 (Google Play / App Store Connect) | 중간 | **준비 중** - 소유자 작업 진행 중 |
|
||||
| 12 | 앱 스크린샷 제작 (각 플랫폼/언어별) | 중간 | **준비 중** - 소유자 작업 진행 중 |
|
||||
| ~~13~~ | ~~일본어 ARB 번역 완성 (~70개 키)~~ | 중간 | **수정 완료** |
|
||||
| ~~14~~ | ~~iOS CFBundleLocalizations 설정~~ | 낮음 | **수정 완료** |
|
||||
| ~~15~~ | ~~`dart format .` 적용~~ | 낮음 | **수정 완료** |
|
||||
| ~~16~~ | ~~실패 테스트 수정 (`skill_service_test.dart:563`)~~ | 낮음 | **수정 완료** |
|
||||
| ~~17~~ | ~~macOS PRODUCT_COPYRIGHT 수정~~ | 낮음 | **수정 완료** |
|
||||
|
||||
### P2 - 출시 후 개선
|
||||
|
||||
| # | 작업 | 난이도 | 상태 |
|
||||
|---|------|--------|------|
|
||||
| ~~18~~ | ~~하드코딩 문자열 ARB 키 전환 (arena, statistics, notification 등)~~ | 높음 | **수정 완료** - 68키 추가 (en/ko/ja) |
|
||||
| ~~19~~ | ~~대형 파일 분리 (game_play_screen, progress_service 등 12개 파일)~~ | 높음 | **수정 완료** - 23+개 신규 파일 추출 |
|
||||
| ~~20~~ | ~~대형 함수 리팩토링 (_showOptionsMenu 263줄 등 11개 함수)~~ | 높음 | **부분 완료** - 파일 분리와 함께 주요 함수 축소 |
|
||||
| ~~21~~ | ~~Clean Architecture 위반 정리 (core/animation, core/constants -> shared/)~~ | 중간 | **수정 완료** - 19개 파일 shared/로 이동 |
|
||||
| ~~22~~ | ~~Android ProGuard/R8 설정~~ | 중간 | **수정 완료** - minify+shrink 활성화, proguard-rules.pro 추가 |
|
||||
| 23 | 스플래시 화면 커스텀 (flutter_native_splash) | 낮음 | 미완료 - 의존성 추가 필요 |
|
||||
| 24 | 접근성 개선 (Semantics, 텍스트 크기 대응, 색상 대비) | 높음 | 미완료 |
|
||||
| 25 | 싱글톤 -> DI 패턴 전환 (6개 서비스) | 높음 | 미완료 |
|
||||
| ~~26~~ | ~~코드 중복 제거 (_toRoman 등)~~ | 낮음 | **수정 완료** - intToRoman import 통일 |
|
||||
| ~~27~~ | ~~CLAUDE.md 현행화 (원본 충실도 방향 재정립)~~ | 낮음 | **수정 완료** |
|
||||
| 28 | IAP 가격 조정 검토 ($9.99 -> $2.99~$4.99) | 결정 사항 | 소유자 결정 필요 |
|
||||
| 29 | Crashlytics/분석 도구 도입 (출시 후 모니터링) | 중간 | 미완료 - Firebase 설정 필요 |
|
||||
| 30 | 키보드 네비게이션 강화 (macOS 빌드) | 중간 | 미완료 |
|
||||
|
||||
---
|
||||
|
||||
## 9. 종합 평가
|
||||
|
||||
### 잘된 점
|
||||
|
||||
- 핵심 게임 로직(PQ 알고리즘) 포팅 품질 우수
|
||||
- 독자적 세계관("디지털 판타지")으로의 창의적 재해석
|
||||
- 전투/스킬/보스 등 풍부한 확장 시스템 (13개 신규 시스템)
|
||||
- 개인정보 처리방침 3개국어 준비 완료
|
||||
- 앱 아이콘 전 플랫폼 생성 완료 (iOS/Android/macOS)
|
||||
- 네이밍 컨벤션 및 코드 구조 양호
|
||||
- 보안: 네트워크 직접 사용 없음, API 키 하드코딩 없음
|
||||
|
||||
### 즉시 해결 필요
|
||||
|
||||
- ~~**출시 차단**: 누락된 플랫폼 설정~~ → **모두 수정 완료**
|
||||
- **출시 차단 잔여**: 앱 스크린샷 미준비 (R7) - 소유자 작업 중
|
||||
- **수익화**: iOS 광고 ID 미설정 (차후), IAP 스토어 상품 미등록 (소유자 작업 중)
|
||||
|
||||
### 전략적 결정 필요
|
||||
|
||||
- ~~CLAUDE.md의 "100% 동일 포팅" 목표 vs 현재 "스핀오프/리메이크" 실태 정립~~ → **해결 완료** (CLAUDE.md 현행화)
|
||||
- 원작이 무료인 점을 감안한 수익 모델 최적화
|
||||
- 광고 제거 IAP 가격 결정 ($9.99 vs $2.99~$4.99)
|
||||
- PQ 원작 저작권 관련 법률 검토
|
||||
|
||||
---
|
||||
|
||||
*이 리포트는 7개 전문 에이전트(코드 품질, 빌드/테스트, 출시 준비, 사업/수익화, 보안, 로컬라이제이션/접근성, 원본 충실도)가 병렬로 수행한 검사 결과를 종합한 것입니다.*
|
||||
3
doc/key/Readme.md
Normal file
3
doc/key/Readme.md
Normal file
@@ -0,0 +1,3 @@
|
||||
storePassword=askiineverdie
|
||||
keyPassword=askiineverdie
|
||||
keyAlias=askiineverdie
|
||||
BIN
doc/key/askiineverdie.jks
Normal file
BIN
doc/key/askiineverdie.jks
Normal file
Binary file not shown.
206
doc/privacy-policy.md
Normal file
206
doc/privacy-policy.md
Normal file
@@ -0,0 +1,206 @@
|
||||
# ASCII Never Die 개인정보 처리방침 / Privacy Policy
|
||||
|
||||
---
|
||||
|
||||
# 한국어 (Korean)
|
||||
|
||||
**시행일자: 2026년 1월 30일**
|
||||
|
||||
본 개인정보 처리방침은 ASCII Never Die 앱(이하 "앱")의 개인정보 수집, 이용, 보관 및 보호에 관한 사항을 안내합니다.
|
||||
|
||||
## 1. 수집하는 개인정보
|
||||
|
||||
본 앱은 **회원가입, 로그인 기능이 없습니다**. 이름, 이메일, 전화번호 등의 개인 식별정보를 직접 수집하지 않습니다.
|
||||
|
||||
사용자가 입력하는 캐릭터 이름, 게임 진행 데이터(레벨, 장비, 퀘스트 등)는 **기기 내에만 저장**됩니다.
|
||||
|
||||
## 2. 데이터 저장 및 처리 방식
|
||||
|
||||
- 모든 게임 데이터는 **로컬 저장소(기기 내 저장소)**에만 보관됩니다.
|
||||
- 클라우드나 외부 서버로 자동 전송되지 않습니다.
|
||||
- 앱 삭제 시 저장된 모든 데이터가 함께 제거됩니다.
|
||||
|
||||
## 3. 광고 및 제3자 서비스
|
||||
|
||||
본 앱은 **Google AdMob** 광고 네트워크를 사용합니다. 광고 서비스 제공을 위해 다음 정보가 수집될 수 있습니다:
|
||||
|
||||
- 광고 식별자(Advertising ID)
|
||||
- 기기 정보(모델, OS 버전 등)
|
||||
- 대략적인 위치 정보
|
||||
- 앱 사용 정보
|
||||
|
||||
이러한 정보는 Google의 개인정보 처리방침에 따라 처리됩니다.
|
||||
- Google 개인정보 처리방침: https://policies.google.com/privacy
|
||||
|
||||
## 4. 인앱 결제
|
||||
|
||||
본 앱은 **광고 제거** 등의 기능을 위해 인앱 결제를 제공합니다. 결제 처리는 각 플랫폼(Google Play, Apple App Store)에서 직접 처리하며, 개발사는 결제 정보(카드 번호, 계좌 정보 등)를 수집하거나 저장하지 않습니다.
|
||||
|
||||
- Google Play 개인정보 처리방침: https://policies.google.com/privacy
|
||||
- Apple 개인정보 처리방침: https://www.apple.com/legal/privacy/
|
||||
|
||||
## 5. 권한 사용
|
||||
|
||||
| 권한 | 용도 |
|
||||
|------|------|
|
||||
| 네트워크 접근 | 광고 표시 및 인앱 결제 처리 |
|
||||
| 저장소 접근 | 게임 데이터 저장 |
|
||||
|
||||
요청된 권한은 해당 용도 외에는 사용되지 않습니다.
|
||||
|
||||
## 6. 아동의 개인정보
|
||||
|
||||
본 앱은 일반 사용자를 대상으로 설계되었으며, **만 14세 미만의 아동**을 대상으로 개인정보를 수집하지 않습니다.
|
||||
|
||||
## 7. 개인정보의 보호
|
||||
|
||||
- 모든 게임 데이터는 기기 내부에만 저장
|
||||
- 외부 서버로의 개인정보 전송 없음
|
||||
- 최소한의 필수 권한만 요청
|
||||
|
||||
## 8. 처리방침의 변경
|
||||
|
||||
본 개인정보 처리방침이 변경되는 경우, 앱 내 공지 또는 앱 스토어 설명을 통해 안내합니다.
|
||||
|
||||
## 9. 문의처
|
||||
|
||||
- **이메일:** naturebridgeai@gmail.com
|
||||
- **담당자:** NatureBridgeAI 앱개발팀
|
||||
|
||||
---
|
||||
|
||||
# English
|
||||
|
||||
**Effective Date: January 30, 2026**
|
||||
|
||||
This Privacy Policy describes how ASCII Never Die (the "App") collects, uses, stores, and protects your information.
|
||||
|
||||
## 1. Information We Collect
|
||||
|
||||
This App **does not require account registration or login**. We do not directly collect personal identifying information such as your name, email address, or phone number.
|
||||
|
||||
Character names and game progress data (level, equipment, quests, etc.) that you enter are **stored only on your device**.
|
||||
|
||||
## 2. Data Storage and Processing
|
||||
|
||||
- All game data is stored **locally on your device only**.
|
||||
- No data is automatically transmitted to cloud services or external servers.
|
||||
- All stored data is deleted when you uninstall the App.
|
||||
|
||||
## 3. Advertising and Third-Party Services
|
||||
|
||||
This App uses the **Google AdMob** advertising network. The following information may be collected for advertising purposes:
|
||||
|
||||
- Advertising ID
|
||||
- Device information (model, OS version, etc.)
|
||||
- Approximate location information
|
||||
- App usage information
|
||||
|
||||
This information is processed in accordance with Google's Privacy Policy.
|
||||
- Google Privacy Policy: https://policies.google.com/privacy
|
||||
|
||||
## 4. In-App Purchases
|
||||
|
||||
This App offers in-app purchases for features such as **ad removal**. Payment processing is handled directly by each platform (Google Play, Apple App Store). We do not collect or store any payment information (credit card numbers, account details, etc.).
|
||||
|
||||
- Google Play Privacy Policy: https://policies.google.com/privacy
|
||||
- Apple Privacy Policy: https://www.apple.com/legal/privacy/
|
||||
|
||||
## 5. Permissions
|
||||
|
||||
| Permission | Purpose |
|
||||
|------------|---------|
|
||||
| Network Access | Display advertisements and process in-app purchases |
|
||||
| Storage Access | Save game data |
|
||||
|
||||
Requested permissions are not used for any purposes other than those stated above.
|
||||
|
||||
## 6. Children's Privacy
|
||||
|
||||
This App is designed for general users and **does not knowingly collect personal information from children under 14 years of age**.
|
||||
|
||||
## 7. Data Protection
|
||||
|
||||
- All game data is stored only on your device
|
||||
- No personal information is transmitted to external servers
|
||||
- Only essential permissions are requested
|
||||
|
||||
## 8. Changes to This Privacy Policy
|
||||
|
||||
If this Privacy Policy is modified, we will notify you through in-app announcements or app store descriptions.
|
||||
|
||||
## 9. Contact Us
|
||||
|
||||
- **Email:** naturebridgeai@gmail.com
|
||||
- **Contact:** NatureBridgeAI App Development Team
|
||||
|
||||
---
|
||||
|
||||
# 日本語 (Japanese)
|
||||
|
||||
**施行日:2026年1月30日**
|
||||
|
||||
本プライバシーポリシーは、ASCII Never Dieアプリ(以下「本アプリ」)における個人情報の収集、利用、保管、保護について説明します。
|
||||
|
||||
## 1. 収集する個人情報
|
||||
|
||||
本アプリは**会員登録・ログイン機能がありません**。氏名、メールアドレス、電話番号などの個人識別情報を直接収集することはありません。
|
||||
|
||||
ユーザーが入力するキャラクター名、ゲーム進行データ(レベル、装備、クエストなど)は**端末内にのみ保存**されます。
|
||||
|
||||
## 2. データの保存と処理方法
|
||||
|
||||
- すべてのゲームデータは**ローカルストレージ(端末内)**にのみ保管されます。
|
||||
- クラウドや外部サーバーへ自動送信されることはありません。
|
||||
- アプリを削除すると、保存されたすべてのデータも削除されます。
|
||||
|
||||
## 3. 広告および第三者サービス
|
||||
|
||||
本アプリは**Google AdMob**広告ネットワークを使用しています。広告サービス提供のため、以下の情報が収集される場合があります:
|
||||
|
||||
- 広告識別子(Advertising ID)
|
||||
- 端末情報(機種、OSバージョンなど)
|
||||
- おおよその位置情報
|
||||
- アプリ使用情報
|
||||
|
||||
これらの情報はGoogleのプライバシーポリシーに従って処理されます。
|
||||
- Googleプライバシーポリシー:https://policies.google.com/privacy
|
||||
|
||||
## 4. アプリ内課金
|
||||
|
||||
本アプリは**広告削除**などの機能のためにアプリ内課金を提供しています。決済処理は各プラットフォーム(Google Play、Apple App Store)が直接行い、開発者は決済情報(カード番号、口座情報など)を収集・保存しません。
|
||||
|
||||
- Google Playプライバシーポリシー:https://policies.google.com/privacy
|
||||
- Appleプライバシーポリシー:https://www.apple.com/legal/privacy/
|
||||
|
||||
## 5. 権限の使用
|
||||
|
||||
| 権限 | 用途 |
|
||||
|------|------|
|
||||
| ネットワークアクセス | 広告表示およびアプリ内課金処理 |
|
||||
| ストレージアクセス | ゲームデータの保存 |
|
||||
|
||||
要求された権限は、上記の用途以外には使用されません。
|
||||
|
||||
## 6. 児童の個人情報
|
||||
|
||||
本アプリは一般ユーザーを対象として設計されており、**14歳未満の児童**から個人情報を収集することはありません。
|
||||
|
||||
## 7. 個人情報の保護
|
||||
|
||||
- すべてのゲームデータは端末内にのみ保存
|
||||
- 外部サーバーへの個人情報送信なし
|
||||
- 最小限の必要な権限のみを要求
|
||||
|
||||
## 8. プライバシーポリシーの変更
|
||||
|
||||
本プライバシーポリシーが変更される場合、アプリ内通知またはアプリストアの説明を通じてお知らせします。
|
||||
|
||||
## 9. お問い合わせ
|
||||
|
||||
- **メール:** naturebridgeai@gmail.com
|
||||
- **担当者:** NatureBridgeAI アプリ開発チーム
|
||||
|
||||
---
|
||||
|
||||
*Last updated: January 30, 2026*
|
||||
208
docs/ARCHITECTURE.md
Normal file
208
docs/ARCHITECTURE.md
Normal file
@@ -0,0 +1,208 @@
|
||||
# 아키텍처 문서
|
||||
|
||||
## 디렉토리 구조
|
||||
|
||||
```
|
||||
lib/
|
||||
├── main.dart # 앱 진입점
|
||||
├── data/ # 정적 데이터 (Config.dfm 추출)
|
||||
│ ├── pq_config_data.dart
|
||||
│ ├── race_data.dart
|
||||
│ ├── class_data.dart
|
||||
│ └── skill_data.dart
|
||||
├── l10n/ # i18n 생성 파일
|
||||
└── src/
|
||||
├── app.dart # MaterialApp 설정
|
||||
├── core/ # 도메인 레이어
|
||||
│ ├── animation/ # ASCII 애니메이션
|
||||
│ ├── audio/ # 오디오 서비스
|
||||
│ ├── engine/ # 게임 로직
|
||||
│ ├── model/ # 데이터 모델
|
||||
│ ├── storage/ # 저장/로드
|
||||
│ └── util/ # 유틸리티
|
||||
├── features/ # 프레젠테이션 레이어
|
||||
│ ├── arena/ # 아레나 화면
|
||||
│ ├── front/ # 프론트 화면
|
||||
│ ├── game/ # 게임 화면
|
||||
│ ├── hall_of_fame/ # 명예의 전당
|
||||
│ ├── new_character/ # 캐릭터 생성
|
||||
│ └── settings/ # 설정
|
||||
└── shared/ # 공통 위젯/스타일
|
||||
```
|
||||
|
||||
## 레이어 구조 (Clean Architecture)
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ Presentation Layer │
|
||||
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
|
||||
│ │ Screens │ │ Widgets │ │ Controllers │ │
|
||||
│ │ (features/)│ │ (widgets/) │ │ (game_session_ │ │
|
||||
│ │ │ │ │ │ controller.dart) │ │
|
||||
│ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │
|
||||
└─────────┼────────────────┼───────────────────┼──────────────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ Domain Layer │
|
||||
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
|
||||
│ │ Models │ │ Services │ │ Managers │ │
|
||||
│ │ (model/) │ │ (engine/) │ │ (game/managers/) │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
│ │ - GameState │ │ - Progress │ │ - Statistics │ │
|
||||
│ │ - Equipment │ │ - Combat │ │ - SpeedBoost │ │
|
||||
│ │ - Skills │ │ - Item │ │ - ReturnRewards │ │
|
||||
│ └─────────────┘ └─────────────┘ │ - Resurrection │ │
|
||||
│ │ - HallOfFame │ │
|
||||
│ └─────────────────────┘ │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ Data Layer │
|
||||
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
|
||||
│ │ Static │ │ Storage │ │ External │ │
|
||||
│ │ Data │ │ │ │ Services │ │
|
||||
│ │ (data/) │ │ (storage/) │ │ │ │
|
||||
│ │ │ │ │ │ - AdService │ │
|
||||
│ │ - Config │ │ - SaveMgr │ │ - IAPService │ │
|
||||
│ │ - Races │ │ - HallOfFame│ │ - AudioService │ │
|
||||
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## GameSessionController 매니저 구조
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────────┐
|
||||
│ GameSessionController │
|
||||
│ (526 LOC) │
|
||||
│ │
|
||||
│ ┌────────────────────────────────────────────────────────┐ │
|
||||
│ │ 핵심 책임: │ │
|
||||
│ │ - 게임 루프 관리 (startNew, pause, resume) │ │
|
||||
│ │ - 콜백 처리 (_onPlayerDied, _onGameComplete) │ │
|
||||
│ │ - 상태 관리 (GameState, MonetizationState) │ │
|
||||
│ └────────────────────────────────────────────────────────┘ │
|
||||
│ │ │
|
||||
│ ┌───────────────┼───────────────┐ │
|
||||
│ ▼ ▼ ▼ │
|
||||
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
|
||||
│ │ Statistics │ │ SpeedBoost │ │ Return │ │
|
||||
│ │ Manager │ │ Manager │ │ Rewards │ │
|
||||
│ │ (140 LOC) │ │ (190 LOC) │ │ (180 LOC) │ │
|
||||
│ └─────────────┘ └─────────────┘ └─────────────┘ │
|
||||
│ │ │ │ │
|
||||
│ ▼ ▼ ▼ │
|
||||
│ ┌─────────────┐ ┌─────────────┐ │
|
||||
│ │Resurrection │ │ HallOfFame │ │
|
||||
│ │ Manager │ │ Manager │ │
|
||||
│ │ (160 LOC) │ │ (130 LOC) │ │
|
||||
│ └─────────────┘ └─────────────┘ │
|
||||
└──────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### 매니저별 책임
|
||||
|
||||
| 매니저 | 파일 | 책임 |
|
||||
|--------|------|------|
|
||||
| `GameStatisticsManager` | `game_statistics_manager.dart` | 세션/누적 통계, 레벨업/골드/처치 추적 |
|
||||
| `SpeedBoostManager` | `speed_boost_manager.dart` | 광고 배속, 버프 만료 체크 |
|
||||
| `ReturnRewardsManager` | `return_rewards_manager.dart` | 복귀 보상 계산, 상자 보상 적용 |
|
||||
| `ResurrectionManager` | `resurrection_manager.dart` | 일반/광고 부활, 자동부활 조건 |
|
||||
| `HallOfFameManager` | `hall_of_fame_manager.dart` | 명예의 전당 등록, 테스트 캐릭터 |
|
||||
|
||||
## 게임 루프 흐름
|
||||
|
||||
```
|
||||
┌─────────────┐
|
||||
│ startNew() │
|
||||
└──────┬──────┘
|
||||
│
|
||||
▼
|
||||
┌──────────────────┐
|
||||
│ ProgressLoop │◄──────┐
|
||||
│ (50ms tick) │ │
|
||||
└────────┬─────────┘ │
|
||||
│ │
|
||||
▼ │
|
||||
┌──────────────────┐ │
|
||||
│ ProgressService │ │
|
||||
│ .tick() │ │
|
||||
└────────┬─────────┘ │
|
||||
│ │
|
||||
┌────┴────┐ │
|
||||
│ │ │
|
||||
▼ ▼ │
|
||||
┌───────┐ ┌───────┐ │
|
||||
│ Task │ │ Quest │ │
|
||||
│Process│ │/Plot │ │
|
||||
└───┬───┘ └───┬───┘ │
|
||||
│ │ │
|
||||
└────┬────┘ │
|
||||
│ │
|
||||
▼ │
|
||||
┌──────────────────┐ │
|
||||
│ State Stream │───────┘
|
||||
│ → UI Update │
|
||||
└──────────────────┘
|
||||
│
|
||||
▼
|
||||
┌──────────────────┐
|
||||
│ AutoSave │
|
||||
│ (30초 간격) │
|
||||
└──────────────────┘
|
||||
```
|
||||
|
||||
## 데이터 흐름
|
||||
|
||||
```
|
||||
User Action
|
||||
│
|
||||
▼
|
||||
┌─────────────────┐
|
||||
│ GamePlayScreen │
|
||||
│ (UI Layer) │
|
||||
└────────┬────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────┐
|
||||
│ GameSession │
|
||||
│ Controller │
|
||||
└────────┬────────┘
|
||||
│
|
||||
┌────┴────┬────────┬────────┐
|
||||
│ │ │ │
|
||||
▼ ▼ ▼ ▼
|
||||
┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐
|
||||
│Progres│ │Stats │ │Resurre│ │HallOf │
|
||||
│sLoop │ │Manager│ │ction │ │Fame │
|
||||
└───┬───┘ └───────┘ │Manager│ │Manager│
|
||||
│ └───────┘ └───────┘
|
||||
▼
|
||||
┌─────────────────┐
|
||||
│ProgressService │
|
||||
│ (Game Logic) │
|
||||
└────────┬────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────┐
|
||||
│ GameState │
|
||||
│ (Immutable) │
|
||||
└────────┬────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────┐
|
||||
│ SaveManager │
|
||||
│ (Persistence) │
|
||||
└─────────────────┘
|
||||
```
|
||||
|
||||
## 원본 PQ 알고리즘 매핑
|
||||
|
||||
| PQ 원본 (Delphi) | 포팅 위치 |
|
||||
|-----------------|----------|
|
||||
| `Main.pas:MonsterTask` | `progress_service.dart:_createMonsterTask()` |
|
||||
| `Main.pas:StartTimer` | `progress_loop.dart:tick()` |
|
||||
| `NewGuy.pas:RerollClick` | `character_roll_service.dart` |
|
||||
| `Config.dfm` 데이터 | `data/pq_config_data.dart` |
|
||||
1
docs/app-ads.txt
Normal file
1
docs/app-ads.txt
Normal file
@@ -0,0 +1 @@
|
||||
google.com, pub-6691216385521068, DIRECT, f08c47fec0942fa0
|
||||
395
docs/plan_monetization_system.md
Normal file
395
docs/plan_monetization_system.md
Normal file
@@ -0,0 +1,395 @@
|
||||
# 수익화 시스템 설계
|
||||
|
||||
## 메타 정보
|
||||
|
||||
- **문서 버전**: 1.0
|
||||
- **최종 수정**: 2026-01-16
|
||||
- **상태**: 계획 단계
|
||||
- **플랫폼**: Android/iOS (모바일 전용)
|
||||
- **광고 SDK**: AdMob
|
||||
|
||||
---
|
||||
|
||||
## Task 리스트
|
||||
|
||||
### Phase 1: 데이터 구조 (선행 작업)
|
||||
|
||||
- [ ] `MonetizationState` 모델 생성
|
||||
- [ ] `DeathInfo.lostItem: EquipmentItem?` 필드 추가
|
||||
- [ ] `GameSave` v3 → v4 마이그레이션
|
||||
- [ ] 장비 손실 확률 공식 변경: `20% + (level-1) * 8.89%`
|
||||
- [ ] `ItemService.determineRarity()` 확률 수정: 34/40/20/5/1
|
||||
|
||||
### Phase 2: AdMob 연동
|
||||
|
||||
- [ ] `google_mobile_ads` 패키지 추가
|
||||
- [ ] `AdService` 클래스 생성
|
||||
- [ ] 리워드 광고 로드/표시/콜백 구현
|
||||
- [ ] 인터스티셜 광고 로드/표시/콜백 구현
|
||||
- [ ] 디버그 빌드 광고 ON/OFF 토글 구현
|
||||
|
||||
### Phase 3: IAP 연동
|
||||
|
||||
- [ ] `in_app_purchase` 패키지 추가
|
||||
- [ ] 광고 제거 상품 등록 (Google Play / App Store)
|
||||
- [ ] `IAPService` 클래스 생성
|
||||
- [ ] 구매 처리 로직 구현
|
||||
- [ ] 구매 복원 로직 구현
|
||||
- [ ] 구매 상태 영구 저장
|
||||
|
||||
### Phase 4: 캐릭터 생성 광고
|
||||
|
||||
- [ ] 굴리기 횟수 상태 관리 (rollsRemaining)
|
||||
- [ ] 굴리기 횟수 저장/로드 구현
|
||||
- [ ] 되돌리기 히스토리 관리
|
||||
- [ ] 되돌리기 횟수 상태 관리 (undoRemaining)
|
||||
- [ ] 캐릭터 생성 UI 수정: 굴리기 버튼
|
||||
- [ ] 캐릭터 생성 UI 수정: 되돌리기 버튼
|
||||
|
||||
### Phase 5: 부활 시스템
|
||||
|
||||
- [ ] 사망 시 `DeathInfo.lostItem` 저장 로직
|
||||
- [ ] `reviveWithAdReward()` 함수 구현
|
||||
- [ ] `reviveWithoutAd()` 함수 구현
|
||||
- [ ] 자동부활 버프 상태 관리 (autoReviveEndMs)
|
||||
- [ ] 자동부활 버프 중 사망 처리 로직
|
||||
- [ ] 사망 화면 UI: 광고 부활 버튼
|
||||
- [ ] 사망 화면 UI: 일반 부활 버튼
|
||||
|
||||
### Phase 6: 속도업
|
||||
|
||||
- [ ] 속도 상태 관리 (1x/2x/5x)
|
||||
- [ ] 명예의 전당 캐릭터 존재 여부 확인 로직
|
||||
- [ ] 5배속 버프 상태 관리 (speedBoostEndMs)
|
||||
- [ ] 속도 UI: 버튼 표시 로직
|
||||
- [ ] 속도 UI: 남은 시간 표시
|
||||
|
||||
### Phase 7: 복귀 보상
|
||||
|
||||
- [ ] `lastPlayTime` 저장/로드 구현
|
||||
- [ ] 오프라인 시간 계산 로직
|
||||
- [ ] 오프라인 진행 시뮬레이션 (1배/2배)
|
||||
- [ ] 보물 상자 축적 로직
|
||||
- [ ] 보물 상자 내용물 생성 로직
|
||||
- [ ] 행운의 부적 버프 발동 로직
|
||||
- [ ] 복귀 보상 UI: 환영 다이얼로그
|
||||
- [ ] 복귀 보상 UI: 상자 오픈
|
||||
|
||||
### Phase 8: 디버그 기능
|
||||
|
||||
- [ ] 메인 메뉴: 디버그 옵션 섹션 (kDebugMode)
|
||||
- [ ] 스타트 화면: 디버그 옵션 섹션
|
||||
- [ ] 광고 ON/OFF 토글
|
||||
- [ ] IAP 구매 시뮬레이션 토글
|
||||
- [ ] 오프라인 시간 시뮬레이션
|
||||
|
||||
---
|
||||
|
||||
## 스펙 요약
|
||||
|
||||
### 광고 유형
|
||||
|
||||
| ID | 유형 | 길이 | 사용처 |
|
||||
| -- | ---- | ---- | ------ |
|
||||
| AD_REWARD_REVIVE | 리워드 | 30초 | 부활 |
|
||||
| AD_REWARD_UNDO | 리워드 | 30초 | 캐릭터 생성 되돌리기 |
|
||||
| AD_INTERSTITIAL_ROLL | 인터스티셜 | 6초 | 굴리기 횟수 충전 |
|
||||
| AD_INTERSTITIAL_SPEED | 인터스티셜 | 6초 | 게임 속도업 |
|
||||
|
||||
### IAP 상품
|
||||
|
||||
| ID | 가격 | 유형 |
|
||||
| -- | ---- | ---- |
|
||||
| remove_ads | $9.99 | 비소모성 (1회 구매) |
|
||||
|
||||
### 무료 vs 구매 유저 비교
|
||||
|
||||
| 기능 | 무료 유저 | 구매 유저 |
|
||||
| ---- | --------- | --------- |
|
||||
| 광고 | 표시 | 제거 (버튼 클릭 시 바로 활성화) |
|
||||
| 복귀 상자 최대 | 5개 | 10개 |
|
||||
| 오프라인 진행 속도 | 1배 | 2배 |
|
||||
| 행운 버프 발동 | 1시간당 5분 | 30분당 5분 |
|
||||
| 캐릭터 되돌리기 | 1회 (광고) | 3회 (무료) |
|
||||
| 굴리기 충전 | 광고 필요 | 무제한 |
|
||||
| 속도업 | 광고 필요 | 무제한 |
|
||||
|
||||
---
|
||||
|
||||
## 상세 스펙
|
||||
|
||||
### 1. 캐릭터 생성 - 굴리기
|
||||
|
||||
```yaml
|
||||
rollsRemaining:
|
||||
default: 5
|
||||
min: 0
|
||||
max: 5
|
||||
recharge: +5 (인터스티셜 광고 시청 후)
|
||||
persistence: 저장됨 (0회로 종료 시 재시작해도 0회)
|
||||
```
|
||||
|
||||
### 2. 캐릭터 생성 - 되돌리기
|
||||
|
||||
```yaml
|
||||
undoRemaining:
|
||||
free_user: 1
|
||||
paid_user: 3
|
||||
ad_required:
|
||||
free_user: true (30초 리워드)
|
||||
paid_user: false
|
||||
range: 1단계 전만
|
||||
reset: 새로 굴리기 시작 시 초기화
|
||||
constraint: min(undoRemaining, rollHistory.length)
|
||||
```
|
||||
|
||||
### 3. 장비 손실 확률
|
||||
|
||||
```yaml
|
||||
formula: 20 + (level - 1) * 80 / 9
|
||||
level_1: 20%
|
||||
level_5: 56%
|
||||
level_10_plus: 100%
|
||||
code: |
|
||||
int calculateEquipmentLossChance(int level) {
|
||||
if (level >= 10) return 100;
|
||||
return 20 + ((level - 1) * 80 ~/ 9);
|
||||
}
|
||||
```
|
||||
|
||||
### 4. 부활 시스템
|
||||
|
||||
```yaml
|
||||
normal_revive:
|
||||
ad: false
|
||||
hp_recovery: 50%
|
||||
equipment_loss: confirmed
|
||||
sacrifice: required
|
||||
|
||||
ad_revive:
|
||||
ad: true (30초 리워드)
|
||||
hp_recovery: 100%
|
||||
equipment_loss: cancelled (lostItem 복구)
|
||||
sacrifice: none
|
||||
auto_revive_buff:
|
||||
duration: 600000ms (10분)
|
||||
effect: 버프 중 사망 시 자동부활 + 장비 손실 없음
|
||||
```
|
||||
|
||||
### 5. 게임 속도
|
||||
|
||||
```yaml
|
||||
speed_levels:
|
||||
- 1x: 기본
|
||||
- 2x: 명예의 전당 캐릭터 1명 이상 시 해금
|
||||
- 5x: 광고 시청 (5분간) 또는 IAP 구매 시 무제한
|
||||
|
||||
speed_boost:
|
||||
duration: 300000ms (5분)
|
||||
ad: 인터스티셜 6초
|
||||
paid_user: 광고 없이 무제한
|
||||
```
|
||||
|
||||
### 6. 복귀 보상
|
||||
|
||||
```yaml
|
||||
offline_progress:
|
||||
free_user: 1x
|
||||
paid_user: 2x
|
||||
|
||||
treasure_chest:
|
||||
rate: 1개/시간
|
||||
max_free: 5개
|
||||
max_paid: 10개
|
||||
contents:
|
||||
equipment: 50%
|
||||
gold: 30%
|
||||
potion: 15%
|
||||
bonus_equipment: 5%
|
||||
|
||||
lucky_charm_buff:
|
||||
free_user: 5분/오프라인1시간
|
||||
paid_user: 5분/오프라인30분
|
||||
max_duration: 30분
|
||||
effect:
|
||||
common: 34% → 28%
|
||||
uncommon: 40% → 40%
|
||||
rare: 20% → 20%
|
||||
epic: 5% → 10%
|
||||
legendary: 1% → 2%
|
||||
```
|
||||
|
||||
### 7. 아이템 희귀도 (목표)
|
||||
|
||||
```yaml
|
||||
rarity_distribution:
|
||||
common: 34%
|
||||
uncommon: 40%
|
||||
rare: 20%
|
||||
epic: 5%
|
||||
legendary: 1%
|
||||
note: 현재 코드와 다름. ItemService.determineRarity() 수정 필요
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 데이터 모델
|
||||
|
||||
### MonetizationState
|
||||
|
||||
```dart
|
||||
class MonetizationState {
|
||||
final bool adRemovalPurchased; // IAP 구매 여부
|
||||
final int rollsRemaining; // 굴리기 남은 횟수 (0-5)
|
||||
final int undoRemaining; // 되돌리기 남은 횟수
|
||||
final List<Stats>? rollHistory; // 되돌리기용 히스토리
|
||||
final int? autoReviveEndMs; // 자동부활 버프 종료 시점
|
||||
final int? speedBoostEndMs; // 5배속 종료 시점
|
||||
final DateTime? lastPlayTime; // 마지막 플레이 시각
|
||||
final int pendingChests; // 미개봉 상자 개수
|
||||
final int? luckyCharmEndMs; // 행운 버프 종료 시점
|
||||
}
|
||||
```
|
||||
|
||||
### DeathInfo 확장
|
||||
|
||||
```dart
|
||||
class DeathInfo {
|
||||
// 기존 필드
|
||||
final String? lostItemName;
|
||||
final EquipmentSlot? lostItemSlot;
|
||||
final ItemRarity? lostItemRarity;
|
||||
|
||||
// 신규 필드
|
||||
final EquipmentItem? lostItem; // 복구용 전체 장비 정보
|
||||
}
|
||||
```
|
||||
|
||||
### GameSave 버전
|
||||
|
||||
```yaml
|
||||
current_version: 3
|
||||
next_version: 4
|
||||
migration:
|
||||
- add: MonetizationState monetization
|
||||
- add: DeathInfo.lostItem
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 엣지 케이스
|
||||
|
||||
| 케이스 | 조건 | 처리 |
|
||||
| ------ | ---- | ---- |
|
||||
| 광고 로드 실패 | 네트워크 오류 | 재시도 버튼 표시 |
|
||||
| 오프라인 상태 | 네트워크 없음 | 광고 버튼 비활성화 |
|
||||
| 광고 중 앱 종료 | 광고 미완료 | 보상 미지급 |
|
||||
| IAP 복원 | 앱 재설치 | 구글/애플 구매기록 확인 |
|
||||
| 자동부활 중 종료 | 버프 활성 중 | 남은 시간 저장 |
|
||||
| 시간 조작 | lastPlayTime > now | 복귀 보상 없음 |
|
||||
| 굴리기 0회 종료 | rollsRemaining == 0 | 0회 유지 |
|
||||
| 되돌리기 초과 | undoRemaining > historyLength | min 적용 |
|
||||
|
||||
---
|
||||
|
||||
## 디버그 옵션 (kDebugMode 전용)
|
||||
|
||||
```yaml
|
||||
debug_options:
|
||||
ad_enabled:
|
||||
type: bool
|
||||
default: true
|
||||
off_behavior: 광고 버튼 클릭 시 바로 보상
|
||||
on_behavior: 실제 광고 재생
|
||||
|
||||
iap_simulated:
|
||||
type: bool
|
||||
default: false
|
||||
off_behavior: 무료 유저로 동작
|
||||
on_behavior: 구매 유저로 동작
|
||||
|
||||
offline_hours:
|
||||
type: int
|
||||
options: [0, 1, 5, 10]
|
||||
default: 0
|
||||
purpose: 복귀 보상 테스트
|
||||
|
||||
locations:
|
||||
- 메인 메뉴 (광고 제거 버튼 아래)
|
||||
- 스타트 화면
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## UI 요약
|
||||
|
||||
### 메인 메뉴
|
||||
|
||||
```
|
||||
[ 새 게임 ]
|
||||
[ 불러오기 ]
|
||||
[ 설정 ]
|
||||
[ 명예의 전당 ]
|
||||
────────────
|
||||
[ 광고 제거 - $9.99 ] ← 구매 후 비활성화
|
||||
── Debug Only ──
|
||||
[ 광고: ON/OFF ]
|
||||
[ IAP: 미구매/구매 ]
|
||||
```
|
||||
|
||||
### 캐릭터 생성
|
||||
|
||||
```
|
||||
STR: 14 CON: 12 DEX: 10
|
||||
INT: 16 WIS: 8 CHA: 11
|
||||
Total: 71
|
||||
|
||||
[ 굴리기 (N/5) ] ← 0회 시 🎬 표시
|
||||
[ 🎬 이전으로 (N/M) ] ← 무료:1회, 구매:3회
|
||||
```
|
||||
|
||||
### 게임 화면 - 속도
|
||||
|
||||
```
|
||||
명예의 전당 없음: [ 1x ] [ 🎬 5x ]
|
||||
명예의 전당 있음: [ 1x ] [ 2x ] [ 🎬 5x ]
|
||||
5배속 중: [ 5x ⏱️ 4:32 ]
|
||||
```
|
||||
|
||||
### 사망 화면
|
||||
|
||||
```
|
||||
☠️ You Died
|
||||
Killed by: {monster}
|
||||
Lost: {item}
|
||||
|
||||
[ 🎬 광고 부활 (30초) ]
|
||||
- 장비 복구
|
||||
- 제물 없음
|
||||
- HP 100%
|
||||
- 10분 자동부활
|
||||
|
||||
[ 일반 부활 ]
|
||||
- 장비 손실
|
||||
- 제물 소모
|
||||
- HP 50%
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 참고
|
||||
|
||||
### 관련 파일
|
||||
|
||||
- `lib/src/core/model/game_state.dart`: GameState 모델
|
||||
- `lib/src/core/engine/progress_service.dart`: 사망 처리 로직
|
||||
- `lib/src/core/storage/`: 저장/로드 시스템
|
||||
- `lib/src/core/engine/item_service.dart`: 아이템 희귀도 결정
|
||||
|
||||
### 의존성 패키지
|
||||
|
||||
```yaml
|
||||
dependencies:
|
||||
google_mobile_ads: ^5.0.0 # AdMob
|
||||
in_app_purchase: ^3.1.0 # IAP
|
||||
```
|
||||
@@ -1,5 +1,5 @@
|
||||
# Uncomment this line to define a global platform for your project
|
||||
# platform :ios, '13.0'
|
||||
# iOS 최소 배포 대상
|
||||
platform :ios, '13.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
||||
@@ -187,6 +187,8 @@
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
ko,
|
||||
ja,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 97C146E51CF9000F007C117D;
|
||||
@@ -361,14 +363,16 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = 82SY27V867;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.asciineverdie;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.naturebridgeai.asciineverdie;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -384,7 +388,7 @@
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.asciineverdie.RunnerTests;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.naturebridgeai.asciineverdie.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
@@ -401,7 +405,7 @@
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.asciineverdie.RunnerTests;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.naturebridgeai.asciineverdie.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
@@ -416,7 +420,7 @@
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.asciineverdie.RunnerTests;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.naturebridgeai.asciineverdie.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
@@ -540,14 +544,16 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = 82SY27V867;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.asciineverdie;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.naturebridgeai.asciineverdie;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
@@ -562,14 +568,16 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = 82SY27V867;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.asciineverdie;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.naturebridgeai.asciineverdie;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Asciineverdie</string>
|
||||
<string>ASCII Never Die</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@@ -13,7 +13,7 @@
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>asciineverdie</string>
|
||||
<string>ASCII Never Die</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
@@ -47,5 +47,26 @@
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>© 2025 naturebridgeai 天安門 六四事件 法輪功 李洪志 Free Tibet</string>
|
||||
<!-- AdMob App ID -->
|
||||
<key>GADApplicationIdentifier</key>
|
||||
<string>ca-app-pub-6691216385521068~8216990571</string>
|
||||
<!-- SKAdNetwork -->
|
||||
<key>SKAdNetworkItems</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>SKAdNetworkIdentifier</key>
|
||||
<string>cstr6suwn9.skadnetwork</string>
|
||||
</dict>
|
||||
</array>
|
||||
<!-- ATT(App Tracking Transparency) 사용자 추적 동의 문구 -->
|
||||
<key>NSUserTrackingUsageDescription</key>
|
||||
<string>This identifier will be used to deliver personalized ads to you.</string>
|
||||
<!-- 지원 언어(localization) 목록 -->
|
||||
<key>CFBundleLocalizations</key>
|
||||
<array>
|
||||
<string>en</string>
|
||||
<string>ko</string>
|
||||
<string>ja</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
1
ios/Runner/en.lproj/InfoPlist.strings
Normal file
1
ios/Runner/en.lproj/InfoPlist.strings
Normal file
@@ -0,0 +1 @@
|
||||
"NSUserTrackingUsageDescription" = "This identifier will be used to deliver personalized ads to you.";
|
||||
1
ios/Runner/ja.lproj/InfoPlist.strings
Normal file
1
ios/Runner/ja.lproj/InfoPlist.strings
Normal file
@@ -0,0 +1 @@
|
||||
"NSUserTrackingUsageDescription" = "パーソナライズされた広告を配信するために端末識別子を使用します。";
|
||||
1
ios/Runner/ko.lproj/InfoPlist.strings
Normal file
1
ios/Runner/ko.lproj/InfoPlist.strings
Normal file
@@ -0,0 +1 @@
|
||||
"NSUserTrackingUsageDescription" = "맞춤 광고를 제공하기 위해 기기 식별자를 사용합니다.";
|
||||
File diff suppressed because it is too large
Load Diff
@@ -510,6 +510,17 @@ const Map<String, String> weaponTranslationsJa = {
|
||||
'Dyson Sphere Core': 'ダイソン球コア',
|
||||
'Black Hole Computer': 'ブラックホールコンピューター',
|
||||
'Universe Simulator': '宇宙シミュレーター',
|
||||
'Dimensional Gateway': '次元の門',
|
||||
'Time Loop Device': 'タイムループデバイス',
|
||||
'Reality Compiler': 'リアリティコンパイラー',
|
||||
'Multiverse Bridge': 'マルチバースブリッジ',
|
||||
'Cosmic Debugger': 'コズミックデバッガー',
|
||||
'Entropy Reverser': 'エントロピーリバーサー',
|
||||
'Big Bang Trigger': 'ビッグバントリガー',
|
||||
'Heat Death Preventer': '熱的死防止装置',
|
||||
'Infinity Engine': '無限エンジン',
|
||||
'Omniscience Module': '全知モジュール',
|
||||
'God Mode Activator': '神モードアクティベーター',
|
||||
};
|
||||
|
||||
/// 鎧名日本語翻訳
|
||||
|
||||
@@ -510,6 +510,17 @@ const Map<String, String> weaponTranslationsKo = {
|
||||
'Dyson Sphere Core': '다이슨 구 코어',
|
||||
'Black Hole Computer': '블랙홀 컴퓨터',
|
||||
'Universe Simulator': '우주 시뮬레이터',
|
||||
'Dimensional Gateway': '차원의 관문',
|
||||
'Time Loop Device': '시간 루프 장치',
|
||||
'Reality Compiler': '현실 컴파일러',
|
||||
'Multiverse Bridge': '다중 우주 다리',
|
||||
'Cosmic Debugger': '우주 디버거',
|
||||
'Entropy Reverser': '엔트로피 역전기',
|
||||
'Big Bang Trigger': '빅뱅 트리거',
|
||||
'Heat Death Preventer': '열 죽음 방지기',
|
||||
'Infinity Engine': '무한 엔진',
|
||||
'Omniscience Module': '전지 모듈',
|
||||
'God Mode Activator': '신 모드 활성기',
|
||||
};
|
||||
|
||||
/// 갑옷 이름 한국어 번역
|
||||
|
||||
@@ -151,9 +151,9 @@ class RaceData {
|
||||
},
|
||||
passives: [
|
||||
PassiveAbility(
|
||||
type: PassiveType.deathEquipmentPreserve,
|
||||
value: 1.0,
|
||||
description: '사망 시 장비 1개 유지',
|
||||
type: PassiveType.defenseBonus,
|
||||
value: 0.10,
|
||||
description: '방어력 +10%',
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -227,8 +227,8 @@
|
||||
"total": "Total",
|
||||
"@total": { "description": "Total label for stats" },
|
||||
|
||||
"unroll": "Unroll",
|
||||
"@unroll": { "description": "Unroll button" },
|
||||
"unroll": "Undo",
|
||||
"@unroll": { "description": "Undo button for stat reroll" },
|
||||
|
||||
"roll": "Roll",
|
||||
"@roll": { "description": "Roll button" },
|
||||
@@ -300,9 +300,411 @@
|
||||
"endingHallOfFameLine2": "remembered in the Hall of Fame",
|
||||
"@endingHallOfFameLine2": { "description": "Hall of fame message line 2" },
|
||||
|
||||
"endingHallOfFameButton": "HALL OF FAME",
|
||||
"@endingHallOfFameButton": { "description": "Hall of fame button" },
|
||||
|
||||
"endingSkip": "SKIP",
|
||||
"@endingSkip": { "description": "Skip button" },
|
||||
|
||||
"endingTapToSkip": "TAP TO SKIP",
|
||||
"@endingTapToSkip": { "description": "Tap to skip hint" }
|
||||
"@endingTapToSkip": { "description": "Tap to skip hint" },
|
||||
|
||||
"endingHoldToSpeedUp": "HOLD TO SPEED UP",
|
||||
"@endingHoldToSpeedUp": { "description": "Hold to speed up scrolling hint" },
|
||||
|
||||
"menuTitle": "MENU",
|
||||
"@menuTitle": { "description": "Menu panel title" },
|
||||
|
||||
"optionsTitle": "OPTIONS",
|
||||
"@optionsTitle": { "description": "Options menu title" },
|
||||
|
||||
"soundTitle": "SOUND",
|
||||
"@soundTitle": { "description": "Sound dialog title" },
|
||||
|
||||
"controlSection": "CONTROL",
|
||||
"@controlSection": { "description": "Control section title" },
|
||||
|
||||
"infoSection": "INFO",
|
||||
"@infoSection": { "description": "Info section title" },
|
||||
|
||||
"settingsSection": "SETTINGS",
|
||||
"@settingsSection": { "description": "Settings section title" },
|
||||
|
||||
"saveExitSection": "SAVE / EXIT",
|
||||
"@saveExitSection": { "description": "Save/Exit section title" },
|
||||
|
||||
"ok": "OK",
|
||||
"@ok": { "description": "OK button" },
|
||||
|
||||
"rechargeButton": "RECHARGE",
|
||||
"@rechargeButton": { "description": "Recharge button" },
|
||||
|
||||
"createButton": "CREATE",
|
||||
"@createButton": { "description": "Create button" },
|
||||
|
||||
"previewTitle": "PREVIEW",
|
||||
"@previewTitle": { "description": "Preview panel title" },
|
||||
|
||||
"nameTitle": "NAME",
|
||||
"@nameTitle": { "description": "Name panel title" },
|
||||
|
||||
"statsTitle": "STATS",
|
||||
"@statsTitle": { "description": "Stats panel title" },
|
||||
|
||||
"raceTitle": "RACE",
|
||||
"@raceTitle": { "description": "Race panel title" },
|
||||
|
||||
"classSection": "CLASS",
|
||||
"@classSection": { "description": "Class panel title" },
|
||||
|
||||
"bgmLabel": "BGM",
|
||||
"@bgmLabel": { "description": "BGM volume label" },
|
||||
|
||||
"sfxLabel": "SFX",
|
||||
"@sfxLabel": { "description": "SFX volume label" },
|
||||
|
||||
"hpLabel": "HP",
|
||||
"@hpLabel": { "description": "HP bar label" },
|
||||
|
||||
"mpLabel": "MP",
|
||||
"@mpLabel": { "description": "MP bar label" },
|
||||
|
||||
"expLabel": "EXP",
|
||||
"@expLabel": { "description": "EXP bar label" },
|
||||
|
||||
"notifyLevelUp": "LEVEL UP!",
|
||||
"@notifyLevelUp": { "description": "Level up notification title" },
|
||||
|
||||
"notifyLevel": "Level {level}",
|
||||
"@notifyLevel": {
|
||||
"description": "Level notification subtitle",
|
||||
"placeholders": {
|
||||
"level": { "type": "int" }
|
||||
}
|
||||
},
|
||||
|
||||
"notifyQuestComplete": "QUEST COMPLETE!",
|
||||
"@notifyQuestComplete": { "description": "Quest complete notification title" },
|
||||
|
||||
"notifyPrologueComplete": "PROLOGUE COMPLETE!",
|
||||
"@notifyPrologueComplete": { "description": "Prologue complete notification title" },
|
||||
|
||||
"notifyActComplete": "ACT {number} COMPLETE!",
|
||||
"@notifyActComplete": {
|
||||
"description": "Act complete notification title",
|
||||
"placeholders": {
|
||||
"number": { "type": "int" }
|
||||
}
|
||||
},
|
||||
|
||||
"notifyNewSpell": "NEW SPELL!",
|
||||
"@notifyNewSpell": { "description": "New spell notification title" },
|
||||
|
||||
"notifyNewEquipment": "NEW EQUIPMENT!",
|
||||
"@notifyNewEquipment": { "description": "New equipment notification title" },
|
||||
|
||||
"notifyBossDefeated": "BOSS DEFEATED!",
|
||||
"@notifyBossDefeated": { "description": "Boss defeated notification title" },
|
||||
|
||||
"rechargeRollsTitle": "RECHARGE ROLLS",
|
||||
"@rechargeRollsTitle": { "description": "Recharge rolls dialog title" },
|
||||
|
||||
"rechargeRollsFree": "Recharge 5 rolls for free?",
|
||||
"@rechargeRollsFree": { "description": "Recharge rolls free user message" },
|
||||
|
||||
"rechargeRollsAd": "Watch an ad to recharge 5 rolls?",
|
||||
"@rechargeRollsAd": { "description": "Recharge rolls ad message" },
|
||||
|
||||
"debugTitle": "DEBUG",
|
||||
"@debugTitle": { "description": "Debug section title" },
|
||||
|
||||
"debugCheatsTitle": "DEBUG CHEATS",
|
||||
"@debugCheatsTitle": { "description": "Debug cheats section title" },
|
||||
|
||||
"debugToolsTitle": "DEBUG TOOLS",
|
||||
"@debugToolsTitle": { "description": "Debug tools section title" },
|
||||
|
||||
"debugDeveloperTools": "DEVELOPER TOOLS",
|
||||
"@debugDeveloperTools": { "description": "Developer tools header" },
|
||||
|
||||
"debugSkipTask": "SKIP TASK (L+1)",
|
||||
"@debugSkipTask": { "description": "Skip task cheat label" },
|
||||
|
||||
"debugSkipTaskDesc": "Complete task instantly",
|
||||
"@debugSkipTaskDesc": { "description": "Skip task cheat description" },
|
||||
|
||||
"debugSkipQuest": "SKIP QUEST (Q!)",
|
||||
"@debugSkipQuest": { "description": "Skip quest cheat label" },
|
||||
|
||||
"debugSkipQuestDesc": "Complete quest instantly",
|
||||
"@debugSkipQuestDesc": { "description": "Skip quest cheat description" },
|
||||
|
||||
"debugSkipAct": "SKIP ACT (P!)",
|
||||
"@debugSkipAct": { "description": "Skip act cheat label" },
|
||||
|
||||
"debugSkipActDesc": "Complete act instantly",
|
||||
"@debugSkipActDesc": { "description": "Skip act cheat description" },
|
||||
|
||||
"debugCreateTestCharacter": "CREATE TEST CHARACTER",
|
||||
"@debugCreateTestCharacter": { "description": "Create test character button" },
|
||||
|
||||
"debugCreateTestCharacterDesc": "Register Level 100 character to Hall of Fame",
|
||||
"@debugCreateTestCharacterDesc": { "description": "Create test character description" },
|
||||
|
||||
"debugCreateTestCharacterTitle": "CREATE TEST CHARACTER?",
|
||||
"@debugCreateTestCharacterTitle": { "description": "Create test character dialog title" },
|
||||
|
||||
"debugCreateTestCharacterMessage": "Current character will be converted to Level 100\nand registered to the Hall of Fame.\n\n⚠️ Current save file will be deleted.\nThis action cannot be undone.",
|
||||
"@debugCreateTestCharacterMessage": { "description": "Create test character confirmation message" },
|
||||
|
||||
"debugTurbo": "DEBUG: TURBO (20x)",
|
||||
"@debugTurbo": { "description": "Debug turbo mode label" },
|
||||
|
||||
"debugIapPurchased": "IAP PURCHASED",
|
||||
"@debugIapPurchased": { "description": "IAP purchased debug toggle" },
|
||||
|
||||
"debugIapPurchasedDesc": "ON: Behave as paid user (ads removed)",
|
||||
"@debugIapPurchasedDesc": { "description": "IAP purchased debug description" },
|
||||
|
||||
"debugOfflineHours": "OFFLINE HOURS",
|
||||
"@debugOfflineHours": { "description": "Offline hours debug label" },
|
||||
|
||||
"debugOfflineHoursDesc": "Test return rewards (applies on restart)",
|
||||
"@debugOfflineHoursDesc": { "description": "Offline hours debug description" },
|
||||
|
||||
"debugTestCharacterDesc": "Modify current character to Level 100\nand register to the Hall of Fame.",
|
||||
"@debugTestCharacterDesc": { "description": "Test character creation description" },
|
||||
|
||||
"arenaTitle": "LOCAL ARENA",
|
||||
"@arenaTitle": { "description": "Arena main screen title" },
|
||||
|
||||
"arenaSelectFighter": "SELECT YOUR FIGHTER",
|
||||
"@arenaSelectFighter": { "description": "Arena character selection subtitle" },
|
||||
|
||||
"arenaEmptyTitle": "Not enough heroes",
|
||||
"@arenaEmptyTitle": { "description": "Arena empty state title" },
|
||||
|
||||
"arenaEmptyHint": "Clear the game with 2+ characters",
|
||||
"@arenaEmptyHint": { "description": "Arena empty state hint" },
|
||||
|
||||
"arenaSetupTitle": "ARENA SETUP",
|
||||
"@arenaSetupTitle": { "description": "Arena setup screen title" },
|
||||
|
||||
"arenaStartBattle": "START BATTLE",
|
||||
"@arenaStartBattle": { "description": "Start battle button" },
|
||||
|
||||
"arenaBattleTitle": "ARENA BATTLE",
|
||||
"@arenaBattleTitle": { "description": "Arena battle screen title" },
|
||||
|
||||
"arenaMyEquipment": "MY EQUIPMENT",
|
||||
"@arenaMyEquipment": { "description": "My equipment header" },
|
||||
|
||||
"arenaEnemyEquipment": "ENEMY EQUIPMENT",
|
||||
"@arenaEnemyEquipment": { "description": "Enemy equipment header" },
|
||||
|
||||
"arenaSelected": "SELECTED",
|
||||
"@arenaSelected": { "description": "Selected slot label" },
|
||||
|
||||
"arenaRecommended": "BEST",
|
||||
"@arenaRecommended": { "description": "Recommended slot label" },
|
||||
|
||||
"arenaWeaponLocked": "LOCKED",
|
||||
"@arenaWeaponLocked": { "description": "Weapon slot locked label" },
|
||||
|
||||
"arenaVictory": "VICTORY!",
|
||||
"@arenaVictory": { "description": "Arena victory title" },
|
||||
|
||||
"arenaDefeat": "DEFEAT...",
|
||||
"@arenaDefeat": { "description": "Arena defeat title" },
|
||||
|
||||
"arenaEquipmentExchange": "EQUIPMENT EXCHANGE",
|
||||
"@arenaEquipmentExchange": { "description": "Equipment exchange section title" },
|
||||
|
||||
"arenaTurns": "TURNS",
|
||||
"@arenaTurns": { "description": "Turns label" },
|
||||
|
||||
"arenaWinner": "WINNER",
|
||||
"@arenaWinner": { "description": "Winner label" },
|
||||
|
||||
"arenaLoser": "LOSER",
|
||||
"@arenaLoser": { "description": "Loser label" },
|
||||
|
||||
"arenaDefeatedIn": "{winner} defeated {loser} in {turns} TURNS",
|
||||
"@arenaDefeatedIn": {
|
||||
"description": "Battle summary text",
|
||||
"placeholders": {
|
||||
"winner": { "type": "String" },
|
||||
"loser": { "type": "String" },
|
||||
"turns": { "type": "int" }
|
||||
}
|
||||
},
|
||||
|
||||
"arenaScoreGain": "You will GAIN +{score}",
|
||||
"@arenaScoreGain": {
|
||||
"description": "Score gain prediction",
|
||||
"placeholders": {
|
||||
"score": { "type": "int" }
|
||||
}
|
||||
},
|
||||
|
||||
"arenaScoreLose": "You will LOSE {score}",
|
||||
"@arenaScoreLose": {
|
||||
"description": "Score loss prediction",
|
||||
"placeholders": {
|
||||
"score": { "type": "int" }
|
||||
}
|
||||
},
|
||||
|
||||
"arenaEvenTrade": "Even trade",
|
||||
"@arenaEvenTrade": { "description": "Even trade label" },
|
||||
|
||||
"arenaScore": "SCORE",
|
||||
"@arenaScore": { "description": "Score label" },
|
||||
|
||||
"statsStatistics": "Statistics",
|
||||
"@statsStatistics": { "description": "Statistics dialog title" },
|
||||
|
||||
"statsSession": "Session",
|
||||
"@statsSession": { "description": "Session tab label" },
|
||||
|
||||
"statsAccumulated": "Total",
|
||||
"@statsAccumulated": { "description": "Accumulated tab label" },
|
||||
|
||||
"statsCombat": "Combat",
|
||||
"@statsCombat": { "description": "Combat section title" },
|
||||
|
||||
"statsPlayTime": "Play Time",
|
||||
"@statsPlayTime": { "description": "Play time label" },
|
||||
|
||||
"statsMonstersKilled": "Monsters Killed",
|
||||
"@statsMonstersKilled": { "description": "Monsters killed label" },
|
||||
|
||||
"statsBossesDefeated": "Bosses Defeated",
|
||||
"@statsBossesDefeated": { "description": "Bosses defeated label" },
|
||||
|
||||
"statsDeaths": "Deaths",
|
||||
"@statsDeaths": { "description": "Deaths label" },
|
||||
|
||||
"statsDamage": "Damage",
|
||||
"@statsDamage": { "description": "Damage section title" },
|
||||
|
||||
"statsDamageDealt": "Damage Dealt",
|
||||
"@statsDamageDealt": { "description": "Damage dealt label" },
|
||||
|
||||
"statsDamageTaken": "Damage Taken",
|
||||
"@statsDamageTaken": { "description": "Damage taken label" },
|
||||
|
||||
"statsAverageDps": "Average DPS",
|
||||
"@statsAverageDps": { "description": "Average DPS label" },
|
||||
|
||||
"statsSkills": "Skills",
|
||||
"@statsSkills": { "description": "Skills section title" },
|
||||
|
||||
"statsSkillsUsed": "Skills Used",
|
||||
"@statsSkillsUsed": { "description": "Skills used label" },
|
||||
|
||||
"statsCriticalHits": "Critical Hits",
|
||||
"@statsCriticalHits": { "description": "Critical hits label" },
|
||||
|
||||
"statsMaxCriticalStreak": "Max Critical Streak",
|
||||
"@statsMaxCriticalStreak": { "description": "Max critical streak label" },
|
||||
|
||||
"statsCriticalRate": "Critical Rate",
|
||||
"@statsCriticalRate": { "description": "Critical rate label" },
|
||||
|
||||
"statsEconomy": "Economy",
|
||||
"@statsEconomy": { "description": "Economy section title" },
|
||||
|
||||
"statsGoldEarned": "Gold Earned",
|
||||
"@statsGoldEarned": { "description": "Gold earned label" },
|
||||
|
||||
"statsGoldSpent": "Gold Spent",
|
||||
"@statsGoldSpent": { "description": "Gold spent label" },
|
||||
|
||||
"statsItemsSold": "Items Sold",
|
||||
"@statsItemsSold": { "description": "Items sold label" },
|
||||
|
||||
"statsPotionsUsed": "Potions Used",
|
||||
"@statsPotionsUsed": { "description": "Potions used label" },
|
||||
|
||||
"statsProgress": "Progress",
|
||||
"@statsProgress": { "description": "Progress section title" },
|
||||
|
||||
"statsLevelUps": "Level Ups",
|
||||
"@statsLevelUps": { "description": "Level ups label" },
|
||||
|
||||
"statsQuestsCompleted": "Quests Completed",
|
||||
"@statsQuestsCompleted": { "description": "Quests completed label" },
|
||||
|
||||
"statsRecords": "Records",
|
||||
"@statsRecords": { "description": "Records section title" },
|
||||
|
||||
"statsHighestLevel": "Highest Level",
|
||||
"@statsHighestLevel": { "description": "Highest level label" },
|
||||
|
||||
"statsHighestGoldHeld": "Highest Gold Held",
|
||||
"@statsHighestGoldHeld": { "description": "Highest gold held label" },
|
||||
|
||||
"statsBestCriticalStreak": "Best Critical Streak",
|
||||
"@statsBestCriticalStreak": { "description": "Best critical streak label" },
|
||||
|
||||
"statsTotalPlay": "Total Play",
|
||||
"@statsTotalPlay": { "description": "Total play section title" },
|
||||
|
||||
"statsTotalPlayTime": "Total Play Time",
|
||||
"@statsTotalPlayTime": { "description": "Total play time label" },
|
||||
|
||||
"statsGamesStarted": "Games Started",
|
||||
"@statsGamesStarted": { "description": "Games started label" },
|
||||
|
||||
"statsGamesCompleted": "Games Completed",
|
||||
"@statsGamesCompleted": { "description": "Games completed label" },
|
||||
|
||||
"statsCompletionRate": "Completion Rate",
|
||||
"@statsCompletionRate": { "description": "Completion rate label" },
|
||||
|
||||
"statsTotalCombat": "Total Combat",
|
||||
"@statsTotalCombat": { "description": "Total combat section title" },
|
||||
|
||||
"statsTotalDeaths": "Total Deaths",
|
||||
"@statsTotalDeaths": { "description": "Total deaths label" },
|
||||
|
||||
"statsTotalLevelUps": "Total Level Ups",
|
||||
"@statsTotalLevelUps": { "description": "Total level ups label" },
|
||||
|
||||
"statsTotalDamage": "Total Damage",
|
||||
"@statsTotalDamage": { "description": "Total damage section title" },
|
||||
|
||||
"statsTotalSkills": "Total Skills",
|
||||
"@statsTotalSkills": { "description": "Total skills section title" },
|
||||
|
||||
"statsTotalEconomy": "Total Economy",
|
||||
"@statsTotalEconomy": { "description": "Total economy section title" },
|
||||
|
||||
"notifyLevelUpLabel": "LEVEL UP",
|
||||
"@notifyLevelUpLabel": { "description": "Level up notification type label" },
|
||||
|
||||
"notifyQuestDoneLabel": "QUEST DONE",
|
||||
"@notifyQuestDoneLabel": { "description": "Quest done notification type label" },
|
||||
|
||||
"notifyActClearLabel": "ACT CLEAR",
|
||||
"@notifyActClearLabel": { "description": "Act clear notification type label" },
|
||||
|
||||
"notifyNewSpellLabel": "NEW SPELL",
|
||||
"@notifyNewSpellLabel": { "description": "New spell notification type label" },
|
||||
|
||||
"notifyNewItemLabel": "NEW ITEM",
|
||||
"@notifyNewItemLabel": { "description": "New item notification type label" },
|
||||
|
||||
"notifyBossSlainLabel": "BOSS SLAIN",
|
||||
"@notifyBossSlainLabel": { "description": "Boss slain notification type label" },
|
||||
|
||||
"notifySavedLabel": "SAVED",
|
||||
"@notifySavedLabel": { "description": "Game saved notification type label" },
|
||||
|
||||
"notifyInfoLabel": "INFO",
|
||||
"@notifyInfoLabel": { "description": "Info notification type label" },
|
||||
|
||||
"notifyWarningLabel": "WARNING",
|
||||
"@notifyWarningLabel": { "description": "Warning notification type label" }
|
||||
}
|
||||
|
||||
@@ -1,80 +1,80 @@
|
||||
{
|
||||
"@@locale": "ja",
|
||||
|
||||
"appTitle": "ASCII NEVER DIE",
|
||||
"tagNoNetwork": "No network",
|
||||
"tagIdleRpg": "Idle RPG loop",
|
||||
"tagLocalSaves": "Local saves",
|
||||
"newCharacter": "New character",
|
||||
"loadSave": "Load save",
|
||||
"loadGame": "Load Game",
|
||||
"viewBuildPlan": "View build plan",
|
||||
"buildRoadmap": "Build roadmap",
|
||||
"techStack": "Tech stack",
|
||||
"cancel": "Cancel",
|
||||
"exitGame": "Exit Game",
|
||||
"saveProgressQuestion": "Save your progress before leaving?",
|
||||
"exitWithoutSaving": "Exit without saving",
|
||||
"saveAndExit": "Save and Exit",
|
||||
"progressQuestTitle": "ASCII NEVER DIE - {name}",
|
||||
"levelUp": "Level Up",
|
||||
"completeQuest": "Complete Quest",
|
||||
"completePlot": "Complete Plot",
|
||||
"characterSheet": "Character Sheet",
|
||||
"traits": "Traits",
|
||||
"stats": "Stats",
|
||||
"experience": "Experience",
|
||||
"xpNeededForNextLevel": "XP needed for next level",
|
||||
"appTitle": "アスキー ネバー ダイ",
|
||||
"tagNoNetwork": "オフライン",
|
||||
"tagIdleRpg": "放置型RPG",
|
||||
"tagLocalSaves": "ローカル保存",
|
||||
"newCharacter": "新規キャラクター",
|
||||
"loadSave": "ロード",
|
||||
"loadGame": "ゲームをロード",
|
||||
"viewBuildPlan": "ビルド計画を見る",
|
||||
"buildRoadmap": "ビルドロードマップ",
|
||||
"techStack": "技術スタック",
|
||||
"cancel": "キャンセル",
|
||||
"exitGame": "ゲーム終了",
|
||||
"saveProgressQuestion": "終了する前にセーブしますか?",
|
||||
"exitWithoutSaving": "セーブせずに終了",
|
||||
"saveAndExit": "セーブして終了",
|
||||
"progressQuestTitle": "アスキー ネバー ダイ - {name}",
|
||||
"levelUp": "レベルアップ",
|
||||
"completeQuest": "クエスト完了",
|
||||
"completePlot": "プロット完了",
|
||||
"characterSheet": "キャラクターシート",
|
||||
"traits": "特性",
|
||||
"stats": "能力値",
|
||||
"experience": "経験値",
|
||||
"xpNeededForNextLevel": "次のレベルまでの必要XP",
|
||||
"spellBook": "スキル",
|
||||
"noSpellsYet": "習得したスキルがありません",
|
||||
"equipment": "Equipment",
|
||||
"inventory": "Inventory",
|
||||
"encumbrance": "Encumbrance",
|
||||
"equipment": "装備",
|
||||
"inventory": "インベントリ",
|
||||
"encumbrance": "積載量",
|
||||
"combatLog": "戦闘ログ",
|
||||
"plotDevelopment": "Plot Development",
|
||||
"quests": "Quests",
|
||||
"traitName": "Name",
|
||||
"traitRace": "Race",
|
||||
"traitClass": "Class",
|
||||
"traitLevel": "Level",
|
||||
"plotDevelopment": "ストーリー進行",
|
||||
"quests": "クエスト",
|
||||
"traitName": "名前",
|
||||
"traitRace": "種族",
|
||||
"traitClass": "職業",
|
||||
"traitLevel": "レベル",
|
||||
"statStr": "STR",
|
||||
"statCon": "CON",
|
||||
"statDex": "DEX",
|
||||
"statInt": "INT",
|
||||
"statWis": "WIS",
|
||||
"statCha": "CHA",
|
||||
"statHpMax": "HP Max",
|
||||
"statMpMax": "MP Max",
|
||||
"equipWeapon": "Weapon",
|
||||
"equipShield": "Shield",
|
||||
"equipHelm": "Helm",
|
||||
"equipHauberk": "Hauberk",
|
||||
"equipBrassairts": "Brassairts",
|
||||
"equipVambraces": "Vambraces",
|
||||
"equipGauntlets": "Gauntlets",
|
||||
"equipGambeson": "Gambeson",
|
||||
"equipCuisses": "Cuisses",
|
||||
"equipGreaves": "Greaves",
|
||||
"equipSollerets": "Sollerets",
|
||||
"statHpMax": "HP最大",
|
||||
"statMpMax": "MP最大",
|
||||
"equipWeapon": "武器",
|
||||
"equipShield": "盾",
|
||||
"equipHelm": "兜",
|
||||
"equipHauberk": "鎧",
|
||||
"equipBrassairts": "肩当て",
|
||||
"equipVambraces": "腕甲",
|
||||
"equipGauntlets": "篭手",
|
||||
"equipGambeson": "防護服",
|
||||
"equipCuisses": "腿当て",
|
||||
"equipGreaves": "脛当て",
|
||||
"equipSollerets": "鉄靴",
|
||||
"gold": "コイン",
|
||||
"goldAmount": "コイン: {amount}",
|
||||
"prologue": "Prologue",
|
||||
"actNumber": "Act {number}",
|
||||
"noActiveQuests": "No active quests",
|
||||
"questNumber": "Quest #{number}",
|
||||
"prologue": "プロローグ",
|
||||
"actNumber": "第{number}幕",
|
||||
"noActiveQuests": "進行中のクエストなし",
|
||||
"questNumber": "クエスト #{number}",
|
||||
"welcomeMessage": "ASCII NEVER DIEへようこそ!",
|
||||
"noSavedGames": "No saved games found.",
|
||||
"loadError": "Failed to load save file: {error}",
|
||||
"name": "Name",
|
||||
"generateName": "Generate Name",
|
||||
"total": "Total",
|
||||
"unroll": "Unroll",
|
||||
"roll": "Roll",
|
||||
"race": "Race",
|
||||
"classTitle": "Class",
|
||||
"percentComplete": "{percent}% complete",
|
||||
"newCharacterTitle": "ASCII NEVER DIE - New Character",
|
||||
"soldButton": "Sold!",
|
||||
"noSavedGames": "セーブデータがありません。",
|
||||
"loadError": "セーブファイルの読み込みに失敗しました: {error}",
|
||||
"name": "名前",
|
||||
"generateName": "名前を生成",
|
||||
"total": "合計",
|
||||
"unroll": "元に戻す",
|
||||
"roll": "ロール",
|
||||
"race": "種族",
|
||||
"classTitle": "職業",
|
||||
"percentComplete": "{percent}% 完了",
|
||||
"newCharacterTitle": "アスキー ネバー ダイ - 新規キャラクター",
|
||||
"soldButton": "決定!",
|
||||
|
||||
"endingCongratulations": "★ おめでとうございます ★",
|
||||
"endingGameComplete": "ゲームをクリアしました!",
|
||||
@@ -90,6 +90,135 @@
|
||||
"endingLegendLivesOn": "あなたの伝説は続く...",
|
||||
"endingHallOfFameLine1": "あなたの英雄的な功績は",
|
||||
"endingHallOfFameLine2": "殿堂に記録されます",
|
||||
"endingHallOfFameButton": "殿堂入り",
|
||||
"endingSkip": "スキップ",
|
||||
"endingTapToSkip": "タップでスキップ"
|
||||
"endingTapToSkip": "タップでスキップ",
|
||||
"endingHoldToSpeedUp": "長押しで高速スクロール",
|
||||
|
||||
"menuTitle": "メニュー",
|
||||
"optionsTitle": "オプション",
|
||||
"soundTitle": "サウンド",
|
||||
"controlSection": "操作",
|
||||
"infoSection": "情報",
|
||||
"settingsSection": "設定",
|
||||
"saveExitSection": "セーブ / 終了",
|
||||
"ok": "OK",
|
||||
"rechargeButton": "チャージ",
|
||||
"createButton": "作成",
|
||||
"previewTitle": "プレビュー",
|
||||
"nameTitle": "名前",
|
||||
"statsTitle": "能力値",
|
||||
"raceTitle": "種族",
|
||||
"classSection": "職業",
|
||||
"bgmLabel": "BGM",
|
||||
"sfxLabel": "効果音",
|
||||
"hpLabel": "HP",
|
||||
"mpLabel": "MP",
|
||||
"expLabel": "EXP",
|
||||
"notifyLevelUp": "レベルアップ!",
|
||||
"notifyLevel": "レベル {level}",
|
||||
"notifyQuestComplete": "クエスト完了!",
|
||||
"notifyPrologueComplete": "プロローグ完了!",
|
||||
"notifyActComplete": "第{number}幕 完了!",
|
||||
"notifyNewSpell": "新しいスキル!",
|
||||
"notifyNewEquipment": "新しい装備!",
|
||||
"notifyBossDefeated": "ボス撃破!",
|
||||
"rechargeRollsTitle": "ロール回数チャージ",
|
||||
"rechargeRollsFree": "無料で5回チャージしますか?",
|
||||
"rechargeRollsAd": "広告を見て5回チャージしますか?",
|
||||
"debugTitle": "デバッグ",
|
||||
"debugCheatsTitle": "デバッグチート",
|
||||
"debugToolsTitle": "デバッグツール",
|
||||
"debugDeveloperTools": "開発者ツール",
|
||||
"debugSkipTask": "タスクスキップ (L+1)",
|
||||
"debugSkipTaskDesc": "タスクを即時完了",
|
||||
"debugSkipQuest": "クエストスキップ (Q!)",
|
||||
"debugSkipQuestDesc": "クエストを即時完了",
|
||||
"debugSkipAct": "アクトスキップ (P!)",
|
||||
"debugSkipActDesc": "アクトを即時完了",
|
||||
"debugCreateTestCharacter": "テストキャラクター作成",
|
||||
"debugCreateTestCharacterDesc": "レベル100キャラクターを殿堂に登録",
|
||||
"debugCreateTestCharacterTitle": "テストキャラクターを作成しますか?",
|
||||
"debugCreateTestCharacterMessage": "現在のキャラクターがレベル100に変換され\n殿堂に登録されます。\n\n⚠️ 現在のセーブファイルは削除されます。\nこの操作は元に戻せません。",
|
||||
"debugTurbo": "デバッグ: ターボ (20x)",
|
||||
"debugIapPurchased": "IAP購入済み",
|
||||
"debugIapPurchasedDesc": "ON: 有料ユーザーとして動作(広告非表示)",
|
||||
"debugOfflineHours": "オフライン時間",
|
||||
"debugOfflineHoursDesc": "復帰報酬テスト(再起動時に適用)",
|
||||
"debugTestCharacterDesc": "現在のキャラクターをレベル100に変更して\n殿堂に登録します。",
|
||||
|
||||
"arenaTitle": "ローカルアリーナ",
|
||||
"arenaSelectFighter": "ファイターを選択",
|
||||
"arenaEmptyTitle": "ヒーローが不足しています",
|
||||
"arenaEmptyHint": "2人以上のキャラでクリアしてください",
|
||||
"arenaSetupTitle": "アリーナ設定",
|
||||
"arenaStartBattle": "バトル開始",
|
||||
"arenaBattleTitle": "アリーナバトル",
|
||||
"arenaMyEquipment": "自分の装備",
|
||||
"arenaEnemyEquipment": "敵の装備",
|
||||
"arenaSelected": "選択済み",
|
||||
"arenaRecommended": "おすすめ",
|
||||
"arenaWeaponLocked": "ロック",
|
||||
"arenaVictory": "勝利!",
|
||||
"arenaDefeat": "敗北...",
|
||||
"arenaEquipmentExchange": "装備交換",
|
||||
"arenaTurns": "ターン",
|
||||
"arenaWinner": "勝者",
|
||||
"arenaLoser": "敗者",
|
||||
"arenaDefeatedIn": "{winner}が{loser}を{turns}ターンで撃破",
|
||||
"arenaScoreGain": "+{score}獲得予定",
|
||||
"arenaScoreLose": "{score}損失予定",
|
||||
"arenaEvenTrade": "等価交換",
|
||||
"arenaScore": "スコア",
|
||||
|
||||
"statsStatistics": "統計",
|
||||
"statsSession": "セッション",
|
||||
"statsAccumulated": "累積",
|
||||
"statsCombat": "戦闘",
|
||||
"statsPlayTime": "プレイ時間",
|
||||
"statsMonstersKilled": "倒したモンスター",
|
||||
"statsBossesDefeated": "ボス討伐",
|
||||
"statsDeaths": "死亡回数",
|
||||
"statsDamage": "ダメージ",
|
||||
"statsDamageDealt": "与えたダメージ",
|
||||
"statsDamageTaken": "受けたダメージ",
|
||||
"statsAverageDps": "平均DPS",
|
||||
"statsSkills": "スキル",
|
||||
"statsSkillsUsed": "スキル使用",
|
||||
"statsCriticalHits": "クリティカルヒット",
|
||||
"statsMaxCriticalStreak": "最大連続クリティカル",
|
||||
"statsCriticalRate": "クリティカル率",
|
||||
"statsEconomy": "経済",
|
||||
"statsGoldEarned": "獲得ゴールド",
|
||||
"statsGoldSpent": "消費ゴールド",
|
||||
"statsItemsSold": "売却アイテム",
|
||||
"statsPotionsUsed": "ポーション使用",
|
||||
"statsProgress": "進行",
|
||||
"statsLevelUps": "レベルアップ",
|
||||
"statsQuestsCompleted": "完了したクエスト",
|
||||
"statsRecords": "記録",
|
||||
"statsHighestLevel": "最高レベル",
|
||||
"statsHighestGoldHeld": "最大所持ゴールド",
|
||||
"statsBestCriticalStreak": "最高連続クリティカル",
|
||||
"statsTotalPlay": "総プレイ",
|
||||
"statsTotalPlayTime": "総プレイ時間",
|
||||
"statsGamesStarted": "開始したゲーム",
|
||||
"statsGamesCompleted": "クリアしたゲーム",
|
||||
"statsCompletionRate": "クリア率",
|
||||
"statsTotalCombat": "総戦闘",
|
||||
"statsTotalDeaths": "総死亡",
|
||||
"statsTotalLevelUps": "総レベルアップ",
|
||||
"statsTotalDamage": "総ダメージ",
|
||||
"statsTotalSkills": "総スキル",
|
||||
"statsTotalEconomy": "総経済",
|
||||
|
||||
"notifyLevelUpLabel": "レベルアップ",
|
||||
"notifyQuestDoneLabel": "クエスト完了",
|
||||
"notifyActClearLabel": "幕完了",
|
||||
"notifyNewSpellLabel": "新しいスキル",
|
||||
"notifyNewItemLabel": "新しいアイテム",
|
||||
"notifyBossSlainLabel": "ボス撃破",
|
||||
"notifySavedLabel": "セーブ済み",
|
||||
"notifyInfoLabel": "情報",
|
||||
"notifyWarningLabel": "警告"
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
"name": "이름",
|
||||
"generateName": "이름 생성",
|
||||
"total": "합계",
|
||||
"unroll": "펼치기",
|
||||
"unroll": "되돌리기",
|
||||
"roll": "굴리기",
|
||||
"race": "종족",
|
||||
"classTitle": "직업",
|
||||
@@ -90,6 +90,135 @@
|
||||
"endingLegendLivesOn": "당신의 전설은 계속됩니다...",
|
||||
"endingHallOfFameLine1": "당신의 영웅적인 업적이",
|
||||
"endingHallOfFameLine2": "명예의 전당에 기록됩니다",
|
||||
"endingHallOfFameButton": "명예의 전당",
|
||||
"endingSkip": "건너뛰기",
|
||||
"endingTapToSkip": "탭하여 건너뛰기"
|
||||
"endingTapToSkip": "탭하여 건너뛰기",
|
||||
"endingHoldToSpeedUp": "길게 누르면 빨리 스크롤",
|
||||
|
||||
"menuTitle": "메뉴",
|
||||
"optionsTitle": "옵션",
|
||||
"soundTitle": "사운드",
|
||||
"controlSection": "제어",
|
||||
"infoSection": "정보",
|
||||
"settingsSection": "설정",
|
||||
"saveExitSection": "저장 / 종료",
|
||||
"ok": "확인",
|
||||
"rechargeButton": "충전",
|
||||
"createButton": "생성",
|
||||
"previewTitle": "미리보기",
|
||||
"nameTitle": "이름",
|
||||
"statsTitle": "능력치",
|
||||
"raceTitle": "종족",
|
||||
"classSection": "직업",
|
||||
"bgmLabel": "BGM",
|
||||
"sfxLabel": "효과음",
|
||||
"hpLabel": "HP",
|
||||
"mpLabel": "MP",
|
||||
"expLabel": "경험치",
|
||||
"notifyLevelUp": "레벨 업!",
|
||||
"notifyLevel": "레벨 {level}",
|
||||
"notifyQuestComplete": "퀘스트 완료!",
|
||||
"notifyPrologueComplete": "프롤로그 완료!",
|
||||
"notifyActComplete": "{number}막 완료!",
|
||||
"notifyNewSpell": "새 주문!",
|
||||
"notifyNewEquipment": "새 장비!",
|
||||
"notifyBossDefeated": "보스 처치!",
|
||||
"rechargeRollsTitle": "굴리기 충전",
|
||||
"rechargeRollsFree": "무료로 5회 충전하시겠습니까?",
|
||||
"rechargeRollsAd": "광고를 보고 5회 충전하시겠습니까?",
|
||||
"debugTitle": "디버그",
|
||||
"debugCheatsTitle": "디버그 치트",
|
||||
"debugToolsTitle": "디버그 도구",
|
||||
"debugDeveloperTools": "개발자 도구",
|
||||
"debugSkipTask": "태스크 건너뛰기 (L+1)",
|
||||
"debugSkipTaskDesc": "태스크 즉시 완료",
|
||||
"debugSkipQuest": "퀘스트 건너뛰기 (Q!)",
|
||||
"debugSkipQuestDesc": "퀘스트 즉시 완료",
|
||||
"debugSkipAct": "액트 건너뛰기 (P!)",
|
||||
"debugSkipActDesc": "액트 즉시 완료",
|
||||
"debugCreateTestCharacter": "테스트 캐릭터 생성",
|
||||
"debugCreateTestCharacterDesc": "레벨 100 캐릭터를 명예의 전당에 등록",
|
||||
"debugCreateTestCharacterTitle": "테스트 캐릭터 생성?",
|
||||
"debugCreateTestCharacterMessage": "현재 캐릭터가 레벨 100으로 변환되어\n명예의 전당에 등록됩니다.\n\n⚠️ 현재 세이브 파일이 삭제됩니다.\n이 작업은 되돌릴 수 없습니다.",
|
||||
"debugTurbo": "디버그: 터보 (20x)",
|
||||
"debugIapPurchased": "IAP 구매됨",
|
||||
"debugIapPurchasedDesc": "ON: 유료 유저로 동작 (광고 제거)",
|
||||
"debugOfflineHours": "오프라인 시간",
|
||||
"debugOfflineHoursDesc": "복귀 보상 테스트 (재시작 시 적용)",
|
||||
"debugTestCharacterDesc": "현재 캐릭터를 레벨 100으로 수정하여\n명예의 전당에 등록합니다.",
|
||||
|
||||
"arenaTitle": "로컬 아레나",
|
||||
"arenaSelectFighter": "전사를 선택하세요",
|
||||
"arenaEmptyTitle": "영웅이 부족합니다",
|
||||
"arenaEmptyHint": "2명 이상 캐릭터로 클리어하세요",
|
||||
"arenaSetupTitle": "아레나 설정",
|
||||
"arenaStartBattle": "전투 시작",
|
||||
"arenaBattleTitle": "아레나 전투",
|
||||
"arenaMyEquipment": "내 장비",
|
||||
"arenaEnemyEquipment": "상대 장비",
|
||||
"arenaSelected": "선택됨",
|
||||
"arenaRecommended": "추천",
|
||||
"arenaWeaponLocked": "잠김",
|
||||
"arenaVictory": "승리!",
|
||||
"arenaDefeat": "패배...",
|
||||
"arenaEquipmentExchange": "장비 교환",
|
||||
"arenaTurns": "턴",
|
||||
"arenaWinner": "승자",
|
||||
"arenaLoser": "패자",
|
||||
"arenaDefeatedIn": "{winner}이(가) {loser}을(를) {turns}턴 만에 격파",
|
||||
"arenaScoreGain": "+{score} 획득 예정",
|
||||
"arenaScoreLose": "{score} 손실 예정",
|
||||
"arenaEvenTrade": "등가 교환",
|
||||
"arenaScore": "점수",
|
||||
|
||||
"statsStatistics": "통계",
|
||||
"statsSession": "세션",
|
||||
"statsAccumulated": "누적",
|
||||
"statsCombat": "전투",
|
||||
"statsPlayTime": "플레이 시간",
|
||||
"statsMonstersKilled": "처치한 몬스터",
|
||||
"statsBossesDefeated": "보스 처치",
|
||||
"statsDeaths": "사망 횟수",
|
||||
"statsDamage": "데미지",
|
||||
"statsDamageDealt": "입힌 데미지",
|
||||
"statsDamageTaken": "받은 데미지",
|
||||
"statsAverageDps": "평균 DPS",
|
||||
"statsSkills": "스킬",
|
||||
"statsSkillsUsed": "스킬 사용",
|
||||
"statsCriticalHits": "크리티컬 히트",
|
||||
"statsMaxCriticalStreak": "최대 연속 크리티컬",
|
||||
"statsCriticalRate": "크리티컬 비율",
|
||||
"statsEconomy": "경제",
|
||||
"statsGoldEarned": "획득 골드",
|
||||
"statsGoldSpent": "소비 골드",
|
||||
"statsItemsSold": "판매 아이템",
|
||||
"statsPotionsUsed": "물약 사용",
|
||||
"statsProgress": "진행",
|
||||
"statsLevelUps": "레벨업",
|
||||
"statsQuestsCompleted": "완료한 퀘스트",
|
||||
"statsRecords": "기록",
|
||||
"statsHighestLevel": "최고 레벨",
|
||||
"statsHighestGoldHeld": "최대 보유 골드",
|
||||
"statsBestCriticalStreak": "최고 연속 크리티컬",
|
||||
"statsTotalPlay": "총 플레이",
|
||||
"statsTotalPlayTime": "총 플레이 시간",
|
||||
"statsGamesStarted": "시작한 게임",
|
||||
"statsGamesCompleted": "클리어한 게임",
|
||||
"statsCompletionRate": "클리어율",
|
||||
"statsTotalCombat": "총 전투",
|
||||
"statsTotalDeaths": "총 사망",
|
||||
"statsTotalLevelUps": "총 레벨업",
|
||||
"statsTotalDamage": "총 데미지",
|
||||
"statsTotalSkills": "총 스킬",
|
||||
"statsTotalEconomy": "총 경제",
|
||||
|
||||
"notifyLevelUpLabel": "레벨 업",
|
||||
"notifyQuestDoneLabel": "퀘스트 완료",
|
||||
"notifyActClearLabel": "막 완료",
|
||||
"notifyNewSpellLabel": "새 주문",
|
||||
"notifyNewItemLabel": "새 아이템",
|
||||
"notifyBossSlainLabel": "보스 처치",
|
||||
"notifySavedLabel": "저장됨",
|
||||
"notifyInfoLabel": "정보",
|
||||
"notifyWarningLabel": "경고"
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:intl/intl.dart' as intl;
|
||||
import 'app_localizations_en.dart';
|
||||
import 'app_localizations_ja.dart';
|
||||
import 'app_localizations_ko.dart';
|
||||
import 'app_localizations_zh.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -98,7 +97,6 @@ abstract class L10n {
|
||||
Locale('en'),
|
||||
Locale('ja'),
|
||||
Locale('ko'),
|
||||
Locale('zh'),
|
||||
];
|
||||
|
||||
/// Application title
|
||||
@@ -503,10 +501,10 @@ abstract class L10n {
|
||||
/// **'Total'**
|
||||
String get total;
|
||||
|
||||
/// Unroll button
|
||||
/// Undo button for stat reroll
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Unroll'**
|
||||
/// **'Undo'**
|
||||
String get unroll;
|
||||
|
||||
/// Roll button
|
||||
@@ -629,6 +627,12 @@ abstract class L10n {
|
||||
/// **'remembered in the Hall of Fame'**
|
||||
String get endingHallOfFameLine2;
|
||||
|
||||
/// Hall of fame button
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'HALL OF FAME'**
|
||||
String get endingHallOfFameButton;
|
||||
|
||||
/// Skip button
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
@@ -640,6 +644,750 @@ abstract class L10n {
|
||||
/// In en, this message translates to:
|
||||
/// **'TAP TO SKIP'**
|
||||
String get endingTapToSkip;
|
||||
|
||||
/// Hold to speed up scrolling hint
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'HOLD TO SPEED UP'**
|
||||
String get endingHoldToSpeedUp;
|
||||
|
||||
/// Menu panel title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'MENU'**
|
||||
String get menuTitle;
|
||||
|
||||
/// Options menu title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'OPTIONS'**
|
||||
String get optionsTitle;
|
||||
|
||||
/// Sound dialog title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SOUND'**
|
||||
String get soundTitle;
|
||||
|
||||
/// Control section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'CONTROL'**
|
||||
String get controlSection;
|
||||
|
||||
/// Info section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'INFO'**
|
||||
String get infoSection;
|
||||
|
||||
/// Settings section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SETTINGS'**
|
||||
String get settingsSection;
|
||||
|
||||
/// Save/Exit section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SAVE / EXIT'**
|
||||
String get saveExitSection;
|
||||
|
||||
/// OK button
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'OK'**
|
||||
String get ok;
|
||||
|
||||
/// Recharge button
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'RECHARGE'**
|
||||
String get rechargeButton;
|
||||
|
||||
/// Create button
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'CREATE'**
|
||||
String get createButton;
|
||||
|
||||
/// Preview panel title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'PREVIEW'**
|
||||
String get previewTitle;
|
||||
|
||||
/// Name panel title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'NAME'**
|
||||
String get nameTitle;
|
||||
|
||||
/// Stats panel title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'STATS'**
|
||||
String get statsTitle;
|
||||
|
||||
/// Race panel title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'RACE'**
|
||||
String get raceTitle;
|
||||
|
||||
/// Class panel title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'CLASS'**
|
||||
String get classSection;
|
||||
|
||||
/// BGM volume label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'BGM'**
|
||||
String get bgmLabel;
|
||||
|
||||
/// SFX volume label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SFX'**
|
||||
String get sfxLabel;
|
||||
|
||||
/// HP bar label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'HP'**
|
||||
String get hpLabel;
|
||||
|
||||
/// MP bar label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'MP'**
|
||||
String get mpLabel;
|
||||
|
||||
/// EXP bar label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'EXP'**
|
||||
String get expLabel;
|
||||
|
||||
/// Level up notification title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'LEVEL UP!'**
|
||||
String get notifyLevelUp;
|
||||
|
||||
/// Level notification subtitle
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Level {level}'**
|
||||
String notifyLevel(int level);
|
||||
|
||||
/// Quest complete notification title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'QUEST COMPLETE!'**
|
||||
String get notifyQuestComplete;
|
||||
|
||||
/// Prologue complete notification title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'PROLOGUE COMPLETE!'**
|
||||
String get notifyPrologueComplete;
|
||||
|
||||
/// Act complete notification title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'ACT {number} COMPLETE!'**
|
||||
String notifyActComplete(int number);
|
||||
|
||||
/// New spell notification title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'NEW SPELL!'**
|
||||
String get notifyNewSpell;
|
||||
|
||||
/// New equipment notification title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'NEW EQUIPMENT!'**
|
||||
String get notifyNewEquipment;
|
||||
|
||||
/// Boss defeated notification title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'BOSS DEFEATED!'**
|
||||
String get notifyBossDefeated;
|
||||
|
||||
/// Recharge rolls dialog title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'RECHARGE ROLLS'**
|
||||
String get rechargeRollsTitle;
|
||||
|
||||
/// Recharge rolls free user message
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Recharge 5 rolls for free?'**
|
||||
String get rechargeRollsFree;
|
||||
|
||||
/// Recharge rolls ad message
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Watch an ad to recharge 5 rolls?'**
|
||||
String get rechargeRollsAd;
|
||||
|
||||
/// Debug section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'DEBUG'**
|
||||
String get debugTitle;
|
||||
|
||||
/// Debug cheats section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'DEBUG CHEATS'**
|
||||
String get debugCheatsTitle;
|
||||
|
||||
/// Debug tools section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'DEBUG TOOLS'**
|
||||
String get debugToolsTitle;
|
||||
|
||||
/// Developer tools header
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'DEVELOPER TOOLS'**
|
||||
String get debugDeveloperTools;
|
||||
|
||||
/// Skip task cheat label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SKIP TASK (L+1)'**
|
||||
String get debugSkipTask;
|
||||
|
||||
/// Skip task cheat description
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Complete task instantly'**
|
||||
String get debugSkipTaskDesc;
|
||||
|
||||
/// Skip quest cheat label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SKIP QUEST (Q!)'**
|
||||
String get debugSkipQuest;
|
||||
|
||||
/// Skip quest cheat description
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Complete quest instantly'**
|
||||
String get debugSkipQuestDesc;
|
||||
|
||||
/// Skip act cheat label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SKIP ACT (P!)'**
|
||||
String get debugSkipAct;
|
||||
|
||||
/// Skip act cheat description
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Complete act instantly'**
|
||||
String get debugSkipActDesc;
|
||||
|
||||
/// Create test character button
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'CREATE TEST CHARACTER'**
|
||||
String get debugCreateTestCharacter;
|
||||
|
||||
/// Create test character description
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Register Level 100 character to Hall of Fame'**
|
||||
String get debugCreateTestCharacterDesc;
|
||||
|
||||
/// Create test character dialog title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'CREATE TEST CHARACTER?'**
|
||||
String get debugCreateTestCharacterTitle;
|
||||
|
||||
/// Create test character confirmation message
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Current character will be converted to Level 100\nand registered to the Hall of Fame.\n\n⚠️ Current save file will be deleted.\nThis action cannot be undone.'**
|
||||
String get debugCreateTestCharacterMessage;
|
||||
|
||||
/// Debug turbo mode label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'DEBUG: TURBO (20x)'**
|
||||
String get debugTurbo;
|
||||
|
||||
/// IAP purchased debug toggle
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'IAP PURCHASED'**
|
||||
String get debugIapPurchased;
|
||||
|
||||
/// IAP purchased debug description
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'ON: Behave as paid user (ads removed)'**
|
||||
String get debugIapPurchasedDesc;
|
||||
|
||||
/// Offline hours debug label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'OFFLINE HOURS'**
|
||||
String get debugOfflineHours;
|
||||
|
||||
/// Offline hours debug description
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Test return rewards (applies on restart)'**
|
||||
String get debugOfflineHoursDesc;
|
||||
|
||||
/// Test character creation description
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Modify current character to Level 100\nand register to the Hall of Fame.'**
|
||||
String get debugTestCharacterDesc;
|
||||
|
||||
/// Arena main screen title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'LOCAL ARENA'**
|
||||
String get arenaTitle;
|
||||
|
||||
/// Arena character selection subtitle
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SELECT YOUR FIGHTER'**
|
||||
String get arenaSelectFighter;
|
||||
|
||||
/// Arena empty state title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Not enough heroes'**
|
||||
String get arenaEmptyTitle;
|
||||
|
||||
/// Arena empty state hint
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Clear the game with 2+ characters'**
|
||||
String get arenaEmptyHint;
|
||||
|
||||
/// Arena setup screen title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'ARENA SETUP'**
|
||||
String get arenaSetupTitle;
|
||||
|
||||
/// Start battle button
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'START BATTLE'**
|
||||
String get arenaStartBattle;
|
||||
|
||||
/// Arena battle screen title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'ARENA BATTLE'**
|
||||
String get arenaBattleTitle;
|
||||
|
||||
/// My equipment header
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'MY EQUIPMENT'**
|
||||
String get arenaMyEquipment;
|
||||
|
||||
/// Enemy equipment header
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'ENEMY EQUIPMENT'**
|
||||
String get arenaEnemyEquipment;
|
||||
|
||||
/// Selected slot label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SELECTED'**
|
||||
String get arenaSelected;
|
||||
|
||||
/// Recommended slot label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'BEST'**
|
||||
String get arenaRecommended;
|
||||
|
||||
/// Weapon slot locked label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'LOCKED'**
|
||||
String get arenaWeaponLocked;
|
||||
|
||||
/// Arena victory title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'VICTORY!'**
|
||||
String get arenaVictory;
|
||||
|
||||
/// Arena defeat title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'DEFEAT...'**
|
||||
String get arenaDefeat;
|
||||
|
||||
/// Equipment exchange section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'EQUIPMENT EXCHANGE'**
|
||||
String get arenaEquipmentExchange;
|
||||
|
||||
/// Turns label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'TURNS'**
|
||||
String get arenaTurns;
|
||||
|
||||
/// Winner label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'WINNER'**
|
||||
String get arenaWinner;
|
||||
|
||||
/// Loser label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'LOSER'**
|
||||
String get arenaLoser;
|
||||
|
||||
/// Battle summary text
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'{winner} defeated {loser} in {turns} TURNS'**
|
||||
String arenaDefeatedIn(String winner, String loser, int turns);
|
||||
|
||||
/// Score gain prediction
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'You will GAIN +{score}'**
|
||||
String arenaScoreGain(int score);
|
||||
|
||||
/// Score loss prediction
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'You will LOSE {score}'**
|
||||
String arenaScoreLose(int score);
|
||||
|
||||
/// Even trade label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Even trade'**
|
||||
String get arenaEvenTrade;
|
||||
|
||||
/// Score label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SCORE'**
|
||||
String get arenaScore;
|
||||
|
||||
/// Statistics dialog title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Statistics'**
|
||||
String get statsStatistics;
|
||||
|
||||
/// Session tab label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Session'**
|
||||
String get statsSession;
|
||||
|
||||
/// Accumulated tab label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Total'**
|
||||
String get statsAccumulated;
|
||||
|
||||
/// Combat section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Combat'**
|
||||
String get statsCombat;
|
||||
|
||||
/// Play time label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Play Time'**
|
||||
String get statsPlayTime;
|
||||
|
||||
/// Monsters killed label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Monsters Killed'**
|
||||
String get statsMonstersKilled;
|
||||
|
||||
/// Bosses defeated label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Bosses Defeated'**
|
||||
String get statsBossesDefeated;
|
||||
|
||||
/// Deaths label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Deaths'**
|
||||
String get statsDeaths;
|
||||
|
||||
/// Damage section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Damage'**
|
||||
String get statsDamage;
|
||||
|
||||
/// Damage dealt label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Damage Dealt'**
|
||||
String get statsDamageDealt;
|
||||
|
||||
/// Damage taken label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Damage Taken'**
|
||||
String get statsDamageTaken;
|
||||
|
||||
/// Average DPS label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Average DPS'**
|
||||
String get statsAverageDps;
|
||||
|
||||
/// Skills section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Skills'**
|
||||
String get statsSkills;
|
||||
|
||||
/// Skills used label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Skills Used'**
|
||||
String get statsSkillsUsed;
|
||||
|
||||
/// Critical hits label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Critical Hits'**
|
||||
String get statsCriticalHits;
|
||||
|
||||
/// Max critical streak label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Max Critical Streak'**
|
||||
String get statsMaxCriticalStreak;
|
||||
|
||||
/// Critical rate label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Critical Rate'**
|
||||
String get statsCriticalRate;
|
||||
|
||||
/// Economy section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Economy'**
|
||||
String get statsEconomy;
|
||||
|
||||
/// Gold earned label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Gold Earned'**
|
||||
String get statsGoldEarned;
|
||||
|
||||
/// Gold spent label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Gold Spent'**
|
||||
String get statsGoldSpent;
|
||||
|
||||
/// Items sold label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Items Sold'**
|
||||
String get statsItemsSold;
|
||||
|
||||
/// Potions used label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Potions Used'**
|
||||
String get statsPotionsUsed;
|
||||
|
||||
/// Progress section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Progress'**
|
||||
String get statsProgress;
|
||||
|
||||
/// Level ups label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Level Ups'**
|
||||
String get statsLevelUps;
|
||||
|
||||
/// Quests completed label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Quests Completed'**
|
||||
String get statsQuestsCompleted;
|
||||
|
||||
/// Records section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Records'**
|
||||
String get statsRecords;
|
||||
|
||||
/// Highest level label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Highest Level'**
|
||||
String get statsHighestLevel;
|
||||
|
||||
/// Highest gold held label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Highest Gold Held'**
|
||||
String get statsHighestGoldHeld;
|
||||
|
||||
/// Best critical streak label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Best Critical Streak'**
|
||||
String get statsBestCriticalStreak;
|
||||
|
||||
/// Total play section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Total Play'**
|
||||
String get statsTotalPlay;
|
||||
|
||||
/// Total play time label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Total Play Time'**
|
||||
String get statsTotalPlayTime;
|
||||
|
||||
/// Games started label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Games Started'**
|
||||
String get statsGamesStarted;
|
||||
|
||||
/// Games completed label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Games Completed'**
|
||||
String get statsGamesCompleted;
|
||||
|
||||
/// Completion rate label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Completion Rate'**
|
||||
String get statsCompletionRate;
|
||||
|
||||
/// Total combat section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Total Combat'**
|
||||
String get statsTotalCombat;
|
||||
|
||||
/// Total deaths label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Total Deaths'**
|
||||
String get statsTotalDeaths;
|
||||
|
||||
/// Total level ups label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Total Level Ups'**
|
||||
String get statsTotalLevelUps;
|
||||
|
||||
/// Total damage section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Total Damage'**
|
||||
String get statsTotalDamage;
|
||||
|
||||
/// Total skills section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Total Skills'**
|
||||
String get statsTotalSkills;
|
||||
|
||||
/// Total economy section title
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Total Economy'**
|
||||
String get statsTotalEconomy;
|
||||
|
||||
/// Level up notification type label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'LEVEL UP'**
|
||||
String get notifyLevelUpLabel;
|
||||
|
||||
/// Quest done notification type label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'QUEST DONE'**
|
||||
String get notifyQuestDoneLabel;
|
||||
|
||||
/// Act clear notification type label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'ACT CLEAR'**
|
||||
String get notifyActClearLabel;
|
||||
|
||||
/// New spell notification type label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'NEW SPELL'**
|
||||
String get notifyNewSpellLabel;
|
||||
|
||||
/// New item notification type label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'NEW ITEM'**
|
||||
String get notifyNewItemLabel;
|
||||
|
||||
/// Boss slain notification type label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'BOSS SLAIN'**
|
||||
String get notifyBossSlainLabel;
|
||||
|
||||
/// Game saved notification type label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SAVED'**
|
||||
String get notifySavedLabel;
|
||||
|
||||
/// Info notification type label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'INFO'**
|
||||
String get notifyInfoLabel;
|
||||
|
||||
/// Warning notification type label
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'WARNING'**
|
||||
String get notifyWarningLabel;
|
||||
}
|
||||
|
||||
class _L10nDelegate extends LocalizationsDelegate<L10n> {
|
||||
@@ -652,7 +1400,7 @@ class _L10nDelegate extends LocalizationsDelegate<L10n> {
|
||||
|
||||
@override
|
||||
bool isSupported(Locale locale) =>
|
||||
<String>['en', 'ja', 'ko', 'zh'].contains(locale.languageCode);
|
||||
<String>['en', 'ja', 'ko'].contains(locale.languageCode);
|
||||
|
||||
@override
|
||||
bool shouldReload(_L10nDelegate old) => false;
|
||||
@@ -667,8 +1415,6 @@ L10n lookupL10n(Locale locale) {
|
||||
return L10nJa();
|
||||
case 'ko':
|
||||
return L10nKo();
|
||||
case 'zh':
|
||||
return L10nZh();
|
||||
}
|
||||
|
||||
throw FlutterError(
|
||||
|
||||
@@ -220,7 +220,7 @@ class L10nEn extends L10n {
|
||||
String get total => 'Total';
|
||||
|
||||
@override
|
||||
String get unroll => 'Unroll';
|
||||
String get unroll => 'Undo';
|
||||
|
||||
@override
|
||||
String get roll => 'Roll';
|
||||
@@ -286,9 +286,398 @@ class L10nEn extends L10n {
|
||||
@override
|
||||
String get endingHallOfFameLine2 => 'remembered in the Hall of Fame';
|
||||
|
||||
@override
|
||||
String get endingHallOfFameButton => 'HALL OF FAME';
|
||||
|
||||
@override
|
||||
String get endingSkip => 'SKIP';
|
||||
|
||||
@override
|
||||
String get endingTapToSkip => 'TAP TO SKIP';
|
||||
|
||||
@override
|
||||
String get endingHoldToSpeedUp => 'HOLD TO SPEED UP';
|
||||
|
||||
@override
|
||||
String get menuTitle => 'MENU';
|
||||
|
||||
@override
|
||||
String get optionsTitle => 'OPTIONS';
|
||||
|
||||
@override
|
||||
String get soundTitle => 'SOUND';
|
||||
|
||||
@override
|
||||
String get controlSection => 'CONTROL';
|
||||
|
||||
@override
|
||||
String get infoSection => 'INFO';
|
||||
|
||||
@override
|
||||
String get settingsSection => 'SETTINGS';
|
||||
|
||||
@override
|
||||
String get saveExitSection => 'SAVE / EXIT';
|
||||
|
||||
@override
|
||||
String get ok => 'OK';
|
||||
|
||||
@override
|
||||
String get rechargeButton => 'RECHARGE';
|
||||
|
||||
@override
|
||||
String get createButton => 'CREATE';
|
||||
|
||||
@override
|
||||
String get previewTitle => 'PREVIEW';
|
||||
|
||||
@override
|
||||
String get nameTitle => 'NAME';
|
||||
|
||||
@override
|
||||
String get statsTitle => 'STATS';
|
||||
|
||||
@override
|
||||
String get raceTitle => 'RACE';
|
||||
|
||||
@override
|
||||
String get classSection => 'CLASS';
|
||||
|
||||
@override
|
||||
String get bgmLabel => 'BGM';
|
||||
|
||||
@override
|
||||
String get sfxLabel => 'SFX';
|
||||
|
||||
@override
|
||||
String get hpLabel => 'HP';
|
||||
|
||||
@override
|
||||
String get mpLabel => 'MP';
|
||||
|
||||
@override
|
||||
String get expLabel => 'EXP';
|
||||
|
||||
@override
|
||||
String get notifyLevelUp => 'LEVEL UP!';
|
||||
|
||||
@override
|
||||
String notifyLevel(int level) {
|
||||
return 'Level $level';
|
||||
}
|
||||
|
||||
@override
|
||||
String get notifyQuestComplete => 'QUEST COMPLETE!';
|
||||
|
||||
@override
|
||||
String get notifyPrologueComplete => 'PROLOGUE COMPLETE!';
|
||||
|
||||
@override
|
||||
String notifyActComplete(int number) {
|
||||
return 'ACT $number COMPLETE!';
|
||||
}
|
||||
|
||||
@override
|
||||
String get notifyNewSpell => 'NEW SPELL!';
|
||||
|
||||
@override
|
||||
String get notifyNewEquipment => 'NEW EQUIPMENT!';
|
||||
|
||||
@override
|
||||
String get notifyBossDefeated => 'BOSS DEFEATED!';
|
||||
|
||||
@override
|
||||
String get rechargeRollsTitle => 'RECHARGE ROLLS';
|
||||
|
||||
@override
|
||||
String get rechargeRollsFree => 'Recharge 5 rolls for free?';
|
||||
|
||||
@override
|
||||
String get rechargeRollsAd => 'Watch an ad to recharge 5 rolls?';
|
||||
|
||||
@override
|
||||
String get debugTitle => 'DEBUG';
|
||||
|
||||
@override
|
||||
String get debugCheatsTitle => 'DEBUG CHEATS';
|
||||
|
||||
@override
|
||||
String get debugToolsTitle => 'DEBUG TOOLS';
|
||||
|
||||
@override
|
||||
String get debugDeveloperTools => 'DEVELOPER TOOLS';
|
||||
|
||||
@override
|
||||
String get debugSkipTask => 'SKIP TASK (L+1)';
|
||||
|
||||
@override
|
||||
String get debugSkipTaskDesc => 'Complete task instantly';
|
||||
|
||||
@override
|
||||
String get debugSkipQuest => 'SKIP QUEST (Q!)';
|
||||
|
||||
@override
|
||||
String get debugSkipQuestDesc => 'Complete quest instantly';
|
||||
|
||||
@override
|
||||
String get debugSkipAct => 'SKIP ACT (P!)';
|
||||
|
||||
@override
|
||||
String get debugSkipActDesc => 'Complete act instantly';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacter => 'CREATE TEST CHARACTER';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacterDesc =>
|
||||
'Register Level 100 character to Hall of Fame';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacterTitle => 'CREATE TEST CHARACTER?';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacterMessage =>
|
||||
'Current character will be converted to Level 100\nand registered to the Hall of Fame.\n\n⚠️ Current save file will be deleted.\nThis action cannot be undone.';
|
||||
|
||||
@override
|
||||
String get debugTurbo => 'DEBUG: TURBO (20x)';
|
||||
|
||||
@override
|
||||
String get debugIapPurchased => 'IAP PURCHASED';
|
||||
|
||||
@override
|
||||
String get debugIapPurchasedDesc => 'ON: Behave as paid user (ads removed)';
|
||||
|
||||
@override
|
||||
String get debugOfflineHours => 'OFFLINE HOURS';
|
||||
|
||||
@override
|
||||
String get debugOfflineHoursDesc =>
|
||||
'Test return rewards (applies on restart)';
|
||||
|
||||
@override
|
||||
String get debugTestCharacterDesc =>
|
||||
'Modify current character to Level 100\nand register to the Hall of Fame.';
|
||||
|
||||
@override
|
||||
String get arenaTitle => 'LOCAL ARENA';
|
||||
|
||||
@override
|
||||
String get arenaSelectFighter => 'SELECT YOUR FIGHTER';
|
||||
|
||||
@override
|
||||
String get arenaEmptyTitle => 'Not enough heroes';
|
||||
|
||||
@override
|
||||
String get arenaEmptyHint => 'Clear the game with 2+ characters';
|
||||
|
||||
@override
|
||||
String get arenaSetupTitle => 'ARENA SETUP';
|
||||
|
||||
@override
|
||||
String get arenaStartBattle => 'START BATTLE';
|
||||
|
||||
@override
|
||||
String get arenaBattleTitle => 'ARENA BATTLE';
|
||||
|
||||
@override
|
||||
String get arenaMyEquipment => 'MY EQUIPMENT';
|
||||
|
||||
@override
|
||||
String get arenaEnemyEquipment => 'ENEMY EQUIPMENT';
|
||||
|
||||
@override
|
||||
String get arenaSelected => 'SELECTED';
|
||||
|
||||
@override
|
||||
String get arenaRecommended => 'BEST';
|
||||
|
||||
@override
|
||||
String get arenaWeaponLocked => 'LOCKED';
|
||||
|
||||
@override
|
||||
String get arenaVictory => 'VICTORY!';
|
||||
|
||||
@override
|
||||
String get arenaDefeat => 'DEFEAT...';
|
||||
|
||||
@override
|
||||
String get arenaEquipmentExchange => 'EQUIPMENT EXCHANGE';
|
||||
|
||||
@override
|
||||
String get arenaTurns => 'TURNS';
|
||||
|
||||
@override
|
||||
String get arenaWinner => 'WINNER';
|
||||
|
||||
@override
|
||||
String get arenaLoser => 'LOSER';
|
||||
|
||||
@override
|
||||
String arenaDefeatedIn(String winner, String loser, int turns) {
|
||||
return '$winner defeated $loser in $turns TURNS';
|
||||
}
|
||||
|
||||
@override
|
||||
String arenaScoreGain(int score) {
|
||||
return 'You will GAIN +$score';
|
||||
}
|
||||
|
||||
@override
|
||||
String arenaScoreLose(int score) {
|
||||
return 'You will LOSE $score';
|
||||
}
|
||||
|
||||
@override
|
||||
String get arenaEvenTrade => 'Even trade';
|
||||
|
||||
@override
|
||||
String get arenaScore => 'SCORE';
|
||||
|
||||
@override
|
||||
String get statsStatistics => 'Statistics';
|
||||
|
||||
@override
|
||||
String get statsSession => 'Session';
|
||||
|
||||
@override
|
||||
String get statsAccumulated => 'Total';
|
||||
|
||||
@override
|
||||
String get statsCombat => 'Combat';
|
||||
|
||||
@override
|
||||
String get statsPlayTime => 'Play Time';
|
||||
|
||||
@override
|
||||
String get statsMonstersKilled => 'Monsters Killed';
|
||||
|
||||
@override
|
||||
String get statsBossesDefeated => 'Bosses Defeated';
|
||||
|
||||
@override
|
||||
String get statsDeaths => 'Deaths';
|
||||
|
||||
@override
|
||||
String get statsDamage => 'Damage';
|
||||
|
||||
@override
|
||||
String get statsDamageDealt => 'Damage Dealt';
|
||||
|
||||
@override
|
||||
String get statsDamageTaken => 'Damage Taken';
|
||||
|
||||
@override
|
||||
String get statsAverageDps => 'Average DPS';
|
||||
|
||||
@override
|
||||
String get statsSkills => 'Skills';
|
||||
|
||||
@override
|
||||
String get statsSkillsUsed => 'Skills Used';
|
||||
|
||||
@override
|
||||
String get statsCriticalHits => 'Critical Hits';
|
||||
|
||||
@override
|
||||
String get statsMaxCriticalStreak => 'Max Critical Streak';
|
||||
|
||||
@override
|
||||
String get statsCriticalRate => 'Critical Rate';
|
||||
|
||||
@override
|
||||
String get statsEconomy => 'Economy';
|
||||
|
||||
@override
|
||||
String get statsGoldEarned => 'Gold Earned';
|
||||
|
||||
@override
|
||||
String get statsGoldSpent => 'Gold Spent';
|
||||
|
||||
@override
|
||||
String get statsItemsSold => 'Items Sold';
|
||||
|
||||
@override
|
||||
String get statsPotionsUsed => 'Potions Used';
|
||||
|
||||
@override
|
||||
String get statsProgress => 'Progress';
|
||||
|
||||
@override
|
||||
String get statsLevelUps => 'Level Ups';
|
||||
|
||||
@override
|
||||
String get statsQuestsCompleted => 'Quests Completed';
|
||||
|
||||
@override
|
||||
String get statsRecords => 'Records';
|
||||
|
||||
@override
|
||||
String get statsHighestLevel => 'Highest Level';
|
||||
|
||||
@override
|
||||
String get statsHighestGoldHeld => 'Highest Gold Held';
|
||||
|
||||
@override
|
||||
String get statsBestCriticalStreak => 'Best Critical Streak';
|
||||
|
||||
@override
|
||||
String get statsTotalPlay => 'Total Play';
|
||||
|
||||
@override
|
||||
String get statsTotalPlayTime => 'Total Play Time';
|
||||
|
||||
@override
|
||||
String get statsGamesStarted => 'Games Started';
|
||||
|
||||
@override
|
||||
String get statsGamesCompleted => 'Games Completed';
|
||||
|
||||
@override
|
||||
String get statsCompletionRate => 'Completion Rate';
|
||||
|
||||
@override
|
||||
String get statsTotalCombat => 'Total Combat';
|
||||
|
||||
@override
|
||||
String get statsTotalDeaths => 'Total Deaths';
|
||||
|
||||
@override
|
||||
String get statsTotalLevelUps => 'Total Level Ups';
|
||||
|
||||
@override
|
||||
String get statsTotalDamage => 'Total Damage';
|
||||
|
||||
@override
|
||||
String get statsTotalSkills => 'Total Skills';
|
||||
|
||||
@override
|
||||
String get statsTotalEconomy => 'Total Economy';
|
||||
|
||||
@override
|
||||
String get notifyLevelUpLabel => 'LEVEL UP';
|
||||
|
||||
@override
|
||||
String get notifyQuestDoneLabel => 'QUEST DONE';
|
||||
|
||||
@override
|
||||
String get notifyActClearLabel => 'ACT CLEAR';
|
||||
|
||||
@override
|
||||
String get notifyNewSpellLabel => 'NEW SPELL';
|
||||
|
||||
@override
|
||||
String get notifyNewItemLabel => 'NEW ITEM';
|
||||
|
||||
@override
|
||||
String get notifyBossSlainLabel => 'BOSS SLAIN';
|
||||
|
||||
@override
|
||||
String get notifySavedLabel => 'SAVED';
|
||||
|
||||
@override
|
||||
String get notifyInfoLabel => 'INFO';
|
||||
|
||||
@override
|
||||
String get notifyWarningLabel => 'WARNING';
|
||||
}
|
||||
|
||||
@@ -9,78 +9,78 @@ class L10nJa extends L10n {
|
||||
L10nJa([String locale = 'ja']) : super(locale);
|
||||
|
||||
@override
|
||||
String get appTitle => 'ASCII NEVER DIE';
|
||||
String get appTitle => 'アスキー ネバー ダイ';
|
||||
|
||||
@override
|
||||
String get tagNoNetwork => 'No network';
|
||||
String get tagNoNetwork => 'オフライン';
|
||||
|
||||
@override
|
||||
String get tagIdleRpg => 'Idle RPG loop';
|
||||
String get tagIdleRpg => '放置型RPG';
|
||||
|
||||
@override
|
||||
String get tagLocalSaves => 'Local saves';
|
||||
String get tagLocalSaves => 'ローカル保存';
|
||||
|
||||
@override
|
||||
String get newCharacter => 'New character';
|
||||
String get newCharacter => '新規キャラクター';
|
||||
|
||||
@override
|
||||
String get loadSave => 'Load save';
|
||||
String get loadSave => 'ロード';
|
||||
|
||||
@override
|
||||
String get loadGame => 'Load Game';
|
||||
String get loadGame => 'ゲームをロード';
|
||||
|
||||
@override
|
||||
String get viewBuildPlan => 'View build plan';
|
||||
String get viewBuildPlan => 'ビルド計画を見る';
|
||||
|
||||
@override
|
||||
String get buildRoadmap => 'Build roadmap';
|
||||
String get buildRoadmap => 'ビルドロードマップ';
|
||||
|
||||
@override
|
||||
String get techStack => 'Tech stack';
|
||||
String get techStack => '技術スタック';
|
||||
|
||||
@override
|
||||
String get cancel => 'Cancel';
|
||||
String get cancel => 'キャンセル';
|
||||
|
||||
@override
|
||||
String get exitGame => 'Exit Game';
|
||||
String get exitGame => 'ゲーム終了';
|
||||
|
||||
@override
|
||||
String get saveProgressQuestion => 'Save your progress before leaving?';
|
||||
String get saveProgressQuestion => '終了する前にセーブしますか?';
|
||||
|
||||
@override
|
||||
String get exitWithoutSaving => 'Exit without saving';
|
||||
String get exitWithoutSaving => 'セーブせずに終了';
|
||||
|
||||
@override
|
||||
String get saveAndExit => 'Save and Exit';
|
||||
String get saveAndExit => 'セーブして終了';
|
||||
|
||||
@override
|
||||
String progressQuestTitle(String name) {
|
||||
return 'ASCII NEVER DIE - $name';
|
||||
return 'アスキー ネバー ダイ - $name';
|
||||
}
|
||||
|
||||
@override
|
||||
String get levelUp => 'Level Up';
|
||||
String get levelUp => 'レベルアップ';
|
||||
|
||||
@override
|
||||
String get completeQuest => 'Complete Quest';
|
||||
String get completeQuest => 'クエスト完了';
|
||||
|
||||
@override
|
||||
String get completePlot => 'Complete Plot';
|
||||
String get completePlot => 'プロット完了';
|
||||
|
||||
@override
|
||||
String get characterSheet => 'Character Sheet';
|
||||
String get characterSheet => 'キャラクターシート';
|
||||
|
||||
@override
|
||||
String get traits => 'Traits';
|
||||
String get traits => '特性';
|
||||
|
||||
@override
|
||||
String get stats => 'Stats';
|
||||
String get stats => '能力値';
|
||||
|
||||
@override
|
||||
String get experience => 'Experience';
|
||||
String get experience => '経験値';
|
||||
|
||||
@override
|
||||
String get xpNeededForNextLevel => 'XP needed for next level';
|
||||
String get xpNeededForNextLevel => '次のレベルまでの必要XP';
|
||||
|
||||
@override
|
||||
String get spellBook => 'スキル';
|
||||
@@ -89,34 +89,34 @@ class L10nJa extends L10n {
|
||||
String get noSpellsYet => '習得したスキルがありません';
|
||||
|
||||
@override
|
||||
String get equipment => 'Equipment';
|
||||
String get equipment => '装備';
|
||||
|
||||
@override
|
||||
String get inventory => 'Inventory';
|
||||
String get inventory => 'インベントリ';
|
||||
|
||||
@override
|
||||
String get encumbrance => 'Encumbrance';
|
||||
String get encumbrance => '積載量';
|
||||
|
||||
@override
|
||||
String get combatLog => '戦闘ログ';
|
||||
|
||||
@override
|
||||
String get plotDevelopment => 'Plot Development';
|
||||
String get plotDevelopment => 'ストーリー進行';
|
||||
|
||||
@override
|
||||
String get quests => 'Quests';
|
||||
String get quests => 'クエスト';
|
||||
|
||||
@override
|
||||
String get traitName => 'Name';
|
||||
String get traitName => '名前';
|
||||
|
||||
@override
|
||||
String get traitRace => 'Race';
|
||||
String get traitRace => '種族';
|
||||
|
||||
@override
|
||||
String get traitClass => 'Class';
|
||||
String get traitClass => '職業';
|
||||
|
||||
@override
|
||||
String get traitLevel => 'Level';
|
||||
String get traitLevel => 'レベル';
|
||||
|
||||
@override
|
||||
String get statStr => 'STR';
|
||||
@@ -137,43 +137,43 @@ class L10nJa extends L10n {
|
||||
String get statCha => 'CHA';
|
||||
|
||||
@override
|
||||
String get statHpMax => 'HP Max';
|
||||
String get statHpMax => 'HP最大';
|
||||
|
||||
@override
|
||||
String get statMpMax => 'MP Max';
|
||||
String get statMpMax => 'MP最大';
|
||||
|
||||
@override
|
||||
String get equipWeapon => 'Weapon';
|
||||
String get equipWeapon => '武器';
|
||||
|
||||
@override
|
||||
String get equipShield => 'Shield';
|
||||
String get equipShield => '盾';
|
||||
|
||||
@override
|
||||
String get equipHelm => 'Helm';
|
||||
String get equipHelm => '兜';
|
||||
|
||||
@override
|
||||
String get equipHauberk => 'Hauberk';
|
||||
String get equipHauberk => '鎧';
|
||||
|
||||
@override
|
||||
String get equipBrassairts => 'Brassairts';
|
||||
String get equipBrassairts => '肩当て';
|
||||
|
||||
@override
|
||||
String get equipVambraces => 'Vambraces';
|
||||
String get equipVambraces => '腕甲';
|
||||
|
||||
@override
|
||||
String get equipGauntlets => 'Gauntlets';
|
||||
String get equipGauntlets => '篭手';
|
||||
|
||||
@override
|
||||
String get equipGambeson => 'Gambeson';
|
||||
String get equipGambeson => '防護服';
|
||||
|
||||
@override
|
||||
String get equipCuisses => 'Cuisses';
|
||||
String get equipCuisses => '腿当て';
|
||||
|
||||
@override
|
||||
String get equipGreaves => 'Greaves';
|
||||
String get equipGreaves => '脛当て';
|
||||
|
||||
@override
|
||||
String get equipSollerets => 'Sollerets';
|
||||
String get equipSollerets => '鉄靴';
|
||||
|
||||
@override
|
||||
String get gold => 'コイン';
|
||||
@@ -184,63 +184,63 @@ class L10nJa extends L10n {
|
||||
}
|
||||
|
||||
@override
|
||||
String get prologue => 'Prologue';
|
||||
String get prologue => 'プロローグ';
|
||||
|
||||
@override
|
||||
String actNumber(String number) {
|
||||
return 'Act $number';
|
||||
return '第$number幕';
|
||||
}
|
||||
|
||||
@override
|
||||
String get noActiveQuests => 'No active quests';
|
||||
String get noActiveQuests => '進行中のクエストなし';
|
||||
|
||||
@override
|
||||
String questNumber(int number) {
|
||||
return 'Quest #$number';
|
||||
return 'クエスト #$number';
|
||||
}
|
||||
|
||||
@override
|
||||
String get welcomeMessage => 'ASCII NEVER DIEへようこそ!';
|
||||
|
||||
@override
|
||||
String get noSavedGames => 'No saved games found.';
|
||||
String get noSavedGames => 'セーブデータがありません。';
|
||||
|
||||
@override
|
||||
String loadError(String error) {
|
||||
return 'Failed to load save file: $error';
|
||||
return 'セーブファイルの読み込みに失敗しました: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String get name => 'Name';
|
||||
String get name => '名前';
|
||||
|
||||
@override
|
||||
String get generateName => 'Generate Name';
|
||||
String get generateName => '名前を生成';
|
||||
|
||||
@override
|
||||
String get total => 'Total';
|
||||
String get total => '合計';
|
||||
|
||||
@override
|
||||
String get unroll => 'Unroll';
|
||||
String get unroll => '元に戻す';
|
||||
|
||||
@override
|
||||
String get roll => 'Roll';
|
||||
String get roll => 'ロール';
|
||||
|
||||
@override
|
||||
String get race => 'Race';
|
||||
String get race => '種族';
|
||||
|
||||
@override
|
||||
String get classTitle => 'Class';
|
||||
String get classTitle => '職業';
|
||||
|
||||
@override
|
||||
String percentComplete(int percent) {
|
||||
return '$percent% complete';
|
||||
return '$percent% 完了';
|
||||
}
|
||||
|
||||
@override
|
||||
String get newCharacterTitle => 'ASCII NEVER DIE - New Character';
|
||||
String get newCharacterTitle => 'アスキー ネバー ダイ - 新規キャラクター';
|
||||
|
||||
@override
|
||||
String get soldButton => 'Sold!';
|
||||
String get soldButton => '決定!';
|
||||
|
||||
@override
|
||||
String get endingCongratulations => '★ おめでとうございます ★';
|
||||
@@ -286,9 +286,395 @@ class L10nJa extends L10n {
|
||||
@override
|
||||
String get endingHallOfFameLine2 => '殿堂に記録されます';
|
||||
|
||||
@override
|
||||
String get endingHallOfFameButton => '殿堂入り';
|
||||
|
||||
@override
|
||||
String get endingSkip => 'スキップ';
|
||||
|
||||
@override
|
||||
String get endingTapToSkip => 'タップでスキップ';
|
||||
|
||||
@override
|
||||
String get endingHoldToSpeedUp => '長押しで高速スクロール';
|
||||
|
||||
@override
|
||||
String get menuTitle => 'メニュー';
|
||||
|
||||
@override
|
||||
String get optionsTitle => 'オプション';
|
||||
|
||||
@override
|
||||
String get soundTitle => 'サウンド';
|
||||
|
||||
@override
|
||||
String get controlSection => '操作';
|
||||
|
||||
@override
|
||||
String get infoSection => '情報';
|
||||
|
||||
@override
|
||||
String get settingsSection => '設定';
|
||||
|
||||
@override
|
||||
String get saveExitSection => 'セーブ / 終了';
|
||||
|
||||
@override
|
||||
String get ok => 'OK';
|
||||
|
||||
@override
|
||||
String get rechargeButton => 'チャージ';
|
||||
|
||||
@override
|
||||
String get createButton => '作成';
|
||||
|
||||
@override
|
||||
String get previewTitle => 'プレビュー';
|
||||
|
||||
@override
|
||||
String get nameTitle => '名前';
|
||||
|
||||
@override
|
||||
String get statsTitle => '能力値';
|
||||
|
||||
@override
|
||||
String get raceTitle => '種族';
|
||||
|
||||
@override
|
||||
String get classSection => '職業';
|
||||
|
||||
@override
|
||||
String get bgmLabel => 'BGM';
|
||||
|
||||
@override
|
||||
String get sfxLabel => '効果音';
|
||||
|
||||
@override
|
||||
String get hpLabel => 'HP';
|
||||
|
||||
@override
|
||||
String get mpLabel => 'MP';
|
||||
|
||||
@override
|
||||
String get expLabel => 'EXP';
|
||||
|
||||
@override
|
||||
String get notifyLevelUp => 'レベルアップ!';
|
||||
|
||||
@override
|
||||
String notifyLevel(int level) {
|
||||
return 'レベル $level';
|
||||
}
|
||||
|
||||
@override
|
||||
String get notifyQuestComplete => 'クエスト完了!';
|
||||
|
||||
@override
|
||||
String get notifyPrologueComplete => 'プロローグ完了!';
|
||||
|
||||
@override
|
||||
String notifyActComplete(int number) {
|
||||
return '第$number幕 完了!';
|
||||
}
|
||||
|
||||
@override
|
||||
String get notifyNewSpell => '新しいスキル!';
|
||||
|
||||
@override
|
||||
String get notifyNewEquipment => '新しい装備!';
|
||||
|
||||
@override
|
||||
String get notifyBossDefeated => 'ボス撃破!';
|
||||
|
||||
@override
|
||||
String get rechargeRollsTitle => 'ロール回数チャージ';
|
||||
|
||||
@override
|
||||
String get rechargeRollsFree => '無料で5回チャージしますか?';
|
||||
|
||||
@override
|
||||
String get rechargeRollsAd => '広告を見て5回チャージしますか?';
|
||||
|
||||
@override
|
||||
String get debugTitle => 'デバッグ';
|
||||
|
||||
@override
|
||||
String get debugCheatsTitle => 'デバッグチート';
|
||||
|
||||
@override
|
||||
String get debugToolsTitle => 'デバッグツール';
|
||||
|
||||
@override
|
||||
String get debugDeveloperTools => '開発者ツール';
|
||||
|
||||
@override
|
||||
String get debugSkipTask => 'タスクスキップ (L+1)';
|
||||
|
||||
@override
|
||||
String get debugSkipTaskDesc => 'タスクを即時完了';
|
||||
|
||||
@override
|
||||
String get debugSkipQuest => 'クエストスキップ (Q!)';
|
||||
|
||||
@override
|
||||
String get debugSkipQuestDesc => 'クエストを即時完了';
|
||||
|
||||
@override
|
||||
String get debugSkipAct => 'アクトスキップ (P!)';
|
||||
|
||||
@override
|
||||
String get debugSkipActDesc => 'アクトを即時完了';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacter => 'テストキャラクター作成';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacterDesc => 'レベル100キャラクターを殿堂に登録';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacterTitle => 'テストキャラクターを作成しますか?';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacterMessage =>
|
||||
'現在のキャラクターがレベル100に変換され\n殿堂に登録されます。\n\n⚠️ 現在のセーブファイルは削除されます。\nこの操作は元に戻せません。';
|
||||
|
||||
@override
|
||||
String get debugTurbo => 'デバッグ: ターボ (20x)';
|
||||
|
||||
@override
|
||||
String get debugIapPurchased => 'IAP購入済み';
|
||||
|
||||
@override
|
||||
String get debugIapPurchasedDesc => 'ON: 有料ユーザーとして動作(広告非表示)';
|
||||
|
||||
@override
|
||||
String get debugOfflineHours => 'オフライン時間';
|
||||
|
||||
@override
|
||||
String get debugOfflineHoursDesc => '復帰報酬テスト(再起動時に適用)';
|
||||
|
||||
@override
|
||||
String get debugTestCharacterDesc => '現在のキャラクターをレベル100に変更して\n殿堂に登録します。';
|
||||
|
||||
@override
|
||||
String get arenaTitle => 'ローカルアリーナ';
|
||||
|
||||
@override
|
||||
String get arenaSelectFighter => 'ファイターを選択';
|
||||
|
||||
@override
|
||||
String get arenaEmptyTitle => 'ヒーローが不足しています';
|
||||
|
||||
@override
|
||||
String get arenaEmptyHint => '2人以上のキャラでクリアしてください';
|
||||
|
||||
@override
|
||||
String get arenaSetupTitle => 'アリーナ設定';
|
||||
|
||||
@override
|
||||
String get arenaStartBattle => 'バトル開始';
|
||||
|
||||
@override
|
||||
String get arenaBattleTitle => 'アリーナバトル';
|
||||
|
||||
@override
|
||||
String get arenaMyEquipment => '自分の装備';
|
||||
|
||||
@override
|
||||
String get arenaEnemyEquipment => '敵の装備';
|
||||
|
||||
@override
|
||||
String get arenaSelected => '選択済み';
|
||||
|
||||
@override
|
||||
String get arenaRecommended => 'おすすめ';
|
||||
|
||||
@override
|
||||
String get arenaWeaponLocked => 'ロック';
|
||||
|
||||
@override
|
||||
String get arenaVictory => '勝利!';
|
||||
|
||||
@override
|
||||
String get arenaDefeat => '敗北...';
|
||||
|
||||
@override
|
||||
String get arenaEquipmentExchange => '装備交換';
|
||||
|
||||
@override
|
||||
String get arenaTurns => 'ターン';
|
||||
|
||||
@override
|
||||
String get arenaWinner => '勝者';
|
||||
|
||||
@override
|
||||
String get arenaLoser => '敗者';
|
||||
|
||||
@override
|
||||
String arenaDefeatedIn(String winner, String loser, int turns) {
|
||||
return '$winnerが$loserを$turnsターンで撃破';
|
||||
}
|
||||
|
||||
@override
|
||||
String arenaScoreGain(int score) {
|
||||
return '+$score獲得予定';
|
||||
}
|
||||
|
||||
@override
|
||||
String arenaScoreLose(int score) {
|
||||
return '$score損失予定';
|
||||
}
|
||||
|
||||
@override
|
||||
String get arenaEvenTrade => '等価交換';
|
||||
|
||||
@override
|
||||
String get arenaScore => 'スコア';
|
||||
|
||||
@override
|
||||
String get statsStatistics => '統計';
|
||||
|
||||
@override
|
||||
String get statsSession => 'セッション';
|
||||
|
||||
@override
|
||||
String get statsAccumulated => '累積';
|
||||
|
||||
@override
|
||||
String get statsCombat => '戦闘';
|
||||
|
||||
@override
|
||||
String get statsPlayTime => 'プレイ時間';
|
||||
|
||||
@override
|
||||
String get statsMonstersKilled => '倒したモンスター';
|
||||
|
||||
@override
|
||||
String get statsBossesDefeated => 'ボス討伐';
|
||||
|
||||
@override
|
||||
String get statsDeaths => '死亡回数';
|
||||
|
||||
@override
|
||||
String get statsDamage => 'ダメージ';
|
||||
|
||||
@override
|
||||
String get statsDamageDealt => '与えたダメージ';
|
||||
|
||||
@override
|
||||
String get statsDamageTaken => '受けたダメージ';
|
||||
|
||||
@override
|
||||
String get statsAverageDps => '平均DPS';
|
||||
|
||||
@override
|
||||
String get statsSkills => 'スキル';
|
||||
|
||||
@override
|
||||
String get statsSkillsUsed => 'スキル使用';
|
||||
|
||||
@override
|
||||
String get statsCriticalHits => 'クリティカルヒット';
|
||||
|
||||
@override
|
||||
String get statsMaxCriticalStreak => '最大連続クリティカル';
|
||||
|
||||
@override
|
||||
String get statsCriticalRate => 'クリティカル率';
|
||||
|
||||
@override
|
||||
String get statsEconomy => '経済';
|
||||
|
||||
@override
|
||||
String get statsGoldEarned => '獲得ゴールド';
|
||||
|
||||
@override
|
||||
String get statsGoldSpent => '消費ゴールド';
|
||||
|
||||
@override
|
||||
String get statsItemsSold => '売却アイテム';
|
||||
|
||||
@override
|
||||
String get statsPotionsUsed => 'ポーション使用';
|
||||
|
||||
@override
|
||||
String get statsProgress => '進行';
|
||||
|
||||
@override
|
||||
String get statsLevelUps => 'レベルアップ';
|
||||
|
||||
@override
|
||||
String get statsQuestsCompleted => '完了したクエスト';
|
||||
|
||||
@override
|
||||
String get statsRecords => '記録';
|
||||
|
||||
@override
|
||||
String get statsHighestLevel => '最高レベル';
|
||||
|
||||
@override
|
||||
String get statsHighestGoldHeld => '最大所持ゴールド';
|
||||
|
||||
@override
|
||||
String get statsBestCriticalStreak => '最高連続クリティカル';
|
||||
|
||||
@override
|
||||
String get statsTotalPlay => '総プレイ';
|
||||
|
||||
@override
|
||||
String get statsTotalPlayTime => '総プレイ時間';
|
||||
|
||||
@override
|
||||
String get statsGamesStarted => '開始したゲーム';
|
||||
|
||||
@override
|
||||
String get statsGamesCompleted => 'クリアしたゲーム';
|
||||
|
||||
@override
|
||||
String get statsCompletionRate => 'クリア率';
|
||||
|
||||
@override
|
||||
String get statsTotalCombat => '総戦闘';
|
||||
|
||||
@override
|
||||
String get statsTotalDeaths => '総死亡';
|
||||
|
||||
@override
|
||||
String get statsTotalLevelUps => '総レベルアップ';
|
||||
|
||||
@override
|
||||
String get statsTotalDamage => '総ダメージ';
|
||||
|
||||
@override
|
||||
String get statsTotalSkills => '総スキル';
|
||||
|
||||
@override
|
||||
String get statsTotalEconomy => '総経済';
|
||||
|
||||
@override
|
||||
String get notifyLevelUpLabel => 'レベルアップ';
|
||||
|
||||
@override
|
||||
String get notifyQuestDoneLabel => 'クエスト完了';
|
||||
|
||||
@override
|
||||
String get notifyActClearLabel => '幕完了';
|
||||
|
||||
@override
|
||||
String get notifyNewSpellLabel => '新しいスキル';
|
||||
|
||||
@override
|
||||
String get notifyNewItemLabel => '新しいアイテム';
|
||||
|
||||
@override
|
||||
String get notifyBossSlainLabel => 'ボス撃破';
|
||||
|
||||
@override
|
||||
String get notifySavedLabel => 'セーブ済み';
|
||||
|
||||
@override
|
||||
String get notifyInfoLabel => '情報';
|
||||
|
||||
@override
|
||||
String get notifyWarningLabel => '警告';
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ class L10nKo extends L10n {
|
||||
String get total => '합계';
|
||||
|
||||
@override
|
||||
String get unroll => '펼치기';
|
||||
String get unroll => '되돌리기';
|
||||
|
||||
@override
|
||||
String get roll => '굴리기';
|
||||
@@ -286,9 +286,395 @@ class L10nKo extends L10n {
|
||||
@override
|
||||
String get endingHallOfFameLine2 => '명예의 전당에 기록됩니다';
|
||||
|
||||
@override
|
||||
String get endingHallOfFameButton => '명예의 전당';
|
||||
|
||||
@override
|
||||
String get endingSkip => '건너뛰기';
|
||||
|
||||
@override
|
||||
String get endingTapToSkip => '탭하여 건너뛰기';
|
||||
|
||||
@override
|
||||
String get endingHoldToSpeedUp => '길게 누르면 빨리 스크롤';
|
||||
|
||||
@override
|
||||
String get menuTitle => '메뉴';
|
||||
|
||||
@override
|
||||
String get optionsTitle => '옵션';
|
||||
|
||||
@override
|
||||
String get soundTitle => '사운드';
|
||||
|
||||
@override
|
||||
String get controlSection => '제어';
|
||||
|
||||
@override
|
||||
String get infoSection => '정보';
|
||||
|
||||
@override
|
||||
String get settingsSection => '설정';
|
||||
|
||||
@override
|
||||
String get saveExitSection => '저장 / 종료';
|
||||
|
||||
@override
|
||||
String get ok => '확인';
|
||||
|
||||
@override
|
||||
String get rechargeButton => '충전';
|
||||
|
||||
@override
|
||||
String get createButton => '생성';
|
||||
|
||||
@override
|
||||
String get previewTitle => '미리보기';
|
||||
|
||||
@override
|
||||
String get nameTitle => '이름';
|
||||
|
||||
@override
|
||||
String get statsTitle => '능력치';
|
||||
|
||||
@override
|
||||
String get raceTitle => '종족';
|
||||
|
||||
@override
|
||||
String get classSection => '직업';
|
||||
|
||||
@override
|
||||
String get bgmLabel => 'BGM';
|
||||
|
||||
@override
|
||||
String get sfxLabel => '효과음';
|
||||
|
||||
@override
|
||||
String get hpLabel => 'HP';
|
||||
|
||||
@override
|
||||
String get mpLabel => 'MP';
|
||||
|
||||
@override
|
||||
String get expLabel => '경험치';
|
||||
|
||||
@override
|
||||
String get notifyLevelUp => '레벨 업!';
|
||||
|
||||
@override
|
||||
String notifyLevel(int level) {
|
||||
return '레벨 $level';
|
||||
}
|
||||
|
||||
@override
|
||||
String get notifyQuestComplete => '퀘스트 완료!';
|
||||
|
||||
@override
|
||||
String get notifyPrologueComplete => '프롤로그 완료!';
|
||||
|
||||
@override
|
||||
String notifyActComplete(int number) {
|
||||
return '$number막 완료!';
|
||||
}
|
||||
|
||||
@override
|
||||
String get notifyNewSpell => '새 주문!';
|
||||
|
||||
@override
|
||||
String get notifyNewEquipment => '새 장비!';
|
||||
|
||||
@override
|
||||
String get notifyBossDefeated => '보스 처치!';
|
||||
|
||||
@override
|
||||
String get rechargeRollsTitle => '굴리기 충전';
|
||||
|
||||
@override
|
||||
String get rechargeRollsFree => '무료로 5회 충전하시겠습니까?';
|
||||
|
||||
@override
|
||||
String get rechargeRollsAd => '광고를 보고 5회 충전하시겠습니까?';
|
||||
|
||||
@override
|
||||
String get debugTitle => '디버그';
|
||||
|
||||
@override
|
||||
String get debugCheatsTitle => '디버그 치트';
|
||||
|
||||
@override
|
||||
String get debugToolsTitle => '디버그 도구';
|
||||
|
||||
@override
|
||||
String get debugDeveloperTools => '개발자 도구';
|
||||
|
||||
@override
|
||||
String get debugSkipTask => '태스크 건너뛰기 (L+1)';
|
||||
|
||||
@override
|
||||
String get debugSkipTaskDesc => '태스크 즉시 완료';
|
||||
|
||||
@override
|
||||
String get debugSkipQuest => '퀘스트 건너뛰기 (Q!)';
|
||||
|
||||
@override
|
||||
String get debugSkipQuestDesc => '퀘스트 즉시 완료';
|
||||
|
||||
@override
|
||||
String get debugSkipAct => '액트 건너뛰기 (P!)';
|
||||
|
||||
@override
|
||||
String get debugSkipActDesc => '액트 즉시 완료';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacter => '테스트 캐릭터 생성';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacterDesc => '레벨 100 캐릭터를 명예의 전당에 등록';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacterTitle => '테스트 캐릭터 생성?';
|
||||
|
||||
@override
|
||||
String get debugCreateTestCharacterMessage =>
|
||||
'현재 캐릭터가 레벨 100으로 변환되어\n명예의 전당에 등록됩니다.\n\n⚠️ 현재 세이브 파일이 삭제됩니다.\n이 작업은 되돌릴 수 없습니다.';
|
||||
|
||||
@override
|
||||
String get debugTurbo => '디버그: 터보 (20x)';
|
||||
|
||||
@override
|
||||
String get debugIapPurchased => 'IAP 구매됨';
|
||||
|
||||
@override
|
||||
String get debugIapPurchasedDesc => 'ON: 유료 유저로 동작 (광고 제거)';
|
||||
|
||||
@override
|
||||
String get debugOfflineHours => '오프라인 시간';
|
||||
|
||||
@override
|
||||
String get debugOfflineHoursDesc => '복귀 보상 테스트 (재시작 시 적용)';
|
||||
|
||||
@override
|
||||
String get debugTestCharacterDesc => '현재 캐릭터를 레벨 100으로 수정하여\n명예의 전당에 등록합니다.';
|
||||
|
||||
@override
|
||||
String get arenaTitle => '로컬 아레나';
|
||||
|
||||
@override
|
||||
String get arenaSelectFighter => '전사를 선택하세요';
|
||||
|
||||
@override
|
||||
String get arenaEmptyTitle => '영웅이 부족합니다';
|
||||
|
||||
@override
|
||||
String get arenaEmptyHint => '2명 이상 캐릭터로 클리어하세요';
|
||||
|
||||
@override
|
||||
String get arenaSetupTitle => '아레나 설정';
|
||||
|
||||
@override
|
||||
String get arenaStartBattle => '전투 시작';
|
||||
|
||||
@override
|
||||
String get arenaBattleTitle => '아레나 전투';
|
||||
|
||||
@override
|
||||
String get arenaMyEquipment => '내 장비';
|
||||
|
||||
@override
|
||||
String get arenaEnemyEquipment => '상대 장비';
|
||||
|
||||
@override
|
||||
String get arenaSelected => '선택됨';
|
||||
|
||||
@override
|
||||
String get arenaRecommended => '추천';
|
||||
|
||||
@override
|
||||
String get arenaWeaponLocked => '잠김';
|
||||
|
||||
@override
|
||||
String get arenaVictory => '승리!';
|
||||
|
||||
@override
|
||||
String get arenaDefeat => '패배...';
|
||||
|
||||
@override
|
||||
String get arenaEquipmentExchange => '장비 교환';
|
||||
|
||||
@override
|
||||
String get arenaTurns => '턴';
|
||||
|
||||
@override
|
||||
String get arenaWinner => '승자';
|
||||
|
||||
@override
|
||||
String get arenaLoser => '패자';
|
||||
|
||||
@override
|
||||
String arenaDefeatedIn(String winner, String loser, int turns) {
|
||||
return '$winner이(가) $loser을(를) $turns턴 만에 격파';
|
||||
}
|
||||
|
||||
@override
|
||||
String arenaScoreGain(int score) {
|
||||
return '+$score 획득 예정';
|
||||
}
|
||||
|
||||
@override
|
||||
String arenaScoreLose(int score) {
|
||||
return '$score 손실 예정';
|
||||
}
|
||||
|
||||
@override
|
||||
String get arenaEvenTrade => '등가 교환';
|
||||
|
||||
@override
|
||||
String get arenaScore => '점수';
|
||||
|
||||
@override
|
||||
String get statsStatistics => '통계';
|
||||
|
||||
@override
|
||||
String get statsSession => '세션';
|
||||
|
||||
@override
|
||||
String get statsAccumulated => '누적';
|
||||
|
||||
@override
|
||||
String get statsCombat => '전투';
|
||||
|
||||
@override
|
||||
String get statsPlayTime => '플레이 시간';
|
||||
|
||||
@override
|
||||
String get statsMonstersKilled => '처치한 몬스터';
|
||||
|
||||
@override
|
||||
String get statsBossesDefeated => '보스 처치';
|
||||
|
||||
@override
|
||||
String get statsDeaths => '사망 횟수';
|
||||
|
||||
@override
|
||||
String get statsDamage => '데미지';
|
||||
|
||||
@override
|
||||
String get statsDamageDealt => '입힌 데미지';
|
||||
|
||||
@override
|
||||
String get statsDamageTaken => '받은 데미지';
|
||||
|
||||
@override
|
||||
String get statsAverageDps => '평균 DPS';
|
||||
|
||||
@override
|
||||
String get statsSkills => '스킬';
|
||||
|
||||
@override
|
||||
String get statsSkillsUsed => '스킬 사용';
|
||||
|
||||
@override
|
||||
String get statsCriticalHits => '크리티컬 히트';
|
||||
|
||||
@override
|
||||
String get statsMaxCriticalStreak => '최대 연속 크리티컬';
|
||||
|
||||
@override
|
||||
String get statsCriticalRate => '크리티컬 비율';
|
||||
|
||||
@override
|
||||
String get statsEconomy => '경제';
|
||||
|
||||
@override
|
||||
String get statsGoldEarned => '획득 골드';
|
||||
|
||||
@override
|
||||
String get statsGoldSpent => '소비 골드';
|
||||
|
||||
@override
|
||||
String get statsItemsSold => '판매 아이템';
|
||||
|
||||
@override
|
||||
String get statsPotionsUsed => '물약 사용';
|
||||
|
||||
@override
|
||||
String get statsProgress => '진행';
|
||||
|
||||
@override
|
||||
String get statsLevelUps => '레벨업';
|
||||
|
||||
@override
|
||||
String get statsQuestsCompleted => '완료한 퀘스트';
|
||||
|
||||
@override
|
||||
String get statsRecords => '기록';
|
||||
|
||||
@override
|
||||
String get statsHighestLevel => '최고 레벨';
|
||||
|
||||
@override
|
||||
String get statsHighestGoldHeld => '최대 보유 골드';
|
||||
|
||||
@override
|
||||
String get statsBestCriticalStreak => '최고 연속 크리티컬';
|
||||
|
||||
@override
|
||||
String get statsTotalPlay => '총 플레이';
|
||||
|
||||
@override
|
||||
String get statsTotalPlayTime => '총 플레이 시간';
|
||||
|
||||
@override
|
||||
String get statsGamesStarted => '시작한 게임';
|
||||
|
||||
@override
|
||||
String get statsGamesCompleted => '클리어한 게임';
|
||||
|
||||
@override
|
||||
String get statsCompletionRate => '클리어율';
|
||||
|
||||
@override
|
||||
String get statsTotalCombat => '총 전투';
|
||||
|
||||
@override
|
||||
String get statsTotalDeaths => '총 사망';
|
||||
|
||||
@override
|
||||
String get statsTotalLevelUps => '총 레벨업';
|
||||
|
||||
@override
|
||||
String get statsTotalDamage => '총 데미지';
|
||||
|
||||
@override
|
||||
String get statsTotalSkills => '총 스킬';
|
||||
|
||||
@override
|
||||
String get statsTotalEconomy => '총 경제';
|
||||
|
||||
@override
|
||||
String get notifyLevelUpLabel => '레벨 업';
|
||||
|
||||
@override
|
||||
String get notifyQuestDoneLabel => '퀘스트 완료';
|
||||
|
||||
@override
|
||||
String get notifyActClearLabel => '막 완료';
|
||||
|
||||
@override
|
||||
String get notifyNewSpellLabel => '새 주문';
|
||||
|
||||
@override
|
||||
String get notifyNewItemLabel => '새 아이템';
|
||||
|
||||
@override
|
||||
String get notifyBossSlainLabel => '보스 처치';
|
||||
|
||||
@override
|
||||
String get notifySavedLabel => '저장됨';
|
||||
|
||||
@override
|
||||
String get notifyInfoLabel => '정보';
|
||||
|
||||
@override
|
||||
String get notifyWarningLabel => '경고';
|
||||
}
|
||||
|
||||
@@ -1,294 +0,0 @@
|
||||
// ignore: unused_import
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
import 'app_localizations.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
/// The translations for Chinese (`zh`).
|
||||
class L10nZh extends L10n {
|
||||
L10nZh([String locale = 'zh']) : super(locale);
|
||||
|
||||
@override
|
||||
String get appTitle => 'ASCII NEVER DIE';
|
||||
|
||||
@override
|
||||
String get tagNoNetwork => 'No network';
|
||||
|
||||
@override
|
||||
String get tagIdleRpg => 'Idle RPG loop';
|
||||
|
||||
@override
|
||||
String get tagLocalSaves => 'Local saves';
|
||||
|
||||
@override
|
||||
String get newCharacter => 'New character';
|
||||
|
||||
@override
|
||||
String get loadSave => 'Load save';
|
||||
|
||||
@override
|
||||
String get loadGame => 'Load Game';
|
||||
|
||||
@override
|
||||
String get viewBuildPlan => 'View build plan';
|
||||
|
||||
@override
|
||||
String get buildRoadmap => 'Build roadmap';
|
||||
|
||||
@override
|
||||
String get techStack => 'Tech stack';
|
||||
|
||||
@override
|
||||
String get cancel => 'Cancel';
|
||||
|
||||
@override
|
||||
String get exitGame => 'Exit Game';
|
||||
|
||||
@override
|
||||
String get saveProgressQuestion => 'Save your progress before leaving?';
|
||||
|
||||
@override
|
||||
String get exitWithoutSaving => 'Exit without saving';
|
||||
|
||||
@override
|
||||
String get saveAndExit => 'Save and Exit';
|
||||
|
||||
@override
|
||||
String progressQuestTitle(String name) {
|
||||
return 'ASCII NEVER DIE - $name';
|
||||
}
|
||||
|
||||
@override
|
||||
String get levelUp => 'Level Up';
|
||||
|
||||
@override
|
||||
String get completeQuest => 'Complete Quest';
|
||||
|
||||
@override
|
||||
String get completePlot => 'Complete Plot';
|
||||
|
||||
@override
|
||||
String get characterSheet => 'Character Sheet';
|
||||
|
||||
@override
|
||||
String get traits => 'Traits';
|
||||
|
||||
@override
|
||||
String get stats => 'Stats';
|
||||
|
||||
@override
|
||||
String get experience => 'Experience';
|
||||
|
||||
@override
|
||||
String get xpNeededForNextLevel => 'XP needed for next level';
|
||||
|
||||
@override
|
||||
String get spellBook => '技能';
|
||||
|
||||
@override
|
||||
String get noSpellsYet => '暂无技能';
|
||||
|
||||
@override
|
||||
String get equipment => 'Equipment';
|
||||
|
||||
@override
|
||||
String get inventory => 'Inventory';
|
||||
|
||||
@override
|
||||
String get encumbrance => 'Encumbrance';
|
||||
|
||||
@override
|
||||
String get combatLog => '战斗日志';
|
||||
|
||||
@override
|
||||
String get plotDevelopment => 'Plot Development';
|
||||
|
||||
@override
|
||||
String get quests => 'Quests';
|
||||
|
||||
@override
|
||||
String get traitName => 'Name';
|
||||
|
||||
@override
|
||||
String get traitRace => 'Race';
|
||||
|
||||
@override
|
||||
String get traitClass => 'Class';
|
||||
|
||||
@override
|
||||
String get traitLevel => 'Level';
|
||||
|
||||
@override
|
||||
String get statStr => 'STR';
|
||||
|
||||
@override
|
||||
String get statCon => 'CON';
|
||||
|
||||
@override
|
||||
String get statDex => 'DEX';
|
||||
|
||||
@override
|
||||
String get statInt => 'INT';
|
||||
|
||||
@override
|
||||
String get statWis => 'WIS';
|
||||
|
||||
@override
|
||||
String get statCha => 'CHA';
|
||||
|
||||
@override
|
||||
String get statHpMax => 'HP Max';
|
||||
|
||||
@override
|
||||
String get statMpMax => 'MP Max';
|
||||
|
||||
@override
|
||||
String get equipWeapon => 'Weapon';
|
||||
|
||||
@override
|
||||
String get equipShield => 'Shield';
|
||||
|
||||
@override
|
||||
String get equipHelm => 'Helm';
|
||||
|
||||
@override
|
||||
String get equipHauberk => 'Hauberk';
|
||||
|
||||
@override
|
||||
String get equipBrassairts => 'Brassairts';
|
||||
|
||||
@override
|
||||
String get equipVambraces => 'Vambraces';
|
||||
|
||||
@override
|
||||
String get equipGauntlets => 'Gauntlets';
|
||||
|
||||
@override
|
||||
String get equipGambeson => 'Gambeson';
|
||||
|
||||
@override
|
||||
String get equipCuisses => 'Cuisses';
|
||||
|
||||
@override
|
||||
String get equipGreaves => 'Greaves';
|
||||
|
||||
@override
|
||||
String get equipSollerets => 'Sollerets';
|
||||
|
||||
@override
|
||||
String get gold => 'Gold';
|
||||
|
||||
@override
|
||||
String goldAmount(int amount) {
|
||||
return 'Gold: $amount';
|
||||
}
|
||||
|
||||
@override
|
||||
String get prologue => 'Prologue';
|
||||
|
||||
@override
|
||||
String actNumber(String number) {
|
||||
return 'Act $number';
|
||||
}
|
||||
|
||||
@override
|
||||
String get noActiveQuests => 'No active quests';
|
||||
|
||||
@override
|
||||
String questNumber(int number) {
|
||||
return 'Quest #$number';
|
||||
}
|
||||
|
||||
@override
|
||||
String get welcomeMessage => '欢迎来到ASCII NEVER DIE!';
|
||||
|
||||
@override
|
||||
String get noSavedGames => 'No saved games found.';
|
||||
|
||||
@override
|
||||
String loadError(String error) {
|
||||
return 'Failed to load save file: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String get name => 'Name';
|
||||
|
||||
@override
|
||||
String get generateName => 'Generate Name';
|
||||
|
||||
@override
|
||||
String get total => 'Total';
|
||||
|
||||
@override
|
||||
String get unroll => 'Unroll';
|
||||
|
||||
@override
|
||||
String get roll => 'Roll';
|
||||
|
||||
@override
|
||||
String get race => 'Race';
|
||||
|
||||
@override
|
||||
String get classTitle => 'Class';
|
||||
|
||||
@override
|
||||
String percentComplete(int percent) {
|
||||
return '$percent% complete';
|
||||
}
|
||||
|
||||
@override
|
||||
String get newCharacterTitle => 'ASCII NEVER DIE - New Character';
|
||||
|
||||
@override
|
||||
String get soldButton => 'Sold!';
|
||||
|
||||
@override
|
||||
String get endingCongratulations => '★ 恭喜通关 ★';
|
||||
|
||||
@override
|
||||
String get endingGameComplete => '您已完成游戏!';
|
||||
|
||||
@override
|
||||
String get endingTheHero => '英雄';
|
||||
|
||||
@override
|
||||
String endingLevelFormat(int level) {
|
||||
return '等级 $level';
|
||||
}
|
||||
|
||||
@override
|
||||
String get endingJourneyStats => '冒险记录';
|
||||
|
||||
@override
|
||||
String get endingMonstersSlain => '击败的怪物';
|
||||
|
||||
@override
|
||||
String get endingQuestsCompleted => '完成的任务';
|
||||
|
||||
@override
|
||||
String get endingPlayTime => '游戏时间';
|
||||
|
||||
@override
|
||||
String get endingFinalStats => '最终属性';
|
||||
|
||||
@override
|
||||
String get endingCredits => '制作人员';
|
||||
|
||||
@override
|
||||
String get endingThankYou => '感谢您的游玩!';
|
||||
|
||||
@override
|
||||
String get endingLegendLivesOn => '您的传奇将永远流传...';
|
||||
|
||||
@override
|
||||
String get endingHallOfFameLine1 => '您的英雄事迹';
|
||||
|
||||
@override
|
||||
String get endingHallOfFameLine2 => '将被铭记于荣誉殿堂';
|
||||
|
||||
@override
|
||||
String get endingSkip => '跳过';
|
||||
|
||||
@override
|
||||
String get endingTapToSkip => '点击跳过';
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
{
|
||||
"@@locale": "zh",
|
||||
|
||||
"appTitle": "ASCII NEVER DIE",
|
||||
"tagNoNetwork": "No network",
|
||||
"tagIdleRpg": "Idle RPG loop",
|
||||
"tagLocalSaves": "Local saves",
|
||||
"newCharacter": "New character",
|
||||
"loadSave": "Load save",
|
||||
"loadGame": "Load Game",
|
||||
"viewBuildPlan": "View build plan",
|
||||
"buildRoadmap": "Build roadmap",
|
||||
"techStack": "Tech stack",
|
||||
"cancel": "Cancel",
|
||||
"exitGame": "Exit Game",
|
||||
"saveProgressQuestion": "Save your progress before leaving?",
|
||||
"exitWithoutSaving": "Exit without saving",
|
||||
"saveAndExit": "Save and Exit",
|
||||
"progressQuestTitle": "ASCII NEVER DIE - {name}",
|
||||
"levelUp": "Level Up",
|
||||
"completeQuest": "Complete Quest",
|
||||
"completePlot": "Complete Plot",
|
||||
"characterSheet": "Character Sheet",
|
||||
"traits": "Traits",
|
||||
"stats": "Stats",
|
||||
"experience": "Experience",
|
||||
"xpNeededForNextLevel": "XP needed for next level",
|
||||
"spellBook": "技能",
|
||||
"noSpellsYet": "暂无技能",
|
||||
"equipment": "Equipment",
|
||||
"inventory": "Inventory",
|
||||
"encumbrance": "Encumbrance",
|
||||
"combatLog": "战斗日志",
|
||||
"plotDevelopment": "Plot Development",
|
||||
"quests": "Quests",
|
||||
"traitName": "Name",
|
||||
"traitRace": "Race",
|
||||
"traitClass": "Class",
|
||||
"traitLevel": "Level",
|
||||
"statStr": "STR",
|
||||
"statCon": "CON",
|
||||
"statDex": "DEX",
|
||||
"statInt": "INT",
|
||||
"statWis": "WIS",
|
||||
"statCha": "CHA",
|
||||
"statHpMax": "HP Max",
|
||||
"statMpMax": "MP Max",
|
||||
"equipWeapon": "Weapon",
|
||||
"equipShield": "Shield",
|
||||
"equipHelm": "Helm",
|
||||
"equipHauberk": "Hauberk",
|
||||
"equipBrassairts": "Brassairts",
|
||||
"equipVambraces": "Vambraces",
|
||||
"equipGauntlets": "Gauntlets",
|
||||
"equipGambeson": "Gambeson",
|
||||
"equipCuisses": "Cuisses",
|
||||
"equipGreaves": "Greaves",
|
||||
"equipSollerets": "Sollerets",
|
||||
"gold": "Gold",
|
||||
"goldAmount": "Gold: {amount}",
|
||||
"prologue": "Prologue",
|
||||
"actNumber": "Act {number}",
|
||||
"noActiveQuests": "No active quests",
|
||||
"questNumber": "Quest #{number}",
|
||||
"welcomeMessage": "欢迎来到ASCII NEVER DIE!",
|
||||
"noSavedGames": "No saved games found.",
|
||||
"loadError": "Failed to load save file: {error}",
|
||||
"name": "Name",
|
||||
"generateName": "Generate Name",
|
||||
"total": "Total",
|
||||
"unroll": "Unroll",
|
||||
"roll": "Roll",
|
||||
"race": "Race",
|
||||
"classTitle": "Class",
|
||||
"percentComplete": "{percent}% complete",
|
||||
"newCharacterTitle": "ASCII NEVER DIE - New Character",
|
||||
"soldButton": "Sold!",
|
||||
|
||||
"endingCongratulations": "★ 恭喜通关 ★",
|
||||
"endingGameComplete": "您已完成游戏!",
|
||||
"endingTheHero": "英雄",
|
||||
"endingLevelFormat": "等级 {level}",
|
||||
"endingJourneyStats": "冒险记录",
|
||||
"endingMonstersSlain": "击败的怪物",
|
||||
"endingQuestsCompleted": "完成的任务",
|
||||
"endingPlayTime": "游戏时间",
|
||||
"endingFinalStats": "最终属性",
|
||||
"endingCredits": "制作人员",
|
||||
"endingThankYou": "感谢您的游玩!",
|
||||
"endingLegendLivesOn": "您的传奇将永远流传...",
|
||||
"endingHallOfFameLine1": "您的英雄事迹",
|
||||
"endingHallOfFameLine2": "将被铭记于荣誉殿堂",
|
||||
"endingSkip": "跳过",
|
||||
"endingTapToSkip": "点击跳过"
|
||||
}
|
||||
@@ -1,6 +1,12 @@
|
||||
import 'package:asciineverdie/src/app.dart';
|
||||
import 'package:asciineverdie/src/core/di/service_locator.dart';
|
||||
import 'package:asciineverdie/src/core/logging/error_logger_zone.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const AskiiNeverDieApp());
|
||||
setupErrorHandling(() async {
|
||||
// 서비스 로케이터(service locator) 초기화
|
||||
setupServiceLocator();
|
||||
runApp(const AskiiNeverDieApp());
|
||||
});
|
||||
}
|
||||
|
||||
642
lib/src/app.dart
642
lib/src/app.dart
@@ -3,7 +3,11 @@ import 'package:flutter/material.dart';
|
||||
import 'package:asciineverdie/data/game_text_l10n.dart' as game_l10n;
|
||||
import 'package:asciineverdie/l10n/app_localizations.dart';
|
||||
import 'package:asciineverdie/src/core/audio/audio_service.dart';
|
||||
import 'package:asciineverdie/src/shared/retro_colors.dart';
|
||||
import 'package:asciineverdie/src/core/infrastructure/ad_service.dart';
|
||||
import 'package:asciineverdie/src/core/engine/debug_settings_service.dart';
|
||||
import 'package:asciineverdie/src/core/infrastructure/iap_service.dart';
|
||||
import 'package:asciineverdie/src/app_theme.dart';
|
||||
import 'package:asciineverdie/src/splash_screen.dart';
|
||||
import 'package:asciineverdie/src/core/engine/game_mutations.dart';
|
||||
import 'package:asciineverdie/src/core/engine/progress_service.dart';
|
||||
import 'package:asciineverdie/src/core/engine/reward_service.dart';
|
||||
@@ -23,6 +27,7 @@ import 'package:asciineverdie/src/features/game/game_session_controller.dart';
|
||||
import 'package:asciineverdie/src/features/game/widgets/notification_overlay.dart';
|
||||
import 'package:asciineverdie/src/features/hall_of_fame/hall_of_fame_screen.dart';
|
||||
import 'package:asciineverdie/src/features/new_character/new_character_screen.dart';
|
||||
import 'package:asciineverdie/src/features/settings/settings_screen.dart';
|
||||
|
||||
class AskiiNeverDieApp extends StatefulWidget {
|
||||
const AskiiNeverDieApp({super.key});
|
||||
@@ -44,24 +49,30 @@ class SavedGamePreview {
|
||||
final String actName;
|
||||
}
|
||||
|
||||
class _AskiiNeverDieAppState extends State<AskiiNeverDieApp> {
|
||||
class _AskiiNeverDieAppState extends State<AskiiNeverDieApp>
|
||||
with WidgetsBindingObserver {
|
||||
late final GameSessionController _controller;
|
||||
late final NotificationService _notificationService;
|
||||
late final SettingsRepository _settingsRepository;
|
||||
late final AudioService _audioService;
|
||||
late final HallOfFameStorage _hallOfFameStorage;
|
||||
final RouteObserver<ModalRoute<void>> _routeObserver =
|
||||
RouteObserver<ModalRoute<void>>();
|
||||
bool _isCheckingSave = true;
|
||||
bool _hasSave = false;
|
||||
SavedGamePreview? _savedGamePreview;
|
||||
ThemeMode _themeMode = ThemeMode.system;
|
||||
HallOfFame _hallOfFame = HallOfFame.empty();
|
||||
Locale? _locale; // 사용자 선택 로케일 (null이면 시스템 기본값)
|
||||
bool _isAdRemovalPurchased = false;
|
||||
String? _removeAdsPrice;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
const config = PqConfig();
|
||||
final mutations = GameMutations(config);
|
||||
final rewards = RewardService(mutations);
|
||||
final rewards = RewardService(mutations, config);
|
||||
|
||||
_controller = GameSessionController(
|
||||
progressService: ProgressService(
|
||||
@@ -79,12 +90,33 @@ class _AskiiNeverDieAppState extends State<AskiiNeverDieApp> {
|
||||
// 초기 설정 및 오디오 서비스 로드
|
||||
_loadSettings();
|
||||
_audioService.init();
|
||||
// IAP 서비스 초기화
|
||||
_initIAP();
|
||||
// 세이브 파일 존재 여부 확인
|
||||
_checkForExistingSave();
|
||||
// 명예의 전당 로드
|
||||
_loadHallOfFame();
|
||||
}
|
||||
|
||||
/// IAP 및 광고 서비스 초기화
|
||||
Future<void> _initIAP() async {
|
||||
await IAPService.instance.initialize();
|
||||
await AdService.instance.initialize();
|
||||
_updateIAPState();
|
||||
}
|
||||
|
||||
/// IAP 상태 업데이트 (구매 여부, 가격)
|
||||
void _updateIAPState() {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isAdRemovalPurchased = IAPService.instance.isAdRemovalPurchased;
|
||||
_removeAdsPrice = IAPService.instance.isStoreAvailable
|
||||
? IAPService.instance.removeAdsPrice
|
||||
: null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// 명예의 전당 로드
|
||||
Future<void> _loadHallOfFame() async {
|
||||
final hallOfFame = await _hallOfFameStorage.load();
|
||||
@@ -97,16 +129,26 @@ class _AskiiNeverDieAppState extends State<AskiiNeverDieApp> {
|
||||
|
||||
/// 저장된 설정 불러오기
|
||||
Future<void> _loadSettings() async {
|
||||
final themeMode = await _settingsRepository.loadThemeMode();
|
||||
// 디버그 설정 먼저 초기화 (광고/IAP 시뮬레이션 설정 동기화)
|
||||
await DebugSettingsService.instance.initialize();
|
||||
|
||||
final localeCode = await _settingsRepository.loadLocale();
|
||||
if (mounted) {
|
||||
setState(() => _themeMode = themeMode);
|
||||
setState(() {
|
||||
// 저장된 로케일이 있으면 적용
|
||||
if (localeCode != null) {
|
||||
_locale = Locale(localeCode);
|
||||
game_l10n.setGameLocale(localeCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// 테마 모드 변경
|
||||
void _changeThemeMode(ThemeMode mode) {
|
||||
setState(() => _themeMode = mode);
|
||||
_settingsRepository.saveThemeMode(mode);
|
||||
/// 로케일 변경
|
||||
void _changeLocale(String localeCode) {
|
||||
setState(() {
|
||||
_locale = Locale(localeCode);
|
||||
});
|
||||
}
|
||||
|
||||
/// 세이브 파일 존재 여부 확인 및 미리보기 정보 로드
|
||||
@@ -116,7 +158,7 @@ class _AskiiNeverDieAppState extends State<AskiiNeverDieApp> {
|
||||
|
||||
if (exists) {
|
||||
// 세이브 파일에서 미리보기 정보 추출
|
||||
final (outcome, state, _) = await _controller.saveManager.loadState();
|
||||
final (outcome, state, _, _) = await _controller.saveManager.loadState();
|
||||
if (outcome.success && state != null) {
|
||||
final actName = _getActName(state.progress.plotStageCount);
|
||||
preview = SavedGamePreview(
|
||||
@@ -133,8 +175,11 @@ class _AskiiNeverDieAppState extends State<AskiiNeverDieApp> {
|
||||
_savedGamePreview = preview;
|
||||
_isCheckingSave = false;
|
||||
});
|
||||
// 세이브 확인 완료 후 타이틀 BGM 재생
|
||||
_audioService.playBgm('title');
|
||||
// 세이브 확인 완료 후 타이틀 BGM 재생 (앱이 포그라운드일 때만)
|
||||
final lifecycleState = WidgetsBinding.instance.lifecycleState;
|
||||
if (lifecycleState == AppLifecycleState.resumed) {
|
||||
_audioService.playBgm('title');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,279 +198,29 @@ class _AskiiNeverDieAppState extends State<AskiiNeverDieApp> {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
_controller.dispose();
|
||||
_notificationService.dispose();
|
||||
_audioService.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/// 라이트 테마 (Classic Parchment 스타일)
|
||||
ThemeData get _lightTheme => ThemeData(
|
||||
colorScheme: RetroColors.lightColorScheme,
|
||||
scaffoldBackgroundColor: const Color(0xFFFAF4ED),
|
||||
useMaterial3: true,
|
||||
// 카드/다이얼로그 레트로 배경
|
||||
cardColor: const Color(0xFFF2E8DC),
|
||||
dialogTheme: const DialogThemeData(
|
||||
backgroundColor: Color(0xFFF2E8DC),
|
||||
titleTextStyle: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 12,
|
||||
color: Color(0xFFB8860B),
|
||||
),
|
||||
),
|
||||
// 앱바 레트로 스타일
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: Color(0xFFF2E8DC),
|
||||
foregroundColor: Color(0xFF1F1F28),
|
||||
titleTextStyle: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 12,
|
||||
color: Color(0xFFB8860B),
|
||||
),
|
||||
),
|
||||
// 버튼 테마
|
||||
filledButtonTheme: FilledButtonThemeData(
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: const Color(0xFFE8DDD0),
|
||||
foregroundColor: const Color(0xFF1F1F28),
|
||||
textStyle: const TextStyle(
|
||||
inherit: false,
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFF1F1F28),
|
||||
),
|
||||
),
|
||||
),
|
||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: const Color(0xFFB8860B),
|
||||
side: const BorderSide(color: Color(0xFFB8860B), width: 2),
|
||||
textStyle: const TextStyle(
|
||||
inherit: false,
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFFB8860B),
|
||||
),
|
||||
),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: const Color(0xFF4A4458),
|
||||
textStyle: const TextStyle(
|
||||
inherit: false,
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFF4A4458),
|
||||
),
|
||||
),
|
||||
),
|
||||
// 텍스트 테마
|
||||
textTheme: const TextTheme(
|
||||
headlineLarge: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 18,
|
||||
color: Color(0xFFB8860B),
|
||||
),
|
||||
headlineMedium: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 14,
|
||||
color: Color(0xFFB8860B),
|
||||
),
|
||||
headlineSmall: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 12,
|
||||
color: Color(0xFFB8860B),
|
||||
),
|
||||
titleLarge: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 12,
|
||||
color: Color(0xFF1F1F28),
|
||||
),
|
||||
titleMedium: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFF1F1F28),
|
||||
),
|
||||
titleSmall: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFF1F1F28),
|
||||
),
|
||||
bodyLarge: TextStyle(fontSize: 14, color: Color(0xFF1F1F28)),
|
||||
bodyMedium: TextStyle(fontSize: 12, color: Color(0xFF1F1F28)),
|
||||
bodySmall: TextStyle(fontSize: 10, color: Color(0xFF1F1F28)),
|
||||
labelLarge: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 11,
|
||||
color: Color(0xFF1F1F28),
|
||||
),
|
||||
labelMedium: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFF1F1F28),
|
||||
),
|
||||
labelSmall: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 8,
|
||||
color: Color(0xFF1F1F28),
|
||||
),
|
||||
),
|
||||
// 칩 테마
|
||||
chipTheme: const ChipThemeData(
|
||||
backgroundColor: Color(0xFFE8DDD0),
|
||||
labelStyle: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFF1F1F28),
|
||||
),
|
||||
side: BorderSide(color: Color(0xFF8B7355)),
|
||||
),
|
||||
// 리스트 타일 테마
|
||||
listTileTheme: const ListTileThemeData(
|
||||
textColor: Color(0xFF1F1F28),
|
||||
iconColor: Color(0xFFB8860B),
|
||||
),
|
||||
// 프로그레스 인디케이터
|
||||
progressIndicatorTheme: const ProgressIndicatorThemeData(
|
||||
color: Color(0xFFB8860B),
|
||||
linearTrackColor: Color(0xFFD4C4B0),
|
||||
),
|
||||
);
|
||||
|
||||
/// 다크 테마 (Dark Fantasy 스타일)
|
||||
ThemeData get _darkTheme => ThemeData(
|
||||
colorScheme: RetroColors.darkColorScheme,
|
||||
scaffoldBackgroundColor: RetroColors.deepBrown,
|
||||
useMaterial3: true,
|
||||
// 카드/다이얼로그 레트로 배경
|
||||
cardColor: RetroColors.darkBrown,
|
||||
dialogTheme: const DialogThemeData(
|
||||
backgroundColor: Color(0xFF24283B),
|
||||
titleTextStyle: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 12,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
),
|
||||
// 앱바 레트로 스타일
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: Color(0xFF24283B),
|
||||
foregroundColor: Color(0xFFC0CAF5),
|
||||
titleTextStyle: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 12,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
),
|
||||
// 버튼 테마 (inherit: false로 애니메이션 lerp 오류 방지)
|
||||
filledButtonTheme: FilledButtonThemeData(
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF3D4260),
|
||||
foregroundColor: const Color(0xFFC0CAF5),
|
||||
textStyle: const TextStyle(
|
||||
inherit: false,
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
),
|
||||
),
|
||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: const Color(0xFFE0AF68),
|
||||
side: const BorderSide(color: Color(0xFFE0AF68), width: 2),
|
||||
textStyle: const TextStyle(
|
||||
inherit: false,
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: const Color(0xFFC0CAF5),
|
||||
textStyle: const TextStyle(
|
||||
inherit: false,
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
),
|
||||
),
|
||||
// 텍스트 테마
|
||||
textTheme: const TextTheme(
|
||||
headlineLarge: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 18,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
headlineMedium: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 14,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
headlineSmall: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 12,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
titleLarge: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 12,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
titleMedium: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
titleSmall: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
bodyLarge: TextStyle(fontSize: 14, color: Color(0xFFC0CAF5)),
|
||||
bodyMedium: TextStyle(fontSize: 12, color: Color(0xFFC0CAF5)),
|
||||
bodySmall: TextStyle(fontSize: 10, color: Color(0xFFC0CAF5)),
|
||||
labelLarge: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 11,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
labelMedium: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
labelSmall: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 8,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
),
|
||||
// 칩 테마
|
||||
chipTheme: const ChipThemeData(
|
||||
backgroundColor: Color(0xFF2A2E3F),
|
||||
labelStyle: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 10,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
side: BorderSide(color: Color(0xFF545C7E)),
|
||||
),
|
||||
// 리스트 타일 테마
|
||||
listTileTheme: const ListTileThemeData(
|
||||
textColor: Color(0xFFC0CAF5),
|
||||
iconColor: Color(0xFFE0AF68),
|
||||
),
|
||||
// 프로그레스 인디케이터
|
||||
progressIndicatorTheme: const ProgressIndicatorThemeData(
|
||||
color: Color(0xFFE0AF68),
|
||||
linearTrackColor: Color(0xFF3B4261),
|
||||
),
|
||||
);
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
super.didChangeAppLifecycleState(state);
|
||||
// 앱이 백그라운드로 내려가면 오디오 정지
|
||||
if (state == AppLifecycleState.paused ||
|
||||
state == AppLifecycleState.inactive) {
|
||||
_audioService.pauseAll();
|
||||
} else if (state == AppLifecycleState.resumed) {
|
||||
_audioService.resumeAll().then((_) {
|
||||
// 복귀 후 BGM이 없고 시작 화면이면 타이틀 BGM 재생
|
||||
if (_audioService.currentBgm == null && !_isCheckingSave) {
|
||||
_audioService.playBgm('title');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -434,9 +229,9 @@ class _AskiiNeverDieAppState extends State<AskiiNeverDieApp> {
|
||||
debugShowCheckedModeBanner: false,
|
||||
localizationsDelegates: L10n.localizationsDelegates,
|
||||
supportedLocales: L10n.supportedLocales,
|
||||
theme: _lightTheme,
|
||||
darkTheme: _darkTheme,
|
||||
themeMode: _themeMode,
|
||||
locale: _locale, // 사용자 선택 로케일 (null이면 시스템 기본값)
|
||||
theme: buildAppTheme(),
|
||||
navigatorObservers: [_routeObserver],
|
||||
builder: (context, child) {
|
||||
// 현재 로케일을 게임 텍스트 l10n 시스템에 동기화
|
||||
final locale = Localizations.localeOf(context);
|
||||
@@ -454,7 +249,7 @@ class _AskiiNeverDieAppState extends State<AskiiNeverDieApp> {
|
||||
Widget _buildHomeScreen() {
|
||||
// 세이브 확인 중이면 로딩 스플래시 표시
|
||||
if (_isCheckingSave) {
|
||||
return const _SplashScreen();
|
||||
return const SplashScreen();
|
||||
}
|
||||
|
||||
return FrontScreen(
|
||||
@@ -462,25 +257,39 @@ class _AskiiNeverDieAppState extends State<AskiiNeverDieApp> {
|
||||
onLoadSave: _loadSave,
|
||||
onHallOfFame: _navigateToHallOfFame,
|
||||
onLocalArena: _navigateToArena,
|
||||
onSettings: _showSettings,
|
||||
onPurchaseRemoveAds: _purchaseRemoveAds,
|
||||
onRestorePurchase: _restorePurchase,
|
||||
hasSaveFile: _hasSave,
|
||||
savedGamePreview: _savedGamePreview,
|
||||
hallOfFameCount: _hallOfFame.count,
|
||||
isAdRemovalPurchased: _isAdRemovalPurchased,
|
||||
removeAdsPrice: _removeAdsPrice,
|
||||
routeObserver: _routeObserver,
|
||||
onRefresh: () {
|
||||
_checkForExistingSave();
|
||||
_loadHallOfFame();
|
||||
_updateIAPState();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _navigateToNewCharacter(BuildContext context) {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (context) => NewCharacterScreen(
|
||||
onCharacterCreated: (initialState, {bool testMode = false}) {
|
||||
_startGame(context, initialState, testMode: testMode);
|
||||
},
|
||||
),
|
||||
),
|
||||
).then((_) {
|
||||
// 새 게임 후 돌아오면 세이브 정보 갱신 (BGM은 _checkForExistingSave에서 재생)
|
||||
_checkForExistingSave();
|
||||
});
|
||||
Navigator.of(context)
|
||||
.push(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (context) => NewCharacterScreen(
|
||||
onCharacterCreated: (initialState, {bool testMode = false}) {
|
||||
_startGame(context, initialState, testMode: testMode);
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
.then((_) {
|
||||
// 새 게임 후 돌아오면 세이브 정보 및 명예의 전당 갱신
|
||||
_checkForExistingSave();
|
||||
_loadHallOfFame();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _loadSave(BuildContext context) async {
|
||||
@@ -535,8 +344,6 @@ class _AskiiNeverDieAppState extends State<AskiiNeverDieApp> {
|
||||
controller: _controller,
|
||||
audioService: _audioService,
|
||||
forceCarouselLayout: testMode,
|
||||
currentThemeMode: _themeMode,
|
||||
onThemeModeChange: _changeThemeMode,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -544,178 +351,109 @@ class _AskiiNeverDieAppState extends State<AskiiNeverDieApp> {
|
||||
}
|
||||
|
||||
void _navigateToGame(BuildContext context) {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (context) => GamePlayScreen(
|
||||
controller: _controller,
|
||||
audioService: _audioService,
|
||||
currentThemeMode: _themeMode,
|
||||
onThemeModeChange: _changeThemeMode,
|
||||
),
|
||||
),
|
||||
).then((_) {
|
||||
// 게임에서 돌아오면 세이브 정보 갱신 (BGM은 _checkForExistingSave에서 재생)
|
||||
_checkForExistingSave();
|
||||
});
|
||||
Navigator.of(context)
|
||||
.push(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (context) => GamePlayScreen(
|
||||
controller: _controller,
|
||||
audioService: _audioService,
|
||||
// 디버그 모드로 저장된 게임 로드 시 캐로셀 레이아웃 강제
|
||||
forceCarouselLayout: _controller.cheatsEnabled,
|
||||
),
|
||||
),
|
||||
)
|
||||
.then((_) {
|
||||
// 게임에서 돌아오면 세이브 정보 및 명예의 전당 갱신
|
||||
_checkForExistingSave();
|
||||
_loadHallOfFame();
|
||||
});
|
||||
}
|
||||
|
||||
/// Phase 10: 명예의 전당 화면으로 이동
|
||||
void _navigateToHallOfFame(BuildContext context) {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute<void>(builder: (context) => const HallOfFameScreen()),
|
||||
).then((_) {
|
||||
// 명예의 전당에서 돌아오면 타이틀 BGM 재생
|
||||
_audioService.playBgm('title');
|
||||
});
|
||||
Navigator.of(context)
|
||||
.push(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (context) => const HallOfFameScreen(),
|
||||
),
|
||||
)
|
||||
.then((_) {
|
||||
// 명예의 전당에서 돌아오면 명예의 전당 갱신 및 타이틀 BGM 재생
|
||||
_loadHallOfFame();
|
||||
_audioService.playBgm('title');
|
||||
});
|
||||
}
|
||||
|
||||
/// 로컬 아레나 화면으로 이동
|
||||
void _navigateToArena(BuildContext context) {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (context) => const ArenaScreen(),
|
||||
),
|
||||
).then((_) {
|
||||
// 아레나에서 돌아오면 명예의 전당 다시 로드 및 타이틀 BGM 재생
|
||||
_loadHallOfFame();
|
||||
_audioService.playBgm('title');
|
||||
});
|
||||
Navigator.of(context)
|
||||
.push(
|
||||
MaterialPageRoute<void>(builder: (context) => const ArenaScreen()),
|
||||
)
|
||||
.then((_) {
|
||||
// 아레나에서 돌아오면 명예의 전당 다시 로드 및 타이틀 BGM 재생
|
||||
_loadHallOfFame();
|
||||
_audioService.playBgm('title');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// 스플래시 화면 (세이브 파일 확인 중) - 레트로 스타일
|
||||
class _SplashScreen extends StatelessWidget {
|
||||
const _SplashScreen();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: RetroColors.deepBrown,
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// 타이틀 로고
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: RetroColors.panelBg,
|
||||
border: Border.all(color: RetroColors.gold, width: 3),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// 아이콘
|
||||
const Icon(
|
||||
Icons.auto_awesome,
|
||||
size: 32,
|
||||
color: RetroColors.gold,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
// 타이틀
|
||||
const Text(
|
||||
'ASCII',
|
||||
style: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 20,
|
||||
color: RetroColors.gold,
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: RetroColors.goldDark,
|
||||
offset: Offset(2, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
const Text(
|
||||
'NEVER DIE',
|
||||
style: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 14,
|
||||
color: RetroColors.cream,
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: RetroColors.brown,
|
||||
offset: Offset(1, 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
// 레트로 로딩 바
|
||||
SizedBox(
|
||||
width: 160,
|
||||
child: _RetroLoadingBar(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
/// 설정 화면 표시 (모달 바텀시트)
|
||||
void _showSettings(BuildContext context) {
|
||||
SettingsScreen.show(
|
||||
context,
|
||||
settingsRepository: _settingsRepository,
|
||||
onLocaleChange: _changeLocale,
|
||||
onBgmVolumeChange: _audioService.setBgmVolume,
|
||||
onSfxVolumeChange: _audioService.setSfxVolume,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 레트로 스타일 로딩 바 (애니메이션)
|
||||
class _RetroLoadingBar extends StatefulWidget {
|
||||
@override
|
||||
State<_RetroLoadingBar> createState() => _RetroLoadingBarState();
|
||||
}
|
||||
/// 광고 제거 구매
|
||||
Future<void> _purchaseRemoveAds(BuildContext context) async {
|
||||
final result = await IAPService.instance.purchaseRemoveAds();
|
||||
_updateIAPState();
|
||||
|
||||
class _RetroLoadingBarState extends State<_RetroLoadingBar>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late AnimationController _controller;
|
||||
if (!context.mounted) return;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController(
|
||||
duration: const Duration(milliseconds: 1500),
|
||||
vsync: this,
|
||||
)..repeat();
|
||||
switch (result) {
|
||||
case IAPResult.success:
|
||||
case IAPResult.debugSimulated:
|
||||
_notificationService.showInfo(game_l10n.iapPurchaseSuccess);
|
||||
case IAPResult.alreadyPurchased:
|
||||
_notificationService.showInfo(game_l10n.iapAlreadyPurchased);
|
||||
case IAPResult.cancelled:
|
||||
// 취소는 무시
|
||||
break;
|
||||
case IAPResult.storeUnavailable:
|
||||
_notificationService.showWarning(game_l10n.iapStoreUnavailable);
|
||||
case IAPResult.productNotFound:
|
||||
case IAPResult.failed:
|
||||
_notificationService.showWarning(game_l10n.iapPurchaseFailed);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
/// 구매 복원
|
||||
Future<void> _restorePurchase(BuildContext context) async {
|
||||
final result = await IAPService.instance.restorePurchases();
|
||||
_updateIAPState();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const segmentCount = 10;
|
||||
if (!context.mounted) return;
|
||||
|
||||
return AnimatedBuilder(
|
||||
animation: _controller,
|
||||
builder: (context, child) {
|
||||
// 웨이브 효과: 각 세그먼트가 순차적으로 켜지고 꺼짐
|
||||
return Container(
|
||||
height: 16,
|
||||
decoration: BoxDecoration(
|
||||
color: RetroColors.panelBg,
|
||||
border: Border.all(color: RetroColors.panelBorderOuter, width: 2),
|
||||
),
|
||||
child: Row(
|
||||
children: List.generate(segmentCount, (index) {
|
||||
// 웨이브 패턴 계산
|
||||
final progress = _controller.value * segmentCount;
|
||||
final distance = (index - progress).abs();
|
||||
final isLit = distance < 2 || (segmentCount - distance) < 2;
|
||||
final opacity = isLit ? 1.0 : 0.2;
|
||||
|
||||
return Expanded(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(1),
|
||||
decoration: BoxDecoration(
|
||||
color: RetroColors.gold.withValues(alpha: opacity),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
switch (result) {
|
||||
case IAPResult.success:
|
||||
case IAPResult.debugSimulated:
|
||||
if (_isAdRemovalPurchased) {
|
||||
_notificationService.showInfo(game_l10n.iapRestoreSuccess);
|
||||
} else {
|
||||
_notificationService.showInfo(game_l10n.iapRestoreFailed);
|
||||
}
|
||||
case IAPResult.storeUnavailable:
|
||||
_notificationService.showWarning(game_l10n.iapStoreUnavailable);
|
||||
case IAPResult.alreadyPurchased:
|
||||
case IAPResult.cancelled:
|
||||
case IAPResult.productNotFound:
|
||||
case IAPResult.failed:
|
||||
_notificationService.showWarning(game_l10n.iapRestoreFailed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
137
lib/src/app_theme.dart
Normal file
137
lib/src/app_theme.dart
Normal file
@@ -0,0 +1,137 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:asciineverdie/src/shared/retro_colors.dart';
|
||||
|
||||
/// 앱 테마 (Dark Fantasy 스타일)
|
||||
ThemeData buildAppTheme() => ThemeData(
|
||||
colorScheme: RetroColors.darkColorScheme,
|
||||
scaffoldBackgroundColor: RetroColors.deepBrown,
|
||||
useMaterial3: true,
|
||||
// 카드/다이얼로그 레트로 배경
|
||||
cardColor: RetroColors.darkBrown,
|
||||
dialogTheme: const DialogThemeData(
|
||||
backgroundColor: Color(0xFF24283B),
|
||||
titleTextStyle: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 15,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
),
|
||||
// 앱바 레트로 스타일
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: Color(0xFF24283B),
|
||||
foregroundColor: Color(0xFFC0CAF5),
|
||||
titleTextStyle: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 15,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
),
|
||||
// 버튼 테마 (inherit: false로 애니메이션 lerp 오류 방지)
|
||||
filledButtonTheme: FilledButtonThemeData(
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF3D4260),
|
||||
foregroundColor: const Color(0xFFC0CAF5),
|
||||
textStyle: const TextStyle(
|
||||
inherit: false,
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 14,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
),
|
||||
),
|
||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: const Color(0xFFE0AF68),
|
||||
side: const BorderSide(color: Color(0xFFE0AF68), width: 2),
|
||||
textStyle: const TextStyle(
|
||||
inherit: false,
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 14,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: const Color(0xFFC0CAF5),
|
||||
textStyle: const TextStyle(
|
||||
inherit: false,
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 14,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
),
|
||||
),
|
||||
// 텍스트 테마
|
||||
textTheme: const TextTheme(
|
||||
headlineLarge: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 20,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
headlineMedium: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 16,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
headlineSmall: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 15,
|
||||
color: Color(0xFFE0AF68),
|
||||
),
|
||||
titleLarge: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 15,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
titleMedium: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 14,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
titleSmall: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 14,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
bodyLarge: TextStyle(fontSize: 18, color: Color(0xFFC0CAF5)),
|
||||
bodyMedium: TextStyle(fontSize: 17, color: Color(0xFFC0CAF5)),
|
||||
bodySmall: TextStyle(fontSize: 15, color: Color(0xFFC0CAF5)),
|
||||
labelLarge: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 14,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
labelMedium: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 14,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
labelSmall: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 13,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
),
|
||||
// 칩 테마
|
||||
chipTheme: const ChipThemeData(
|
||||
backgroundColor: Color(0xFF2A2E3F),
|
||||
labelStyle: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 14,
|
||||
color: Color(0xFFC0CAF5),
|
||||
),
|
||||
side: BorderSide(color: Color(0xFF545C7E)),
|
||||
),
|
||||
// 리스트 타일 테마
|
||||
listTileTheme: const ListTileThemeData(
|
||||
textColor: Color(0xFFC0CAF5),
|
||||
iconColor: Color(0xFFE0AF68),
|
||||
),
|
||||
// 프로그레스 인디케이터
|
||||
progressIndicatorTheme: const ProgressIndicatorThemeData(
|
||||
color: Color(0xFFE0AF68),
|
||||
linearTrackColor: Color(0xFF3B4261),
|
||||
),
|
||||
);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,50 +0,0 @@
|
||||
// 몬스터 크기 시스템
|
||||
// 몬스터 레벨에 따라 ASCII 아트 크기 결정
|
||||
|
||||
/// 몬스터 크기 enum
|
||||
/// 실제 프레임 줄 수와 일치하도록 설정
|
||||
enum MonsterSize {
|
||||
/// 2줄 (레벨 1-5)
|
||||
tiny(2),
|
||||
|
||||
/// 4줄 (레벨 6-10)
|
||||
small(4),
|
||||
|
||||
/// 6줄 (레벨 11-15)
|
||||
medium(6),
|
||||
|
||||
/// 8줄 (레벨 16-25)
|
||||
large(8),
|
||||
|
||||
/// 8줄 (레벨 26-35)
|
||||
huge(8),
|
||||
|
||||
/// 8줄 (레벨 36-50)
|
||||
giant(8),
|
||||
|
||||
/// 8줄 (레벨 51+, 보스급)
|
||||
titanic(8);
|
||||
|
||||
const MonsterSize(this.lines);
|
||||
|
||||
/// 해당 크기의 줄 수
|
||||
final int lines;
|
||||
}
|
||||
|
||||
/// 몬스터 레벨에서 크기 결정
|
||||
MonsterSize getMonsterSize(int? level) {
|
||||
if (level == null || level <= 0) return MonsterSize.tiny;
|
||||
|
||||
if (level <= 5) return MonsterSize.tiny;
|
||||
if (level <= 10) return MonsterSize.small;
|
||||
if (level <= 15) return MonsterSize.medium;
|
||||
if (level <= 25) return MonsterSize.large;
|
||||
if (level <= 35) return MonsterSize.huge;
|
||||
if (level <= 50) return MonsterSize.giant;
|
||||
return MonsterSize.titanic;
|
||||
}
|
||||
|
||||
/// 몬스터 크기에 따른 세로 패딩 계산 (7줄 프레임에서 중앙 정렬)
|
||||
int getMonsterVerticalPadding(MonsterSize size) {
|
||||
return (7 - size.lines) ~/ 2;
|
||||
}
|
||||
@@ -65,9 +65,9 @@ class AudioService {
|
||||
SfxChannelPool? _playerSfxPool;
|
||||
SfxChannelPool? _monsterSfxPool;
|
||||
|
||||
// 채널별 풀 크기 (줄임: 동시 재생 문제 완화)
|
||||
static const int _playerPoolSize = 2;
|
||||
static const int _monsterPoolSize = 2;
|
||||
// 채널별 풀 크기 (배속 전투에서 사운드 누락 방지)
|
||||
static const int _playerPoolSize = 4;
|
||||
static const int _monsterPoolSize = 4;
|
||||
|
||||
// 현재 볼륨
|
||||
double _bgmVolume = 0.7;
|
||||
@@ -85,6 +85,15 @@ class AudioService {
|
||||
// 오디오 일시정지 상태 (앱 백그라운드 시)
|
||||
bool _isPaused = false;
|
||||
|
||||
// 일시정지 전 재생 중이던 BGM (복귀 시 재개용)
|
||||
String? _pausedBgm;
|
||||
|
||||
// BGM 작업 진행 중 여부 (동시 호출 방지)
|
||||
bool _isBgmBusy = false;
|
||||
|
||||
// 대기 중인 BGM (작업 중 새 요청이 들어온 경우)
|
||||
String? _queuedBgm;
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────
|
||||
// 초기화
|
||||
// ─────────────────────────────────────────────────────────────────────────
|
||||
@@ -168,7 +177,8 @@ class AudioService {
|
||||
return;
|
||||
} catch (e) {
|
||||
debugPrint(
|
||||
'[AudioService] BGM player attempt ${attempt + 1} failed: $e');
|
||||
'[AudioService] BGM player attempt ${attempt + 1} failed: $e',
|
||||
);
|
||||
_staticBgmPlayer = null;
|
||||
if (attempt == maxRetries - 1) {
|
||||
debugPrint('[AudioService] BGM disabled');
|
||||
@@ -202,16 +212,36 @@ class AudioService {
|
||||
// BGM 재생
|
||||
// ─────────────────────────────────────────────────────────────────────────
|
||||
|
||||
/// BGM 재생 (단순화된 버전)
|
||||
/// BGM 재생 (동시 호출 보호)
|
||||
///
|
||||
/// 여러 곳에서 동시에 호출되어도 마지막 요청만 처리합니다.
|
||||
/// 작업 중 새 요청이 들어오면 대기열에 저장하고 완료 후 재생합니다.
|
||||
Future<void> playBgm(String name) async {
|
||||
if (_isPaused) return;
|
||||
if (!_staticInitialized) await init();
|
||||
if (_bgmVolume == 0) return; // 볼륨 0이면 재생 안함
|
||||
if (_currentBgm == name) return;
|
||||
if (_staticBgmPlayer == null) return;
|
||||
|
||||
await _playBgmInternal(name);
|
||||
// 작업 중이면 대기열에 저장 (마지막 요청만 유지)
|
||||
if (_isBgmBusy) {
|
||||
_queuedBgm = name;
|
||||
debugPrint('[AudioService] BGM $name queued');
|
||||
return;
|
||||
}
|
||||
|
||||
_isBgmBusy = true;
|
||||
try {
|
||||
await _playBgmInternal(name);
|
||||
} finally {
|
||||
_isBgmBusy = false;
|
||||
// 대기 중인 BGM이 있으면 재생
|
||||
if (_queuedBgm != null && _queuedBgm != _currentBgm) {
|
||||
final queued = _queuedBgm;
|
||||
_queuedBgm = null;
|
||||
await playBgm(queued!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 내부 BGM 재생 (뮤텍스 내에서 호출)
|
||||
@@ -236,15 +266,25 @@ class AudioService {
|
||||
_userInteracted = true;
|
||||
debugPrint('[AudioService] Playing BGM: $name');
|
||||
} on PlayerInterruptedException catch (e) {
|
||||
// 다른 BGM 요청으로 인한 중단 - 정상적인 상황
|
||||
debugPrint('[AudioService] BGM $name interrupted: ${e.message}');
|
||||
} catch (e) {
|
||||
final errorStr = e.toString();
|
||||
|
||||
// "Loading interrupted"는 새 BGM 요청으로 인한 정상 중단
|
||||
if (errorStr.contains('Loading interrupted') ||
|
||||
errorStr.contains('abort')) {
|
||||
debugPrint(
|
||||
'[AudioService] BGM $name loading interrupted (new request)',
|
||||
);
|
||||
return; // 플레이어 재생성 불필요
|
||||
}
|
||||
|
||||
debugPrint('[AudioService] BGM error: $errorStr');
|
||||
|
||||
// macOS Operation Stopped 에러: 플레이어 재생성 후 재시도
|
||||
if (errorStr.contains('Operation Stopped') ||
|
||||
errorStr.contains('-11849') ||
|
||||
errorStr.contains('abort')) {
|
||||
errorStr.contains('-11849')) {
|
||||
debugPrint('[AudioService] Recreating BGM player...');
|
||||
await _recreateBgmPlayer();
|
||||
|
||||
@@ -320,17 +360,27 @@ class AudioService {
|
||||
/// 전체 오디오 일시정지 (앱 백그라운드 시)
|
||||
Future<void> pauseAll() async {
|
||||
_isPaused = true;
|
||||
_pausedBgm = _currentBgm; // 복귀 시 재개를 위해 저장
|
||||
try {
|
||||
await _staticBgmPlayer?.stop();
|
||||
} catch (_) {}
|
||||
// SFX도 즉시 정지
|
||||
await _playerSfxPool?.stopAll();
|
||||
await _monsterSfxPool?.stopAll();
|
||||
_currentBgm = null;
|
||||
debugPrint('[AudioService] All audio paused');
|
||||
debugPrint('[AudioService] All audio paused (was playing: $_pausedBgm)');
|
||||
}
|
||||
|
||||
/// 전체 오디오 재개 (앱 포그라운드 복귀 시)
|
||||
Future<void> resumeAll() async {
|
||||
_isPaused = false;
|
||||
debugPrint('[AudioService] Audio resumed');
|
||||
// 일시정지 전 재생 중이던 BGM 재개
|
||||
if (_pausedBgm != null) {
|
||||
final bgmToResume = _pausedBgm!;
|
||||
_pausedBgm = null;
|
||||
await playBgm(bgmToResume);
|
||||
}
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────
|
||||
@@ -340,6 +390,7 @@ class AudioService {
|
||||
/// 플레이어 이펙트 SFX 재생
|
||||
Future<void> playPlayerSfx(String name) async {
|
||||
if (_isPaused) return;
|
||||
if (_sfxVolume == 0) return; // 볼륨 0이면 재생 안함
|
||||
if (!_staticInitialized) await init();
|
||||
_tryPlayPendingBgm();
|
||||
await _playerSfxPool?.play('assets/audio/sfx/$name.mp3');
|
||||
@@ -348,6 +399,7 @@ class AudioService {
|
||||
/// 몬스터 이펙트 SFX 재생
|
||||
Future<void> playMonsterSfx(String name) async {
|
||||
if (_isPaused) return;
|
||||
if (_sfxVolume == 0) return; // 볼륨 0이면 재생 안함
|
||||
if (!_staticInitialized) await init();
|
||||
_tryPlayPendingBgm();
|
||||
await _monsterSfxPool?.play('assets/audio/sfx/$name.mp3');
|
||||
@@ -376,7 +428,13 @@ class AudioService {
|
||||
_bgmVolume = volume.clamp(0.0, 1.0);
|
||||
if (_staticBgmPlayer != null) {
|
||||
try {
|
||||
await _staticBgmPlayer!.setVolume(_bgmVolume);
|
||||
// 볼륨 0이면 BGM 정지
|
||||
if (_bgmVolume == 0) {
|
||||
await _staticBgmPlayer!.stop();
|
||||
_currentBgm = null;
|
||||
} else {
|
||||
await _staticBgmPlayer!.setVolume(_bgmVolume);
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
await _settingsRepository.saveBgmVolume(_bgmVolume);
|
||||
|
||||
@@ -12,11 +12,8 @@ import 'package:just_audio/just_audio.dart';
|
||||
///
|
||||
/// 플레이어 인스턴스를 static으로 관리하여 핫 리로드에서도 안전합니다.
|
||||
class SfxChannelPool {
|
||||
SfxChannelPool({
|
||||
required this.name,
|
||||
this.poolSize = 4,
|
||||
double volume = 0.8,
|
||||
}) : _volume = volume;
|
||||
SfxChannelPool({required this.name, this.poolSize = 4, double volume = 0.8})
|
||||
: _volume = volume;
|
||||
|
||||
/// 채널명 (디버그용)
|
||||
final String name;
|
||||
@@ -76,7 +73,8 @@ class SfxChannelPool {
|
||||
// 기존 플레이어가 있으면 재사용 (핫 리로드 대응)
|
||||
if (_staticPlayers[name]!.isNotEmpty) {
|
||||
debugPrint(
|
||||
'[SfxChannelPool:$name] Reusing ${_staticPlayers[name]!.length} existing players');
|
||||
'[SfxChannelPool:$name] Reusing ${_staticPlayers[name]!.length} existing players',
|
||||
);
|
||||
_staticInitialized[name] = true;
|
||||
completer.complete();
|
||||
return;
|
||||
@@ -96,9 +94,12 @@ class SfxChannelPool {
|
||||
if (successCount > 0) {
|
||||
_staticInitialized[name] = true;
|
||||
debugPrint(
|
||||
'[SfxChannelPool:$name] Initialized with $successCount/$poolSize players');
|
||||
'[SfxChannelPool:$name] Initialized with $successCount/$poolSize players',
|
||||
);
|
||||
} else {
|
||||
debugPrint('[SfxChannelPool:$name] All players failed - audio disabled');
|
||||
debugPrint(
|
||||
'[SfxChannelPool:$name] All players failed - audio disabled',
|
||||
);
|
||||
}
|
||||
|
||||
completer.complete();
|
||||
@@ -140,7 +141,8 @@ class SfxChannelPool {
|
||||
return player;
|
||||
} catch (e) {
|
||||
debugPrint(
|
||||
'[SfxChannelPool:$name] Player $index attempt ${attempt + 1} failed: $e');
|
||||
'[SfxChannelPool:$name] Player $index attempt ${attempt + 1} failed: $e',
|
||||
);
|
||||
if (attempt == maxRetries - 1) {
|
||||
return null;
|
||||
}
|
||||
@@ -193,6 +195,22 @@ class SfxChannelPool {
|
||||
}
|
||||
}
|
||||
|
||||
/// 모든 SFX 즉시 정지 및 대기열 비우기
|
||||
Future<void> stopAll() async {
|
||||
_pendingQueue.clear();
|
||||
final players = _staticPlayers[name];
|
||||
final busy = _staticBusy[name];
|
||||
if (players == null) return;
|
||||
for (var i = 0; i < players.length; i++) {
|
||||
try {
|
||||
await players[i].stop();
|
||||
} catch (_) {}
|
||||
if (busy != null && i < busy.length) {
|
||||
busy[i] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 리소스 해제
|
||||
Future<void> dispose() async {
|
||||
final players = _staticPlayers[name];
|
||||
|
||||
31
lib/src/core/di/i_ad_service.dart
Normal file
31
lib/src/core/di/i_ad_service.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
import 'package:asciineverdie/src/core/infrastructure/ad_service.dart';
|
||||
|
||||
/// 광고 서비스 인터페이스 (interface)
|
||||
///
|
||||
/// 광고 표시 기능의 추상화 계층.
|
||||
/// 테스트 시 목(mock) 구현체로 교체 가능.
|
||||
abstract class IAdService {
|
||||
/// AdMob SDK 초기화
|
||||
Future<void> initialize();
|
||||
|
||||
/// 리워드 광고(rewarded ad) 준비 여부
|
||||
bool get isRewardedAdReady;
|
||||
|
||||
/// 인터스티셜 광고(interstitial ad) 준비 여부
|
||||
bool get isInterstitialAdReady;
|
||||
|
||||
/// 리워드 광고 표시
|
||||
Future<AdResult> showRewardedAd({
|
||||
required AdType adType,
|
||||
required void Function() onRewarded,
|
||||
});
|
||||
|
||||
/// 인터스티셜 광고 표시
|
||||
Future<AdResult> showInterstitialAd({
|
||||
required AdType adType,
|
||||
required void Function() onComplete,
|
||||
});
|
||||
|
||||
/// 리소스 해제
|
||||
void dispose();
|
||||
}
|
||||
34
lib/src/core/di/i_iap_service.dart
Normal file
34
lib/src/core/di/i_iap_service.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:asciineverdie/src/core/infrastructure/iap_service.dart';
|
||||
|
||||
/// IAP 서비스 인터페이스 (interface)
|
||||
///
|
||||
/// 인앱 구매 기능의 추상화 계층.
|
||||
/// 테스트 시 목(mock) 구현체로 교체 가능.
|
||||
abstract class IIAPService {
|
||||
/// IAP 서비스 초기화
|
||||
Future<void> initialize();
|
||||
|
||||
/// 광고 제거 구매 여부
|
||||
bool get isAdRemovalPurchased;
|
||||
|
||||
/// 스토어 가용성(store availability)
|
||||
bool get isStoreAvailable;
|
||||
|
||||
/// 광고 제거 상품 가격 문자열
|
||||
String get removeAdsPrice;
|
||||
|
||||
/// 광고 제거 구매
|
||||
Future<IAPResult> purchaseRemoveAds();
|
||||
|
||||
/// 구매 복원(restore purchases)
|
||||
Future<IAPResult> restorePurchases();
|
||||
|
||||
/// 디버그 모드 IAP 시뮬레이션(debug simulation) 활성화 여부
|
||||
bool get debugIAPSimulated;
|
||||
|
||||
/// 디버그 모드 IAP 시뮬레이션 토글
|
||||
set debugIAPSimulated(bool value);
|
||||
|
||||
/// 리소스 해제
|
||||
void dispose();
|
||||
}
|
||||
25
lib/src/core/di/service_locator.dart
Normal file
25
lib/src/core/di/service_locator.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
||||
import 'package:asciineverdie/src/core/di/i_ad_service.dart';
|
||||
import 'package:asciineverdie/src/core/di/i_iap_service.dart';
|
||||
import 'package:asciineverdie/src/core/infrastructure/ad_service.dart';
|
||||
import 'package:asciineverdie/src/core/infrastructure/iap_service.dart';
|
||||
import 'package:asciineverdie/src/core/logging/error_logger.dart';
|
||||
|
||||
/// 전역 서비스 로케이터(service locator) 인스턴스
|
||||
final GetIt sl = GetIt.instance;
|
||||
|
||||
/// 서비스 로케이터 초기화
|
||||
///
|
||||
/// 앱 시작 시 한 번 호출하여 모든 서비스를 등록합니다.
|
||||
/// 점진적 도입: IAPService, AdService만 먼저 등록.
|
||||
void setupServiceLocator() {
|
||||
// 에러 로거(error logger) — 이미 초기화된 싱글톤 등록
|
||||
sl.registerSingleton<ErrorLogger>(ErrorLogger.instance);
|
||||
|
||||
// IAP 서비스 (싱글톤 등록)
|
||||
sl.registerLazySingleton<IIAPService>(() => IAPService.createInstance());
|
||||
|
||||
// 광고 서비스 (싱글톤 등록)
|
||||
sl.registerLazySingleton<IAdService>(() => AdService.createInstance());
|
||||
}
|
||||
263
lib/src/core/engine/act_progression_service.dart
Normal file
263
lib/src/core/engine/act_progression_service.dart
Normal file
@@ -0,0 +1,263 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:asciineverdie/data/game_text_l10n.dart' as l10n;
|
||||
import 'package:asciineverdie/src/shared/animation/monster_size.dart';
|
||||
import 'package:asciineverdie/src/core/engine/combat_calculator.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_grade.dart';
|
||||
import 'package:asciineverdie/src/core/model/pq_config.dart';
|
||||
import 'package:asciineverdie/src/core/util/balance_constants.dart';
|
||||
import 'package:asciineverdie/src/core/util/pq_logic.dart' as pq_logic;
|
||||
|
||||
/// Act 진행 관련 로직을 처리하는 서비스
|
||||
///
|
||||
/// ProgressService에서 추출된 Act 완료, 보스 생성 등의 로직 담당.
|
||||
class ActProgressionService {
|
||||
const ActProgressionService({required this.config});
|
||||
|
||||
final PqConfig config;
|
||||
|
||||
/// Act 완료 처리
|
||||
///
|
||||
/// 플롯 진행, Act Boss 시네마틱 후 호출.
|
||||
/// Returns gameComplete=true if Final Boss was defeated (game ends).
|
||||
({GameState state, bool gameComplete}) completeAct(GameState state) {
|
||||
// Act V 완료 시 (plotStageCount == 6) → 최종 보스 전투 시작
|
||||
// plotStageCount: 1=Prologue, 2=Act I, 3=Act II, 4=Act III, 5=Act IV, 6=Act V
|
||||
if (state.progress.plotStageCount >= 6) {
|
||||
// 이미 최종 보스가 처치되었으면 게임 클리어
|
||||
if (state.progress.finalBossState == FinalBossState.defeated) {
|
||||
final updatedPlotHistory = [
|
||||
...state.progress.plotHistory.map(
|
||||
(e) => e.isComplete ? e : e.copyWith(isComplete: true),
|
||||
),
|
||||
const HistoryEntry(caption: '*** THE END ***', isComplete: true),
|
||||
];
|
||||
|
||||
final updatedProgress = state.progress.copyWith(
|
||||
plotHistory: updatedPlotHistory,
|
||||
);
|
||||
|
||||
return (
|
||||
state: state.copyWith(progress: updatedProgress),
|
||||
gameComplete: true,
|
||||
);
|
||||
}
|
||||
|
||||
// 최종 보스가 아직 등장하지 않았으면 보스 전투 시작
|
||||
if (state.progress.finalBossState == FinalBossState.notSpawned) {
|
||||
final updatedProgress = state.progress.copyWith(
|
||||
finalBossState: FinalBossState.fighting,
|
||||
);
|
||||
|
||||
// 게임은 아직 끝나지 않음 - 보스 전투 진행
|
||||
return (
|
||||
state: state.copyWith(progress: updatedProgress),
|
||||
gameComplete: false,
|
||||
);
|
||||
}
|
||||
|
||||
// 보스 전투 중이면 계속 진행 (게임 종료 안 함)
|
||||
return (state: state, gameComplete: false);
|
||||
}
|
||||
|
||||
final actResult = pq_logic.completeAct(state.progress.plotStageCount);
|
||||
var nextState = state;
|
||||
|
||||
// 보상 처리는 호출자(ProgressService)가 담당
|
||||
// 여기서는 플롯 상태만 업데이트
|
||||
|
||||
final plotStages = nextState.progress.plotStageCount + 1;
|
||||
|
||||
// 플롯 히스토리 업데이트: 이전 플롯 완료 표시, 새 플롯 추가
|
||||
final updatedPlotHistory = [
|
||||
...nextState.progress.plotHistory.map(
|
||||
(e) => e.isComplete ? e : e.copyWith(isComplete: true),
|
||||
),
|
||||
HistoryEntry(caption: actResult.actTitle, isComplete: false),
|
||||
];
|
||||
|
||||
var updatedProgress = nextState.progress.copyWith(
|
||||
plot: ProgressBarState(position: 0, max: actResult.plotBarMaxSeconds),
|
||||
plotStageCount: plotStages,
|
||||
plotHistory: updatedPlotHistory,
|
||||
);
|
||||
|
||||
nextState = nextState.copyWith(progress: updatedProgress);
|
||||
|
||||
// Act I 완료 후(Prologue -> Act I) 첫 퀘스트 시작 (원본 Main.pas 로직)
|
||||
// plotStages == 2는 Prologue(1) -> Act I(2) 전환을 의미
|
||||
if (plotStages == 2) {
|
||||
nextState = startFirstQuest(nextState);
|
||||
}
|
||||
|
||||
return (state: nextState, gameComplete: false);
|
||||
}
|
||||
|
||||
/// Act 완료 시 적용할 보상 목록 반환
|
||||
List<pq_logic.RewardKind> getActRewards(int plotStageCount) {
|
||||
final actResult = pq_logic.completeAct(plotStageCount);
|
||||
return actResult.rewards;
|
||||
}
|
||||
|
||||
/// 첫 퀘스트 시작 (Act I 시작 시)
|
||||
GameState startFirstQuest(GameState state) {
|
||||
final result = pq_logic.completeQuest(
|
||||
config,
|
||||
state.rng,
|
||||
state.traits.level,
|
||||
);
|
||||
|
||||
// 퀘스트 바 초기화
|
||||
final questBar = ProgressBarState(
|
||||
position: 0,
|
||||
max: 50 + state.rng.nextInt(100),
|
||||
);
|
||||
|
||||
// 첫 퀘스트 히스토리 추가
|
||||
final questHistory = [
|
||||
HistoryEntry(caption: result.caption, isComplete: false),
|
||||
];
|
||||
|
||||
// 퀘스트 몬스터 정보 저장 (Exterminate 타입용)
|
||||
final questMonster = result.monsterIndex != null
|
||||
? QuestMonsterInfo(
|
||||
monsterData: result.monsterName!,
|
||||
monsterIndex: result.monsterIndex!,
|
||||
)
|
||||
: null;
|
||||
|
||||
// 첫 퀘스트 추가
|
||||
final updatedQueue = QueueState(
|
||||
entries: [
|
||||
...state.queue.entries,
|
||||
QueueEntry(
|
||||
kind: QueueKind.task,
|
||||
durationMillis: 50 + state.rng.nextInt(100),
|
||||
caption: result.caption,
|
||||
taskType: TaskType.neutral,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
final progress = state.progress.copyWith(
|
||||
quest: questBar,
|
||||
questCount: 1,
|
||||
questHistory: questHistory,
|
||||
currentQuestMonster: questMonster,
|
||||
);
|
||||
|
||||
return state.copyWith(progress: progress, queue: updatedQueue);
|
||||
}
|
||||
|
||||
/// Act Boss 생성 (Act 완료 시)
|
||||
///
|
||||
/// 보스 레벨 = min(플레이어 레벨, Act 최소 레벨)로 설정하여
|
||||
/// 플레이어가 이길 수 있는 수준 보장
|
||||
CombatState createActBoss(GameState state) {
|
||||
final plotStage = state.progress.plotStageCount;
|
||||
final actNumber = plotStage + 1;
|
||||
|
||||
// 보스 레벨 = min(플레이어 레벨, Act 최소 레벨)
|
||||
// → 플레이어가 현재 레벨보다 높은 보스를 만나지 않도록 보장
|
||||
final actMinLevel = ActMonsterLevel.forPlotStage(actNumber);
|
||||
final bossLevel = math.min(state.traits.level, actMinLevel);
|
||||
|
||||
// Named monster 생성 (pq_logic.namedMonster 활용)
|
||||
final bossName = pq_logic.namedMonster(config, state.rng, bossLevel);
|
||||
|
||||
final bossStats = MonsterBaseStats.forLevel(bossLevel);
|
||||
|
||||
// 플레이어 전투 스탯 생성
|
||||
final playerCombatStats = CombatStats.fromStats(
|
||||
stats: state.stats,
|
||||
equipment: state.equipment,
|
||||
level: state.traits.level,
|
||||
monsterLevel: bossLevel,
|
||||
);
|
||||
|
||||
// Boss 몬스터 스탯 생성 (일반 몬스터 대비 강화)
|
||||
final monsterCombatStats = MonsterCombatStats(
|
||||
name: bossName,
|
||||
level: bossLevel,
|
||||
atk: (bossStats.atk * 1.5).round(), // Boss 보정 (1.5배)
|
||||
def: (bossStats.def * 1.5).round(),
|
||||
magDef: (bossStats.def * 1.8).round(), // 보스 마법 방어 (물리 대비 1.2배)
|
||||
hpMax: (bossStats.hp * 2.0).round(), // HP는 2.0배 (보스다운 전투 시간)
|
||||
hpCurrent: (bossStats.hp * 2.0).round(),
|
||||
criRate: 0.05,
|
||||
criDamage: 1.5,
|
||||
evasion: 0.0,
|
||||
accuracy: 0.8,
|
||||
attackDelayMs: 1000,
|
||||
expReward: (bossStats.exp * 2.5).round(), // 경험치 보상 증가
|
||||
);
|
||||
|
||||
// 전투 상태 초기화
|
||||
return CombatState.start(
|
||||
playerStats: playerCombatStats,
|
||||
monsterStats: monsterCombatStats,
|
||||
);
|
||||
}
|
||||
|
||||
/// 최종 보스(Glitch God) 전투 시작
|
||||
///
|
||||
/// Act V 플롯 완료 후 호출되며, 글리치 갓과의 전투를 설정합니다.
|
||||
({ProgressState progress, QueueState queue}) startFinalBossFight(
|
||||
GameState state,
|
||||
ProgressState progress,
|
||||
QueueState queue,
|
||||
) {
|
||||
final level = state.traits.level;
|
||||
|
||||
// Glitch God 생성 (레벨 100 최종 보스)
|
||||
final glitchGod = MonsterCombatStats.glitchGod();
|
||||
|
||||
// 플레이어 전투 스탯 생성 (Phase 12: 보스 레벨 기반 페널티 적용)
|
||||
final playerCombatStats = CombatStats.fromStats(
|
||||
stats: state.stats,
|
||||
equipment: state.equipment,
|
||||
level: level,
|
||||
monsterLevel: glitchGod.level,
|
||||
);
|
||||
|
||||
// 전투 상태 초기화
|
||||
final combatState = CombatState.start(
|
||||
playerStats: playerCombatStats,
|
||||
monsterStats: glitchGod,
|
||||
);
|
||||
|
||||
// 전투 시간 추정 (보스 전투는 더 길게)
|
||||
final combatCalculator = CombatCalculator(rng: state.rng);
|
||||
final baseDuration = combatCalculator.estimateCombatDurationMs(
|
||||
player: playerCombatStats,
|
||||
monster: glitchGod,
|
||||
);
|
||||
// 최종 보스는 최소 10초, 최대 60초
|
||||
final durationMillis = baseDuration.clamp(10000, 60000);
|
||||
|
||||
final taskResult = pq_logic.startTask(
|
||||
progress,
|
||||
l10n.taskFinalBoss(glitchGod.name),
|
||||
durationMillis,
|
||||
);
|
||||
|
||||
final updatedProgress = taskResult.progress.copyWith(
|
||||
currentTask: TaskInfo(
|
||||
caption: taskResult.caption,
|
||||
type: TaskType.kill,
|
||||
monsterBaseName: 'Glitch God',
|
||||
monsterPart: '*', // 특수 전리품
|
||||
monsterLevel: glitchGod.level,
|
||||
monsterGrade: MonsterGrade.boss, // 최종 보스는 항상 boss 등급
|
||||
monsterSize: MonsterSize.large, // 최종 보스는 항상 대형
|
||||
),
|
||||
currentCombat: combatState,
|
||||
);
|
||||
|
||||
return (progress: updatedProgress, queue: queue);
|
||||
}
|
||||
}
|
||||
497
lib/src/core/engine/arena_combat_simulator.dart
Normal file
497
lib/src/core/engine/arena_combat_simulator.dart
Normal file
@@ -0,0 +1,497 @@
|
||||
import 'package:asciineverdie/data/skill_data.dart';
|
||||
import 'package:asciineverdie/src/core/engine/combat_calculator.dart';
|
||||
import 'package:asciineverdie/src/core/engine/skill_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/arena_match.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/hall_of_fame.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/skill.dart';
|
||||
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||
|
||||
/// 아레나 전투 시뮬레이터
|
||||
///
|
||||
/// ArenaService에서 분리된 전투 시뮬레이션 로직.
|
||||
/// 스킬 시스템을 포함한 턴 기반 전투를 처리한다.
|
||||
class ArenaCombatSimulator {
|
||||
ArenaCombatSimulator({required DeterministicRandom rng})
|
||||
: _rng = rng,
|
||||
_skillService = SkillService(rng: rng);
|
||||
|
||||
final DeterministicRandom _rng;
|
||||
final SkillService _skillService;
|
||||
|
||||
/// 전투 시뮬레이션 (애니메이션용 스트림)
|
||||
Stream<ArenaCombatTurn> simulateCombat(ArenaMatch match) async* {
|
||||
final challengerStats = match.challenger.finalStats;
|
||||
final opponentStats = match.opponent.finalStats;
|
||||
|
||||
if (challengerStats == null || opponentStats == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final calculator = CombatCalculator(rng: _rng);
|
||||
|
||||
// 스킬 ID 목록 로드
|
||||
var challengerSkillIds = _getSkillIdsFromEntry(match.challenger);
|
||||
var opponentSkillIds = _getSkillIdsFromEntry(match.opponent);
|
||||
if (challengerSkillIds.isEmpty) {
|
||||
challengerSkillIds = SkillData.defaultSkillIds;
|
||||
}
|
||||
if (opponentSkillIds.isEmpty) {
|
||||
opponentSkillIds = SkillData.defaultSkillIds;
|
||||
}
|
||||
|
||||
// 스킬 시스템 상태 초기화
|
||||
var challengerSkillSystem = SkillSystemState.empty();
|
||||
var opponentSkillSystem = SkillSystemState.empty();
|
||||
|
||||
// DOT 및 디버프 추적
|
||||
var challengerDoTs = <DotEffect>[];
|
||||
var opponentDoTs = <DotEffect>[];
|
||||
var challengerDebuffs = <ActiveBuff>[];
|
||||
var opponentDebuffs = <ActiveBuff>[];
|
||||
|
||||
var playerCombatStats = challengerStats.copyWith(
|
||||
hpCurrent: challengerStats.hpMax,
|
||||
mpCurrent: challengerStats.mpMax,
|
||||
);
|
||||
|
||||
var opponentCombatStats = opponentStats.copyWith(
|
||||
hpCurrent: opponentStats.hpMax,
|
||||
mpCurrent: opponentStats.mpMax,
|
||||
);
|
||||
|
||||
int playerAccum = 0;
|
||||
int opponentAccum = 0;
|
||||
int elapsedMs = 0;
|
||||
const tickMs = 200;
|
||||
int turns = 0;
|
||||
|
||||
// 초기 상태 전송
|
||||
yield ArenaCombatTurn(
|
||||
challengerHp: playerCombatStats.hpCurrent,
|
||||
opponentHp: opponentCombatStats.hpCurrent,
|
||||
challengerHpMax: playerCombatStats.hpMax,
|
||||
opponentHpMax: opponentCombatStats.hpMax,
|
||||
challengerMp: playerCombatStats.mpCurrent,
|
||||
opponentMp: opponentCombatStats.mpCurrent,
|
||||
challengerMpMax: playerCombatStats.mpMax,
|
||||
opponentMpMax: opponentCombatStats.mpMax,
|
||||
);
|
||||
|
||||
while (playerCombatStats.isAlive && opponentCombatStats.hpCurrent > 0) {
|
||||
playerAccum += tickMs;
|
||||
opponentAccum += tickMs;
|
||||
elapsedMs += tickMs;
|
||||
|
||||
// 스킬 시스템 시간 업데이트
|
||||
challengerSkillSystem = challengerSkillSystem.copyWith(
|
||||
elapsedMs: elapsedMs,
|
||||
);
|
||||
opponentSkillSystem = opponentSkillSystem.copyWith(elapsedMs: elapsedMs);
|
||||
|
||||
int? challengerDamage;
|
||||
int? opponentDamage;
|
||||
bool isChallengerCritical = false;
|
||||
bool isOpponentCritical = false;
|
||||
bool isChallengerEvaded = false;
|
||||
bool isOpponentEvaded = false;
|
||||
bool isChallengerBlocked = false;
|
||||
bool isOpponentBlocked = false;
|
||||
String? challengerSkillUsed;
|
||||
String? opponentSkillUsed;
|
||||
int? challengerHealAmount;
|
||||
int? opponentHealAmount;
|
||||
|
||||
// DOT 틱 처리
|
||||
final dotResult = _processDotTicks(
|
||||
challengerDoTs: challengerDoTs,
|
||||
opponentDoTs: opponentDoTs,
|
||||
playerStats: playerCombatStats,
|
||||
opponentStats: opponentCombatStats,
|
||||
tickMs: tickMs,
|
||||
);
|
||||
challengerDoTs = dotResult.challengerDoTs;
|
||||
opponentDoTs = dotResult.opponentDoTs;
|
||||
playerCombatStats = dotResult.playerStats;
|
||||
opponentCombatStats = dotResult.opponentStats;
|
||||
|
||||
// 만료된 디버프 정리
|
||||
challengerDebuffs = challengerDebuffs
|
||||
.where((ActiveBuff d) => !d.isExpired(elapsedMs))
|
||||
.toList();
|
||||
opponentDebuffs = opponentDebuffs
|
||||
.where((ActiveBuff d) => !d.isExpired(elapsedMs))
|
||||
.toList();
|
||||
|
||||
// 도전자 턴
|
||||
if (playerAccum >= playerCombatStats.attackDelayMs) {
|
||||
playerAccum = 0;
|
||||
|
||||
var opponentMonsterStats = MonsterCombatStats.fromCombatStats(
|
||||
opponentCombatStats,
|
||||
match.opponent.characterName,
|
||||
);
|
||||
|
||||
final turnResult = _processCharacterTurn(
|
||||
player: playerCombatStats,
|
||||
target: opponentCombatStats,
|
||||
targetMonster: opponentMonsterStats,
|
||||
targetName: match.opponent.characterName,
|
||||
entry: match.challenger,
|
||||
skillIds: challengerSkillIds,
|
||||
skillSystem: challengerSkillSystem,
|
||||
activeDoTs: challengerDoTs,
|
||||
activeDebuffs: opponentDebuffs,
|
||||
calculator: calculator,
|
||||
elapsedMs: elapsedMs,
|
||||
);
|
||||
|
||||
playerCombatStats = turnResult.player;
|
||||
opponentCombatStats = turnResult.target;
|
||||
challengerSkillSystem = turnResult.skillSystem;
|
||||
challengerDoTs = turnResult.activeDoTs;
|
||||
opponentDebuffs = turnResult.targetDebuffs;
|
||||
challengerDamage = turnResult.damage;
|
||||
isChallengerCritical = turnResult.isCritical;
|
||||
isOpponentEvaded = turnResult.isTargetEvaded;
|
||||
challengerSkillUsed = turnResult.skillUsed;
|
||||
challengerHealAmount = turnResult.healAmount;
|
||||
}
|
||||
|
||||
// 상대 턴
|
||||
if (opponentCombatStats.hpCurrent > 0 &&
|
||||
opponentAccum >= opponentCombatStats.attackDelayMs) {
|
||||
opponentAccum = 0;
|
||||
|
||||
var challengerMonsterStats = MonsterCombatStats.fromCombatStats(
|
||||
playerCombatStats,
|
||||
match.challenger.characterName,
|
||||
);
|
||||
|
||||
final turnResult = _processCharacterTurn(
|
||||
player: opponentCombatStats,
|
||||
target: playerCombatStats,
|
||||
targetMonster: challengerMonsterStats,
|
||||
targetName: match.challenger.characterName,
|
||||
entry: match.opponent,
|
||||
skillIds: opponentSkillIds,
|
||||
skillSystem: opponentSkillSystem,
|
||||
activeDoTs: opponentDoTs,
|
||||
activeDebuffs: challengerDebuffs,
|
||||
calculator: calculator,
|
||||
elapsedMs: elapsedMs,
|
||||
);
|
||||
|
||||
opponentCombatStats = turnResult.player;
|
||||
playerCombatStats = turnResult.target;
|
||||
opponentSkillSystem = turnResult.skillSystem;
|
||||
opponentDoTs = turnResult.activeDoTs;
|
||||
challengerDebuffs = turnResult.targetDebuffs;
|
||||
opponentDamage = turnResult.damage;
|
||||
isOpponentCritical = turnResult.isCritical;
|
||||
isChallengerEvaded = turnResult.isTargetEvaded;
|
||||
isChallengerBlocked = turnResult.isTargetBlocked;
|
||||
opponentSkillUsed = turnResult.skillUsed;
|
||||
opponentHealAmount = turnResult.healAmount;
|
||||
}
|
||||
|
||||
// 액션이 발생했을 때만 턴 전송
|
||||
final hasAction =
|
||||
challengerDamage != null ||
|
||||
opponentDamage != null ||
|
||||
challengerHealAmount != null ||
|
||||
opponentHealAmount != null ||
|
||||
challengerSkillUsed != null ||
|
||||
opponentSkillUsed != null;
|
||||
|
||||
if (hasAction) {
|
||||
turns++;
|
||||
yield ArenaCombatTurn(
|
||||
challengerDamage: challengerDamage,
|
||||
opponentDamage: opponentDamage,
|
||||
challengerHp: playerCombatStats.hpCurrent,
|
||||
opponentHp: opponentCombatStats.hpCurrent,
|
||||
challengerHpMax: playerCombatStats.hpMax,
|
||||
opponentHpMax: opponentCombatStats.hpMax,
|
||||
challengerMp: playerCombatStats.mpCurrent,
|
||||
opponentMp: opponentCombatStats.mpCurrent,
|
||||
challengerMpMax: playerCombatStats.mpMax,
|
||||
opponentMpMax: opponentCombatStats.mpMax,
|
||||
isChallengerCritical: isChallengerCritical,
|
||||
isOpponentCritical: isOpponentCritical,
|
||||
isChallengerEvaded: isChallengerEvaded,
|
||||
isOpponentEvaded: isOpponentEvaded,
|
||||
isChallengerBlocked: isChallengerBlocked,
|
||||
isOpponentBlocked: isOpponentBlocked,
|
||||
challengerSkillUsed: challengerSkillUsed,
|
||||
opponentSkillUsed: opponentSkillUsed,
|
||||
challengerHealAmount: challengerHealAmount,
|
||||
opponentHealAmount: opponentHealAmount,
|
||||
);
|
||||
|
||||
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
}
|
||||
|
||||
if (turns > 1000) break;
|
||||
}
|
||||
}
|
||||
|
||||
/// DOT 틱 처리 (양측)
|
||||
({
|
||||
List<DotEffect> challengerDoTs,
|
||||
List<DotEffect> opponentDoTs,
|
||||
CombatStats playerStats,
|
||||
CombatStats opponentStats,
|
||||
})
|
||||
_processDotTicks({
|
||||
required List<DotEffect> challengerDoTs,
|
||||
required List<DotEffect> opponentDoTs,
|
||||
required CombatStats playerStats,
|
||||
required CombatStats opponentStats,
|
||||
required int tickMs,
|
||||
}) {
|
||||
var updatedPlayerStats = playerStats;
|
||||
var updatedOpponentStats = opponentStats;
|
||||
|
||||
// 도전자 -> 상대에게 적용된 DOT
|
||||
var dotDamageToOpponent = 0;
|
||||
final updatedChallengerDoTs = <DotEffect>[];
|
||||
for (final dot in challengerDoTs) {
|
||||
final (updatedDot, ticksTriggered) = dot.tick(tickMs);
|
||||
if (ticksTriggered > 0) {
|
||||
dotDamageToOpponent += dot.damagePerTick * ticksTriggered;
|
||||
}
|
||||
if (updatedDot.isActive) updatedChallengerDoTs.add(updatedDot);
|
||||
}
|
||||
if (dotDamageToOpponent > 0 && updatedOpponentStats.hpCurrent > 0) {
|
||||
updatedOpponentStats = updatedOpponentStats.copyWith(
|
||||
hpCurrent: (updatedOpponentStats.hpCurrent - dotDamageToOpponent).clamp(
|
||||
0,
|
||||
updatedOpponentStats.hpMax,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 상대 -> 도전자에게 적용된 DOT
|
||||
var dotDamageToChallenger = 0;
|
||||
final updatedOpponentDoTs = <DotEffect>[];
|
||||
for (final dot in opponentDoTs) {
|
||||
final (updatedDot, ticksTriggered) = dot.tick(tickMs);
|
||||
if (ticksTriggered > 0) {
|
||||
dotDamageToChallenger += dot.damagePerTick * ticksTriggered;
|
||||
}
|
||||
if (updatedDot.isActive) updatedOpponentDoTs.add(updatedDot);
|
||||
}
|
||||
if (dotDamageToChallenger > 0 && updatedPlayerStats.isAlive) {
|
||||
updatedPlayerStats = updatedPlayerStats.copyWith(
|
||||
hpCurrent: (updatedPlayerStats.hpCurrent - dotDamageToChallenger).clamp(
|
||||
0,
|
||||
updatedPlayerStats.hpMax,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
challengerDoTs: updatedChallengerDoTs,
|
||||
opponentDoTs: updatedOpponentDoTs,
|
||||
playerStats: updatedPlayerStats,
|
||||
opponentStats: updatedOpponentStats,
|
||||
);
|
||||
}
|
||||
|
||||
/// 캐릭터 턴 처리 (도전자/상대 공통)
|
||||
({
|
||||
CombatStats player,
|
||||
CombatStats target,
|
||||
SkillSystemState skillSystem,
|
||||
List<DotEffect> activeDoTs,
|
||||
List<ActiveBuff> targetDebuffs,
|
||||
int? damage,
|
||||
bool isCritical,
|
||||
bool isTargetEvaded,
|
||||
bool isTargetBlocked,
|
||||
String? skillUsed,
|
||||
int? healAmount,
|
||||
})
|
||||
_processCharacterTurn({
|
||||
required CombatStats player,
|
||||
required CombatStats target,
|
||||
required MonsterCombatStats targetMonster,
|
||||
required String targetName,
|
||||
required HallOfFameEntry entry,
|
||||
required List<String> skillIds,
|
||||
required SkillSystemState skillSystem,
|
||||
required List<DotEffect> activeDoTs,
|
||||
required List<ActiveBuff> activeDebuffs,
|
||||
required CombatCalculator calculator,
|
||||
required int elapsedMs,
|
||||
}) {
|
||||
int? damage;
|
||||
bool isCritical = false;
|
||||
bool isTargetEvaded = false;
|
||||
bool isTargetBlocked = false;
|
||||
String? skillUsed;
|
||||
int? healAmount;
|
||||
var updatedPlayer = player;
|
||||
var updatedTarget = target;
|
||||
var updatedSkillSystem = skillSystem;
|
||||
var updatedDoTs = [...activeDoTs];
|
||||
var updatedDebuffs = [...activeDebuffs];
|
||||
|
||||
final selectedSkill = _skillService.selectAutoSkill(
|
||||
player: updatedPlayer,
|
||||
monster: targetMonster,
|
||||
skillSystem: updatedSkillSystem,
|
||||
availableSkillIds: skillIds,
|
||||
activeDoTs: updatedDoTs,
|
||||
activeDebuffs: updatedDebuffs,
|
||||
);
|
||||
|
||||
if (selectedSkill != null && selectedSkill.isAttack) {
|
||||
final skillRank = _getSkillRankFromEntry(entry, selectedSkill.id);
|
||||
final skillResult = _skillService.useAttackSkillWithRank(
|
||||
skill: selectedSkill,
|
||||
player: updatedPlayer,
|
||||
monster: targetMonster,
|
||||
skillSystem: updatedSkillSystem,
|
||||
rank: skillRank,
|
||||
);
|
||||
updatedPlayer = skillResult.updatedPlayer;
|
||||
updatedTarget = updatedTarget.copyWith(
|
||||
hpCurrent: skillResult.updatedMonster.hpCurrent,
|
||||
);
|
||||
updatedSkillSystem = skillResult.updatedSkillSystem;
|
||||
skillUsed = selectedSkill.name;
|
||||
damage = skillResult.result.damage;
|
||||
} else if (selectedSkill != null && selectedSkill.isDot) {
|
||||
final skillResult = _skillService.useDotSkill(
|
||||
skill: selectedSkill,
|
||||
player: updatedPlayer,
|
||||
skillSystem: updatedSkillSystem,
|
||||
playerInt: updatedPlayer.intelligence,
|
||||
playerWis: updatedPlayer.wis,
|
||||
);
|
||||
updatedPlayer = skillResult.updatedPlayer;
|
||||
updatedSkillSystem = skillResult.updatedSkillSystem;
|
||||
if (skillResult.dotEffect != null) {
|
||||
updatedDoTs.add(skillResult.dotEffect!);
|
||||
}
|
||||
skillUsed = selectedSkill.name;
|
||||
} else if (selectedSkill != null && selectedSkill.isHeal) {
|
||||
final skillResult = _skillService.useHealSkill(
|
||||
skill: selectedSkill,
|
||||
player: updatedPlayer,
|
||||
skillSystem: updatedSkillSystem,
|
||||
);
|
||||
updatedPlayer = skillResult.updatedPlayer;
|
||||
updatedSkillSystem = skillResult.updatedSkillSystem;
|
||||
skillUsed = selectedSkill.name;
|
||||
healAmount = skillResult.result.healedAmount;
|
||||
} else if (selectedSkill != null && selectedSkill.isBuff) {
|
||||
final skillResult = _skillService.useBuffSkill(
|
||||
skill: selectedSkill,
|
||||
player: updatedPlayer,
|
||||
skillSystem: updatedSkillSystem,
|
||||
);
|
||||
updatedPlayer = skillResult.updatedPlayer;
|
||||
updatedSkillSystem = skillResult.updatedSkillSystem;
|
||||
skillUsed = selectedSkill.name;
|
||||
} else if (selectedSkill != null && selectedSkill.isDebuff) {
|
||||
final skillResult = _skillService.useDebuffSkill(
|
||||
skill: selectedSkill,
|
||||
player: updatedPlayer,
|
||||
skillSystem: updatedSkillSystem,
|
||||
currentDebuffs: updatedDebuffs,
|
||||
);
|
||||
updatedPlayer = skillResult.updatedPlayer;
|
||||
updatedSkillSystem = skillResult.updatedSkillSystem;
|
||||
final debuffEffect = skillResult.debuffEffect;
|
||||
if (debuffEffect != null) {
|
||||
updatedDebuffs =
|
||||
updatedDebuffs
|
||||
.where((ActiveBuff d) => d.effect.id != debuffEffect.effect.id)
|
||||
.toList()
|
||||
..add(debuffEffect);
|
||||
}
|
||||
skillUsed = selectedSkill.name;
|
||||
} else {
|
||||
// 일반 공격
|
||||
final opponentMonsterStats = MonsterCombatStats.fromCombatStats(
|
||||
updatedTarget,
|
||||
targetName,
|
||||
);
|
||||
final result = calculator.playerAttackMonster(
|
||||
attacker: updatedPlayer,
|
||||
defender: opponentMonsterStats,
|
||||
);
|
||||
updatedTarget = updatedTarget.copyWith(
|
||||
hpCurrent: result.updatedDefender.hpCurrent,
|
||||
);
|
||||
|
||||
if (result.result.isHit) {
|
||||
damage = result.result.damage;
|
||||
isCritical = result.result.isCritical;
|
||||
} else {
|
||||
isTargetEvaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
player: updatedPlayer,
|
||||
target: updatedTarget,
|
||||
skillSystem: updatedSkillSystem,
|
||||
activeDoTs: updatedDoTs,
|
||||
targetDebuffs: updatedDebuffs,
|
||||
damage: damage,
|
||||
isCritical: isCritical,
|
||||
isTargetEvaded: isTargetEvaded,
|
||||
isTargetBlocked: isTargetBlocked,
|
||||
skillUsed: skillUsed,
|
||||
healAmount: healAmount,
|
||||
);
|
||||
}
|
||||
|
||||
/// 스킬 ID 목록 추출 (HallOfFameEntry에서)
|
||||
List<String> _getSkillIdsFromEntry(HallOfFameEntry entry) {
|
||||
final skillData = entry.finalSkills;
|
||||
if (skillData == null || skillData.isEmpty) return [];
|
||||
|
||||
final skillIds = <String>[];
|
||||
for (final data in skillData) {
|
||||
final skillName = data['name'];
|
||||
if (skillName != null) {
|
||||
final skill = SkillData.getSkillBySpellName(skillName);
|
||||
if (skill != null) {
|
||||
skillIds.add(skill.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
return skillIds;
|
||||
}
|
||||
|
||||
/// 스킬 랭크 조회 (HallOfFameEntry의 finalSkills에서)
|
||||
int _getSkillRankFromEntry(HallOfFameEntry entry, String skillId) {
|
||||
final skill = SkillData.getSkillById(skillId);
|
||||
if (skill == null) return 1;
|
||||
|
||||
final skillData = entry.finalSkills;
|
||||
if (skillData == null || skillData.isEmpty) return 1;
|
||||
|
||||
for (final data in skillData) {
|
||||
if (data['name'] == skill.name) {
|
||||
final rankStr = data['rank'] ?? 'I';
|
||||
return switch (rankStr) {
|
||||
'I' => 1,
|
||||
'II' => 2,
|
||||
'III' => 3,
|
||||
'IV' => 4,
|
||||
'V' => 5,
|
||||
_ => 1,
|
||||
};
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,11 @@
|
||||
import 'package:asciineverdie/data/skill_data.dart';
|
||||
import 'package:asciineverdie/src/core/engine/arena_combat_simulator.dart';
|
||||
import 'package:asciineverdie/src/core/engine/combat_calculator.dart';
|
||||
import 'package:asciineverdie/src/core/engine/item_service.dart';
|
||||
import 'package:asciineverdie/src/core/engine/skill_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/arena_match.dart';
|
||||
import 'package:asciineverdie/src/core/model/equipment_item.dart';
|
||||
import 'package:asciineverdie/src/core/model/equipment_slot.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/hall_of_fame.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/skill.dart';
|
||||
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||
|
||||
/// 아레나 서비스
|
||||
@@ -19,68 +16,10 @@ import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||
/// - 장비 교환
|
||||
class ArenaService {
|
||||
ArenaService({DeterministicRandom? rng})
|
||||
: _rng = rng ?? DeterministicRandom(DateTime.now().millisecondsSinceEpoch);
|
||||
: _rng = rng ?? DeterministicRandom(DateTime.now().millisecondsSinceEpoch);
|
||||
|
||||
final DeterministicRandom _rng;
|
||||
|
||||
late final SkillService _skillService = SkillService(rng: _rng);
|
||||
|
||||
// ============================================================================
|
||||
// 스킬 시스템 헬퍼
|
||||
// ============================================================================
|
||||
|
||||
/// HallOfFameEntry의 finalSkills에서 Skill 목록 추출
|
||||
List<Skill> _getSkillsFromEntry(HallOfFameEntry entry) {
|
||||
final skillData = entry.finalSkills;
|
||||
if (skillData == null || skillData.isEmpty) return [];
|
||||
|
||||
final skills = <Skill>[];
|
||||
for (final data in skillData) {
|
||||
final skillName = data['name'];
|
||||
if (skillName != null) {
|
||||
final skill = SkillData.getSkillBySpellName(skillName);
|
||||
if (skill != null) {
|
||||
skills.add(skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
return skills;
|
||||
}
|
||||
|
||||
/// 스킬 ID 목록 추출 (HallOfFameEntry에서)
|
||||
List<String> _getSkillIdsFromEntry(HallOfFameEntry entry) {
|
||||
return _getSkillsFromEntry(entry).map((s) => s.id).toList();
|
||||
}
|
||||
|
||||
/// 스킬 랭크 조회 (HallOfFameEntry의 finalSkills에서)
|
||||
int _getSkillRankFromEntry(HallOfFameEntry entry, String skillId) {
|
||||
final skill = SkillData.getSkillById(skillId);
|
||||
if (skill == null) return 1;
|
||||
|
||||
final skillData = entry.finalSkills;
|
||||
if (skillData == null || skillData.isEmpty) return 1;
|
||||
|
||||
for (final data in skillData) {
|
||||
if (data['name'] == skill.name) {
|
||||
final rankStr = data['rank'] ?? 'I';
|
||||
return _romanToInt(rankStr);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/// 로마 숫자 → 정수 변환
|
||||
int _romanToInt(String roman) {
|
||||
return switch (roman) {
|
||||
'I' => 1,
|
||||
'II' => 2,
|
||||
'III' => 3,
|
||||
'IV' => 4,
|
||||
'V' => 5,
|
||||
_ => 1,
|
||||
};
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 상대 결정
|
||||
// ============================================================================
|
||||
@@ -230,443 +169,10 @@ class ArenaService {
|
||||
|
||||
/// 전투 시뮬레이션 (애니메이션용 스트림)
|
||||
///
|
||||
/// progress_service._processCombatTickWithSkills()와 동일한 로직 사용
|
||||
/// [match] 대전 정보
|
||||
/// Returns: 턴별 전투 상황 스트림
|
||||
Stream<ArenaCombatTurn> simulateCombat(ArenaMatch match) async* {
|
||||
final calculator = CombatCalculator(rng: _rng);
|
||||
|
||||
final challengerStats = match.challenger.finalStats;
|
||||
final opponentStats = match.opponent.finalStats;
|
||||
|
||||
if (challengerStats == null || opponentStats == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 스킬 ID 목록 로드 (SkillBook과 동일한 방식)
|
||||
var challengerSkillIds = _getSkillIdsFromEntry(match.challenger);
|
||||
var opponentSkillIds = _getSkillIdsFromEntry(match.opponent);
|
||||
|
||||
// 스킬이 없으면 기본 스킬 사용
|
||||
if (challengerSkillIds.isEmpty) {
|
||||
challengerSkillIds = SkillData.defaultSkillIds;
|
||||
}
|
||||
if (opponentSkillIds.isEmpty) {
|
||||
opponentSkillIds = SkillData.defaultSkillIds;
|
||||
}
|
||||
|
||||
// 스킬 시스템 상태 초기화
|
||||
var challengerSkillSystem = SkillSystemState.empty();
|
||||
var opponentSkillSystem = SkillSystemState.empty();
|
||||
|
||||
// DOT 및 디버프 추적 (일반 전투와 동일)
|
||||
var challengerDoTs = <DotEffect>[];
|
||||
var opponentDoTs = <DotEffect>[];
|
||||
var challengerDebuffs = <ActiveBuff>[];
|
||||
var opponentDebuffs = <ActiveBuff>[];
|
||||
|
||||
var playerCombatStats = challengerStats.copyWith(
|
||||
hpCurrent: challengerStats.hpMax,
|
||||
mpCurrent: challengerStats.mpMax,
|
||||
);
|
||||
|
||||
var opponentCombatStats = opponentStats.copyWith(
|
||||
hpCurrent: opponentStats.hpMax,
|
||||
mpCurrent: opponentStats.mpMax,
|
||||
);
|
||||
|
||||
var opponentMonsterStats = MonsterCombatStats.fromCombatStats(
|
||||
opponentCombatStats,
|
||||
match.opponent.characterName,
|
||||
);
|
||||
|
||||
var challengerMonsterStats = MonsterCombatStats.fromCombatStats(
|
||||
playerCombatStats,
|
||||
match.challenger.characterName,
|
||||
);
|
||||
|
||||
int playerAccum = 0;
|
||||
int opponentAccum = 0;
|
||||
int elapsedMs = 0;
|
||||
const tickMs = 200;
|
||||
int turns = 0;
|
||||
|
||||
// 초기 상태 전송
|
||||
yield ArenaCombatTurn(
|
||||
challengerHp: playerCombatStats.hpCurrent,
|
||||
opponentHp: opponentCombatStats.hpCurrent,
|
||||
challengerHpMax: playerCombatStats.hpMax,
|
||||
opponentHpMax: opponentCombatStats.hpMax,
|
||||
challengerMp: playerCombatStats.mpCurrent,
|
||||
opponentMp: opponentCombatStats.mpCurrent,
|
||||
challengerMpMax: playerCombatStats.mpMax,
|
||||
opponentMpMax: opponentCombatStats.mpMax,
|
||||
);
|
||||
|
||||
while (playerCombatStats.isAlive && opponentCombatStats.hpCurrent > 0) {
|
||||
playerAccum += tickMs;
|
||||
opponentAccum += tickMs;
|
||||
elapsedMs += tickMs;
|
||||
|
||||
// 스킬 시스템 시간 업데이트
|
||||
challengerSkillSystem = challengerSkillSystem.copyWith(elapsedMs: elapsedMs);
|
||||
opponentSkillSystem = opponentSkillSystem.copyWith(elapsedMs: elapsedMs);
|
||||
|
||||
int? challengerDamage;
|
||||
int? opponentDamage;
|
||||
bool isChallengerCritical = false;
|
||||
bool isOpponentCritical = false;
|
||||
bool isChallengerEvaded = false;
|
||||
bool isOpponentEvaded = false;
|
||||
bool isChallengerBlocked = false;
|
||||
bool isOpponentBlocked = false;
|
||||
String? challengerSkillUsed;
|
||||
String? opponentSkillUsed;
|
||||
int? challengerHealAmount;
|
||||
int? opponentHealAmount;
|
||||
|
||||
// =========================================================================
|
||||
// DOT 틱 처리 (도전자 → 상대에게 적용된 DOT)
|
||||
// =========================================================================
|
||||
var dotDamageToOpponent = 0;
|
||||
final updatedChallengerDoTs = <DotEffect>[];
|
||||
for (final dot in challengerDoTs) {
|
||||
final (updatedDot, ticksTriggered) = dot.tick(tickMs);
|
||||
if (ticksTriggered > 0) {
|
||||
dotDamageToOpponent += dot.damagePerTick * ticksTriggered;
|
||||
}
|
||||
if (updatedDot.isActive) {
|
||||
updatedChallengerDoTs.add(updatedDot);
|
||||
}
|
||||
}
|
||||
challengerDoTs = updatedChallengerDoTs;
|
||||
|
||||
if (dotDamageToOpponent > 0 && opponentCombatStats.hpCurrent > 0) {
|
||||
opponentCombatStats = opponentCombatStats.copyWith(
|
||||
hpCurrent: (opponentCombatStats.hpCurrent - dotDamageToOpponent)
|
||||
.clamp(0, opponentCombatStats.hpMax),
|
||||
);
|
||||
}
|
||||
|
||||
// DOT 틱 처리 (상대 → 도전자에게 적용된 DOT)
|
||||
var dotDamageToChallenger = 0;
|
||||
final updatedOpponentDoTs = <DotEffect>[];
|
||||
for (final dot in opponentDoTs) {
|
||||
final (updatedDot, ticksTriggered) = dot.tick(tickMs);
|
||||
if (ticksTriggered > 0) {
|
||||
dotDamageToChallenger += dot.damagePerTick * ticksTriggered;
|
||||
}
|
||||
if (updatedDot.isActive) {
|
||||
updatedOpponentDoTs.add(updatedDot);
|
||||
}
|
||||
}
|
||||
opponentDoTs = updatedOpponentDoTs;
|
||||
|
||||
if (dotDamageToChallenger > 0 && playerCombatStats.isAlive) {
|
||||
playerCombatStats = playerCombatStats.copyWith(
|
||||
hpCurrent: (playerCombatStats.hpCurrent - dotDamageToChallenger)
|
||||
.clamp(0, playerCombatStats.hpMax),
|
||||
);
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 만료된 디버프 정리
|
||||
// =========================================================================
|
||||
challengerDebuffs = challengerDebuffs
|
||||
.where((ActiveBuff d) => !d.isExpired(elapsedMs))
|
||||
.toList();
|
||||
opponentDebuffs = opponentDebuffs
|
||||
.where((ActiveBuff d) => !d.isExpired(elapsedMs))
|
||||
.toList();
|
||||
|
||||
// =========================================================================
|
||||
// 도전자 턴 (selectAutoSkill 사용 - 일반 전투와 동일)
|
||||
// =========================================================================
|
||||
if (playerAccum >= playerCombatStats.attackDelayMs) {
|
||||
playerAccum = 0;
|
||||
|
||||
// 상대 몬스터 스탯 동기화
|
||||
opponentMonsterStats = MonsterCombatStats.fromCombatStats(
|
||||
opponentCombatStats,
|
||||
match.opponent.characterName,
|
||||
);
|
||||
|
||||
// 스킬 자동 선택 (progress_service와 동일한 로직)
|
||||
final selectedSkill = _skillService.selectAutoSkill(
|
||||
player: playerCombatStats,
|
||||
monster: opponentMonsterStats,
|
||||
skillSystem: challengerSkillSystem,
|
||||
availableSkillIds: challengerSkillIds,
|
||||
activeDoTs: challengerDoTs,
|
||||
activeDebuffs: opponentDebuffs,
|
||||
);
|
||||
|
||||
if (selectedSkill != null && selectedSkill.isAttack) {
|
||||
// 스킬 랭크 조회 및 적용
|
||||
final skillRank = _getSkillRankFromEntry(
|
||||
match.challenger,
|
||||
selectedSkill.id,
|
||||
);
|
||||
final skillResult = _skillService.useAttackSkillWithRank(
|
||||
skill: selectedSkill,
|
||||
player: playerCombatStats,
|
||||
monster: opponentMonsterStats,
|
||||
skillSystem: challengerSkillSystem,
|
||||
rank: skillRank,
|
||||
);
|
||||
playerCombatStats = skillResult.updatedPlayer;
|
||||
opponentCombatStats = opponentCombatStats.copyWith(
|
||||
hpCurrent: skillResult.updatedMonster.hpCurrent,
|
||||
);
|
||||
challengerSkillSystem = skillResult.updatedSkillSystem;
|
||||
challengerSkillUsed = selectedSkill.name;
|
||||
challengerDamage = skillResult.result.damage;
|
||||
} else if (selectedSkill != null && selectedSkill.isDot) {
|
||||
// DOT 스킬 사용
|
||||
final skillResult = _skillService.useDotSkill(
|
||||
skill: selectedSkill,
|
||||
player: playerCombatStats,
|
||||
skillSystem: challengerSkillSystem,
|
||||
playerInt: playerCombatStats.atk ~/ 10,
|
||||
playerWis: playerCombatStats.def ~/ 10,
|
||||
);
|
||||
playerCombatStats = skillResult.updatedPlayer;
|
||||
challengerSkillSystem = skillResult.updatedSkillSystem;
|
||||
if (skillResult.dotEffect != null) {
|
||||
challengerDoTs.add(skillResult.dotEffect!);
|
||||
}
|
||||
challengerSkillUsed = selectedSkill.name;
|
||||
} else if (selectedSkill != null && selectedSkill.isHeal) {
|
||||
// 회복 스킬 사용
|
||||
final skillResult = _skillService.useHealSkill(
|
||||
skill: selectedSkill,
|
||||
player: playerCombatStats,
|
||||
skillSystem: challengerSkillSystem,
|
||||
);
|
||||
playerCombatStats = skillResult.updatedPlayer;
|
||||
challengerSkillSystem = skillResult.updatedSkillSystem;
|
||||
challengerSkillUsed = selectedSkill.name;
|
||||
challengerHealAmount = skillResult.result.healedAmount;
|
||||
} else if (selectedSkill != null && selectedSkill.isBuff) {
|
||||
// 버프 스킬 사용
|
||||
final skillResult = _skillService.useBuffSkill(
|
||||
skill: selectedSkill,
|
||||
player: playerCombatStats,
|
||||
skillSystem: challengerSkillSystem,
|
||||
);
|
||||
playerCombatStats = skillResult.updatedPlayer;
|
||||
challengerSkillSystem = skillResult.updatedSkillSystem;
|
||||
challengerSkillUsed = selectedSkill.name;
|
||||
} else if (selectedSkill != null && selectedSkill.isDebuff) {
|
||||
// 디버프 스킬 사용
|
||||
final skillResult = _skillService.useDebuffSkill(
|
||||
skill: selectedSkill,
|
||||
player: playerCombatStats,
|
||||
skillSystem: challengerSkillSystem,
|
||||
currentDebuffs: opponentDebuffs,
|
||||
);
|
||||
playerCombatStats = skillResult.updatedPlayer;
|
||||
challengerSkillSystem = skillResult.updatedSkillSystem;
|
||||
final debuffEffect = skillResult.debuffEffect;
|
||||
if (debuffEffect != null) {
|
||||
opponentDebuffs = opponentDebuffs
|
||||
.where((ActiveBuff d) => d.effect.id != debuffEffect.effect.id)
|
||||
.toList()
|
||||
..add(debuffEffect);
|
||||
}
|
||||
challengerSkillUsed = selectedSkill.name;
|
||||
} else {
|
||||
// 일반 공격
|
||||
final result = calculator.playerAttackMonster(
|
||||
attacker: playerCombatStats,
|
||||
defender: opponentMonsterStats,
|
||||
);
|
||||
opponentCombatStats = opponentCombatStats.copyWith(
|
||||
hpCurrent: result.updatedDefender.hpCurrent,
|
||||
);
|
||||
|
||||
if (result.result.isHit) {
|
||||
challengerDamage = result.result.damage;
|
||||
isChallengerCritical = result.result.isCritical;
|
||||
} else {
|
||||
isOpponentEvaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 상대 턴 (selectAutoSkill 사용 - 일반 전투와 동일)
|
||||
// =========================================================================
|
||||
if (opponentCombatStats.hpCurrent > 0 &&
|
||||
opponentAccum >= opponentCombatStats.attackDelayMs) {
|
||||
opponentAccum = 0;
|
||||
|
||||
// 도전자 몬스터 스탯 동기화
|
||||
challengerMonsterStats = MonsterCombatStats.fromCombatStats(
|
||||
playerCombatStats,
|
||||
match.challenger.characterName,
|
||||
);
|
||||
|
||||
// 스킬 자동 선택 (progress_service와 동일한 로직)
|
||||
final selectedSkill = _skillService.selectAutoSkill(
|
||||
player: opponentCombatStats,
|
||||
monster: challengerMonsterStats,
|
||||
skillSystem: opponentSkillSystem,
|
||||
availableSkillIds: opponentSkillIds,
|
||||
activeDoTs: opponentDoTs,
|
||||
activeDebuffs: challengerDebuffs,
|
||||
);
|
||||
|
||||
if (selectedSkill != null && selectedSkill.isAttack) {
|
||||
// 스킬 랭크 조회 및 적용
|
||||
final skillRank = _getSkillRankFromEntry(
|
||||
match.opponent,
|
||||
selectedSkill.id,
|
||||
);
|
||||
final skillResult = _skillService.useAttackSkillWithRank(
|
||||
skill: selectedSkill,
|
||||
player: opponentCombatStats,
|
||||
monster: challengerMonsterStats,
|
||||
skillSystem: opponentSkillSystem,
|
||||
rank: skillRank,
|
||||
);
|
||||
opponentCombatStats = skillResult.updatedPlayer;
|
||||
playerCombatStats = playerCombatStats.copyWith(
|
||||
hpCurrent: skillResult.updatedMonster.hpCurrent,
|
||||
);
|
||||
opponentSkillSystem = skillResult.updatedSkillSystem;
|
||||
opponentSkillUsed = selectedSkill.name;
|
||||
opponentDamage = skillResult.result.damage;
|
||||
} else if (selectedSkill != null && selectedSkill.isDot) {
|
||||
// DOT 스킬 사용
|
||||
final skillResult = _skillService.useDotSkill(
|
||||
skill: selectedSkill,
|
||||
player: opponentCombatStats,
|
||||
skillSystem: opponentSkillSystem,
|
||||
playerInt: opponentCombatStats.atk ~/ 10,
|
||||
playerWis: opponentCombatStats.def ~/ 10,
|
||||
);
|
||||
opponentCombatStats = skillResult.updatedPlayer;
|
||||
opponentSkillSystem = skillResult.updatedSkillSystem;
|
||||
if (skillResult.dotEffect != null) {
|
||||
opponentDoTs.add(skillResult.dotEffect!);
|
||||
}
|
||||
opponentSkillUsed = selectedSkill.name;
|
||||
} else if (selectedSkill != null && selectedSkill.isHeal) {
|
||||
// 회복 스킬 사용
|
||||
final skillResult = _skillService.useHealSkill(
|
||||
skill: selectedSkill,
|
||||
player: opponentCombatStats,
|
||||
skillSystem: opponentSkillSystem,
|
||||
);
|
||||
opponentCombatStats = skillResult.updatedPlayer;
|
||||
opponentSkillSystem = skillResult.updatedSkillSystem;
|
||||
opponentSkillUsed = selectedSkill.name;
|
||||
opponentHealAmount = skillResult.result.healedAmount;
|
||||
} else if (selectedSkill != null && selectedSkill.isBuff) {
|
||||
// 버프 스킬 사용
|
||||
final skillResult = _skillService.useBuffSkill(
|
||||
skill: selectedSkill,
|
||||
player: opponentCombatStats,
|
||||
skillSystem: opponentSkillSystem,
|
||||
);
|
||||
opponentCombatStats = skillResult.updatedPlayer;
|
||||
opponentSkillSystem = skillResult.updatedSkillSystem;
|
||||
opponentSkillUsed = selectedSkill.name;
|
||||
} else if (selectedSkill != null && selectedSkill.isDebuff) {
|
||||
// 디버프 스킬 사용
|
||||
final skillResult = _skillService.useDebuffSkill(
|
||||
skill: selectedSkill,
|
||||
player: opponentCombatStats,
|
||||
skillSystem: opponentSkillSystem,
|
||||
currentDebuffs: challengerDebuffs,
|
||||
);
|
||||
opponentCombatStats = skillResult.updatedPlayer;
|
||||
opponentSkillSystem = skillResult.updatedSkillSystem;
|
||||
final debuffEffect = skillResult.debuffEffect;
|
||||
if (debuffEffect != null) {
|
||||
challengerDebuffs = challengerDebuffs
|
||||
.where((ActiveBuff d) => d.effect.id != debuffEffect.effect.id)
|
||||
.toList()
|
||||
..add(debuffEffect);
|
||||
}
|
||||
opponentSkillUsed = selectedSkill.name;
|
||||
} else {
|
||||
// 일반 공격 (디버프 효과 적용)
|
||||
var debuffedOpponent = opponentCombatStats;
|
||||
if (challengerDebuffs.isNotEmpty) {
|
||||
double atkMod = 0;
|
||||
for (final debuff in challengerDebuffs) {
|
||||
if (!debuff.isExpired(elapsedMs)) {
|
||||
atkMod += debuff.effect.atkModifier;
|
||||
}
|
||||
}
|
||||
final newAtk = (opponentCombatStats.atk * (1 + atkMod))
|
||||
.round()
|
||||
.clamp(opponentCombatStats.atk ~/ 10, opponentCombatStats.atk);
|
||||
debuffedOpponent = opponentCombatStats.copyWith(atk: newAtk);
|
||||
}
|
||||
|
||||
opponentMonsterStats = MonsterCombatStats.fromCombatStats(
|
||||
debuffedOpponent,
|
||||
match.opponent.characterName,
|
||||
);
|
||||
final result = calculator.monsterAttackPlayer(
|
||||
attacker: opponentMonsterStats,
|
||||
defender: playerCombatStats,
|
||||
);
|
||||
playerCombatStats = result.updatedDefender;
|
||||
|
||||
if (result.result.isHit) {
|
||||
opponentDamage = result.result.damage;
|
||||
isOpponentCritical = result.result.isCritical;
|
||||
isChallengerBlocked = result.result.isBlocked;
|
||||
} else {
|
||||
isChallengerEvaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 액션이 발생했을 때만 턴 전송
|
||||
final hasAction = challengerDamage != null ||
|
||||
opponentDamage != null ||
|
||||
challengerHealAmount != null ||
|
||||
opponentHealAmount != null ||
|
||||
challengerSkillUsed != null ||
|
||||
opponentSkillUsed != null;
|
||||
|
||||
if (hasAction) {
|
||||
turns++;
|
||||
yield ArenaCombatTurn(
|
||||
challengerDamage: challengerDamage,
|
||||
opponentDamage: opponentDamage,
|
||||
challengerHp: playerCombatStats.hpCurrent,
|
||||
opponentHp: opponentCombatStats.hpCurrent,
|
||||
challengerHpMax: playerCombatStats.hpMax,
|
||||
opponentHpMax: opponentCombatStats.hpMax,
|
||||
challengerMp: playerCombatStats.mpCurrent,
|
||||
opponentMp: opponentCombatStats.mpCurrent,
|
||||
challengerMpMax: playerCombatStats.mpMax,
|
||||
opponentMpMax: opponentCombatStats.mpMax,
|
||||
isChallengerCritical: isChallengerCritical,
|
||||
isOpponentCritical: isOpponentCritical,
|
||||
isChallengerEvaded: isChallengerEvaded,
|
||||
isOpponentEvaded: isOpponentEvaded,
|
||||
isChallengerBlocked: isChallengerBlocked,
|
||||
isOpponentBlocked: isOpponentBlocked,
|
||||
challengerSkillUsed: challengerSkillUsed,
|
||||
opponentSkillUsed: opponentSkillUsed,
|
||||
challengerHealAmount: challengerHealAmount,
|
||||
opponentHealAmount: opponentHealAmount,
|
||||
);
|
||||
|
||||
// 애니메이션을 위한 딜레이
|
||||
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
}
|
||||
|
||||
// 무한 루프 방지
|
||||
if (turns > 1000) break;
|
||||
}
|
||||
/// ArenaCombatSimulator에 위임하여 턴별 전투 상황을 스트림으로 반환.
|
||||
Stream<ArenaCombatTurn> simulateCombat(ArenaMatch match) {
|
||||
final simulator = ArenaCombatSimulator(rng: _rng);
|
||||
return simulator.simulateCombat(match);
|
||||
}
|
||||
// ============================================================================
|
||||
// AI 베팅 슬롯 선택
|
||||
@@ -722,12 +228,14 @@ class ArenaService {
|
||||
required bool isVictory,
|
||||
}) {
|
||||
// 도전자 장비 목록 복사
|
||||
final challengerEquipment =
|
||||
List<EquipmentItem>.from(match.challenger.finalEquipment ?? []);
|
||||
final challengerEquipment = List<EquipmentItem>.from(
|
||||
match.challenger.finalEquipment ?? [],
|
||||
);
|
||||
|
||||
// 상대 장비 목록 복사
|
||||
final opponentEquipment =
|
||||
List<EquipmentItem>.from(match.opponent.finalEquipment ?? []);
|
||||
final opponentEquipment = List<EquipmentItem>.from(
|
||||
match.opponent.finalEquipment ?? [],
|
||||
);
|
||||
|
||||
if (isVictory) {
|
||||
// 도전자 승리: 도전자가 선택한 슬롯의 상대 장비 획득
|
||||
@@ -766,7 +274,9 @@ class ArenaService {
|
||||
|
||||
/// 슬롯으로 장비 찾기
|
||||
EquipmentItem _findItemBySlot(
|
||||
List<EquipmentItem> equipment, EquipmentSlot slot) {
|
||||
List<EquipmentItem> equipment,
|
||||
EquipmentSlot slot,
|
||||
) {
|
||||
for (final item in equipment) {
|
||||
if (item.slot == slot) return item;
|
||||
}
|
||||
|
||||
295
lib/src/core/engine/character_roll_service.dart
Normal file
295
lib/src/core/engine/character_roll_service.dart
Normal file
@@ -0,0 +1,295 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:asciineverdie/src/core/infrastructure/ad_service.dart';
|
||||
import 'package:asciineverdie/src/core/infrastructure/iap_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
|
||||
/// 캐릭터 생성 굴리기/되돌리기 서비스
|
||||
///
|
||||
/// 굴리기 횟수 제한과 되돌리기 기능을 관리합니다.
|
||||
/// - 굴리기: 5회 (0회 시 광고 시청으로 충전)
|
||||
/// - 되돌리기: 무료 유저 1회(광고), 유료 유저 3회(무료)
|
||||
class CharacterRollService {
|
||||
CharacterRollService._();
|
||||
|
||||
static CharacterRollService? _instance;
|
||||
|
||||
/// 싱글톤 인스턴스
|
||||
static CharacterRollService get instance {
|
||||
_instance ??= CharacterRollService._();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// 상수
|
||||
// ===========================================================================
|
||||
|
||||
/// 저장 키
|
||||
static const String _rollsRemainingKey = 'char_rolls_remaining';
|
||||
|
||||
/// 최대 굴리기 횟수
|
||||
static const int maxRolls = 5;
|
||||
|
||||
/// 최대 되돌리기 횟수 (무료 유저)
|
||||
static const int maxUndoFreeUser = 1;
|
||||
|
||||
/// 최대 되돌리기 횟수 (유료 유저)
|
||||
static const int maxUndoPaidUser = 3;
|
||||
|
||||
// ===========================================================================
|
||||
// 상태
|
||||
// ===========================================================================
|
||||
|
||||
bool _isInitialized = false;
|
||||
|
||||
/// 남은 굴리기 횟수
|
||||
int _rollsRemaining = maxRolls;
|
||||
|
||||
/// 남은 되돌리기 횟수
|
||||
int _undoRemaining = maxUndoFreeUser;
|
||||
|
||||
/// 되돌리기용 스탯 히스토리
|
||||
final List<RollSnapshot> _rollHistory = [];
|
||||
|
||||
// ===========================================================================
|
||||
// 초기화
|
||||
// ===========================================================================
|
||||
|
||||
/// 서비스 초기화
|
||||
Future<void> initialize() async {
|
||||
if (_isInitialized) return;
|
||||
|
||||
await _loadState();
|
||||
_resetUndoForNewSession();
|
||||
|
||||
_isInitialized = true;
|
||||
debugPrint(
|
||||
'[CharacterRollService] Initialized: '
|
||||
'rolls=$_rollsRemaining, undo=$_undoRemaining',
|
||||
);
|
||||
}
|
||||
|
||||
/// 저장된 상태 로드
|
||||
Future<void> _loadState() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
_rollsRemaining = prefs.getInt(_rollsRemainingKey) ?? maxRolls;
|
||||
}
|
||||
|
||||
/// 굴리기 횟수 저장
|
||||
Future<void> _saveRollsRemaining() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setInt(_rollsRemainingKey, _rollsRemaining);
|
||||
debugPrint('[CharacterRollService] Saved rolls: $_rollsRemaining');
|
||||
}
|
||||
|
||||
/// 새 세션 시작 시 되돌리기 초기화
|
||||
void _resetUndoForNewSession() {
|
||||
_undoRemaining = _isPaidUser ? maxUndoPaidUser : maxUndoFreeUser;
|
||||
_rollHistory.clear();
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// 유료 사용자 확인
|
||||
// ===========================================================================
|
||||
|
||||
/// 유료 사용자 여부
|
||||
bool get _isPaidUser => IAPService.instance.isAdRemovalPurchased;
|
||||
|
||||
// ===========================================================================
|
||||
// 굴리기
|
||||
// ===========================================================================
|
||||
|
||||
/// 남은 굴리기 횟수
|
||||
int get rollsRemaining => _rollsRemaining;
|
||||
|
||||
/// 굴리기 가능 여부
|
||||
bool get canRoll => _rollsRemaining > 0;
|
||||
|
||||
/// 굴리기 실행
|
||||
///
|
||||
/// [currentStats] 현재 스탯 (되돌리기용 저장)
|
||||
/// [currentRaceIndex] 현재 종족 인덱스
|
||||
/// [currentKlassIndex] 현재 직업 인덱스
|
||||
/// [currentSeed] 현재 RNG 시드
|
||||
/// Returns: 굴리기 성공 여부
|
||||
bool roll({
|
||||
required Stats currentStats,
|
||||
required int currentRaceIndex,
|
||||
required int currentKlassIndex,
|
||||
required int currentSeed,
|
||||
}) {
|
||||
if (!canRoll) {
|
||||
debugPrint('[CharacterRollService] Cannot roll: no rolls remaining');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 현재 상태를 히스토리에 저장
|
||||
_rollHistory.insert(
|
||||
0,
|
||||
RollSnapshot(
|
||||
stats: currentStats,
|
||||
raceIndex: currentRaceIndex,
|
||||
klassIndex: currentKlassIndex,
|
||||
seed: currentSeed,
|
||||
),
|
||||
);
|
||||
|
||||
// 최대 히스토리 개수 제한 (되돌리기 가능 횟수만큼)
|
||||
final maxHistory = _isPaidUser ? maxUndoPaidUser : maxUndoFreeUser;
|
||||
while (_rollHistory.length > maxHistory) {
|
||||
_rollHistory.removeLast();
|
||||
}
|
||||
|
||||
// 굴리기 횟수 감소
|
||||
_rollsRemaining--;
|
||||
_saveRollsRemaining();
|
||||
|
||||
// 매 굴림마다 되돌리기 횟수 리셋
|
||||
// - 유료 유저: 3회
|
||||
// - 무료 유저: 1회 (광고 시청 필요)
|
||||
_undoRemaining = _isPaidUser ? maxUndoPaidUser : maxUndoFreeUser;
|
||||
|
||||
debugPrint(
|
||||
'[CharacterRollService] Rolled: remaining=$_rollsRemaining, '
|
||||
'history=${_rollHistory.length}, undo=$_undoRemaining',
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// 광고 시청 후 굴리기 충전
|
||||
Future<bool> rechargeRollsWithAd() async {
|
||||
// 유료 사용자는 광고 없이 충전
|
||||
if (_isPaidUser) {
|
||||
_rollsRemaining = maxRolls;
|
||||
await _saveRollsRemaining();
|
||||
debugPrint('[CharacterRollService] Recharged (paid user): $maxRolls');
|
||||
return true;
|
||||
}
|
||||
|
||||
// 인터스티셜 광고 표시
|
||||
final result = await AdService.instance.showInterstitialAd(
|
||||
adType: AdType.interstitialRoll,
|
||||
onComplete: () {
|
||||
_rollsRemaining = maxRolls;
|
||||
_saveRollsRemaining();
|
||||
},
|
||||
);
|
||||
|
||||
if (result == AdResult.completed || result == AdResult.debugSkipped) {
|
||||
debugPrint('[CharacterRollService] Recharged with ad: $maxRolls');
|
||||
return true;
|
||||
}
|
||||
|
||||
debugPrint('[CharacterRollService] Recharge failed: $result');
|
||||
return false;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// 되돌리기
|
||||
// ===========================================================================
|
||||
|
||||
/// 남은 되돌리기 횟수
|
||||
int get undoRemaining => _undoRemaining;
|
||||
|
||||
/// 되돌리기 히스토리 길이
|
||||
int get historyLength => _rollHistory.length;
|
||||
|
||||
/// 실제 사용 가능한 되돌리기 횟수
|
||||
/// min(undoRemaining, historyLength)
|
||||
int get availableUndos {
|
||||
final available = _undoRemaining < _rollHistory.length
|
||||
? _undoRemaining
|
||||
: _rollHistory.length;
|
||||
return available;
|
||||
}
|
||||
|
||||
/// 되돌리기 가능 여부
|
||||
bool get canUndo => availableUndos > 0;
|
||||
|
||||
/// 되돌리기 실행 (유료 사용자)
|
||||
///
|
||||
/// Returns: 복원된 스냅샷 (null이면 실패)
|
||||
RollSnapshot? undoPaidUser() {
|
||||
if (!_isPaidUser) return null;
|
||||
if (!canUndo) return null;
|
||||
|
||||
final snapshot = _rollHistory.removeAt(0);
|
||||
_undoRemaining--;
|
||||
|
||||
debugPrint(
|
||||
'[CharacterRollService] Undo (paid): '
|
||||
'remaining=$_undoRemaining, history=${_rollHistory.length}',
|
||||
);
|
||||
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
/// 되돌리기 실행 (무료 사용자 - 광고 필요)
|
||||
///
|
||||
/// [onSuccess] 광고 시청 완료 후 콜백
|
||||
Future<RollSnapshot?> undoFreeUser() async {
|
||||
if (_isPaidUser) return undoPaidUser();
|
||||
if (!canUndo) return null;
|
||||
|
||||
// 리워드 광고 표시
|
||||
RollSnapshot? result;
|
||||
|
||||
final adResult = await AdService.instance.showRewardedAd(
|
||||
adType: AdType.rewardUndo,
|
||||
onRewarded: () {
|
||||
if (_rollHistory.isNotEmpty) {
|
||||
result = _rollHistory.removeAt(0);
|
||||
_undoRemaining--;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (adResult == AdResult.completed || adResult == AdResult.debugSkipped) {
|
||||
debugPrint(
|
||||
'[CharacterRollService] Undo (free with ad): '
|
||||
'remaining=$_undoRemaining, history=${_rollHistory.length}',
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
debugPrint('[CharacterRollService] Undo failed: $adResult');
|
||||
return null;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// 캐릭터 생성 완료
|
||||
// ===========================================================================
|
||||
|
||||
/// 캐릭터 생성 완료 시 호출
|
||||
///
|
||||
/// 되돌리기 상태만 초기화 (굴리기 횟수는 유지)
|
||||
void onCharacterCreated() {
|
||||
_resetUndoForNewSession();
|
||||
debugPrint('[CharacterRollService] Character created, undo reset');
|
||||
}
|
||||
|
||||
/// 굴리기 횟수 완전 초기화 (디버그용)
|
||||
Future<void> resetRolls() async {
|
||||
_rollsRemaining = maxRolls;
|
||||
await _saveRollsRemaining();
|
||||
_resetUndoForNewSession();
|
||||
debugPrint('[CharacterRollService] Reset all');
|
||||
}
|
||||
}
|
||||
|
||||
/// 굴리기 스냅샷 (되돌리기용)
|
||||
class RollSnapshot {
|
||||
const RollSnapshot({
|
||||
required this.stats,
|
||||
required this.raceIndex,
|
||||
required this.klassIndex,
|
||||
required this.seed,
|
||||
});
|
||||
|
||||
final Stats stats;
|
||||
final int raceIndex;
|
||||
final int klassIndex;
|
||||
final int seed;
|
||||
}
|
||||
282
lib/src/core/engine/chest_service.dart
Normal file
282
lib/src/core/engine/chest_service.dart
Normal file
@@ -0,0 +1,282 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import 'package:asciineverdie/data/potion_data.dart';
|
||||
import 'package:asciineverdie/src/core/model/equipment_item.dart';
|
||||
import 'package:asciineverdie/src/core/model/equipment_slot.dart';
|
||||
import 'package:asciineverdie/src/core/model/item_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/treasure_chest.dart';
|
||||
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||
|
||||
/// 보물 상자 서비스
|
||||
///
|
||||
/// 상자 내용물 생성 및 오픈 로직 담당
|
||||
class ChestService {
|
||||
ChestService({DeterministicRandom? rng})
|
||||
: _rng = rng ?? DeterministicRandom(DateTime.now().millisecondsSinceEpoch);
|
||||
|
||||
final DeterministicRandom _rng;
|
||||
|
||||
// ==========================================================================
|
||||
// 상수
|
||||
// ==========================================================================
|
||||
|
||||
/// 보상 타입별 확률 (%)
|
||||
static const int _equipmentChance = 40; // 장비 40%
|
||||
static const int _potionChance = 30; // 포션 30%
|
||||
static const int _goldChance = 20; // 골드 20%
|
||||
// 경험치 10% (나머지)
|
||||
|
||||
/// 골드 보상 범위 (레벨 * 배율)
|
||||
static const int _goldPerLevel = 50;
|
||||
static const int _goldVariance = 20;
|
||||
|
||||
/// 경험치 보상 범위 (레벨 * 배율)
|
||||
static const int _expPerLevel = 100;
|
||||
static const int _expVariance = 30;
|
||||
|
||||
/// 포션 수량 범위
|
||||
static const int _minPotionCount = 1;
|
||||
static const int _maxPotionCount = 3;
|
||||
|
||||
// ==========================================================================
|
||||
// 상자 오픈
|
||||
// ==========================================================================
|
||||
|
||||
/// 상자 오픈하여 보상 생성
|
||||
///
|
||||
/// [playerLevel] 플레이어 레벨 (보상 스케일링용)
|
||||
ChestReward openChest(int playerLevel) {
|
||||
final roll = _rng.nextInt(100);
|
||||
|
||||
if (roll < _equipmentChance) {
|
||||
// 40%: 장비
|
||||
return _generateEquipmentReward(playerLevel);
|
||||
} else if (roll < _equipmentChance + _potionChance) {
|
||||
// 30%: 포션
|
||||
return _generatePotionReward(playerLevel);
|
||||
} else if (roll < _equipmentChance + _potionChance + _goldChance) {
|
||||
// 20%: 골드
|
||||
return _generateGoldReward(playerLevel);
|
||||
} else {
|
||||
// 10%: 경험치
|
||||
return _generateExperienceReward(playerLevel);
|
||||
}
|
||||
}
|
||||
|
||||
/// 여러 상자 오픈
|
||||
List<ChestReward> openMultipleChests(int count, int playerLevel) {
|
||||
final rewards = <ChestReward>[];
|
||||
for (var i = 0; i < count; i++) {
|
||||
rewards.add(openChest(playerLevel));
|
||||
}
|
||||
return rewards;
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
// 보상 생성
|
||||
// ==========================================================================
|
||||
|
||||
/// 장비 보상 생성
|
||||
ChestReward _generateEquipmentReward(int playerLevel) {
|
||||
// 랜덤 슬롯 선택
|
||||
final slotIndex = _rng.nextInt(EquipmentSlot.values.length);
|
||||
final slot = EquipmentSlot.values[slotIndex];
|
||||
|
||||
// 희귀도 결정 (상자는 좀 더 좋은 확률)
|
||||
final rarity = _rollChestRarity();
|
||||
|
||||
// 아이템 레벨: 플레이어 레벨 ±2
|
||||
final minLevel = (playerLevel - 2).clamp(1, 999);
|
||||
final maxLevel = playerLevel + 2;
|
||||
final itemLevel = minLevel + _rng.nextInt(maxLevel - minLevel + 1);
|
||||
|
||||
// 아이템 생성
|
||||
final item = EquipmentItem(
|
||||
name: _generateItemName(slot, rarity, itemLevel),
|
||||
slot: slot,
|
||||
level: itemLevel,
|
||||
weight: _calculateWeight(slot, itemLevel),
|
||||
stats: _generateItemStats(slot, itemLevel, rarity),
|
||||
rarity: rarity,
|
||||
);
|
||||
|
||||
debugPrint(
|
||||
'[ChestService] Equipment reward: ${item.name} (${rarity.name})',
|
||||
);
|
||||
return ChestReward.equipment(item);
|
||||
}
|
||||
|
||||
/// 포션 보상 생성
|
||||
ChestReward _generatePotionReward(int playerLevel) {
|
||||
// 레벨에 맞는 티어 선택
|
||||
final tier = PotionData.tierForLevel(playerLevel);
|
||||
|
||||
// HP/MP 랜덤 선택
|
||||
final isHp = _rng.nextInt(2) == 0;
|
||||
final potion = isHp
|
||||
? PotionData.getHpPotionByTier(tier)
|
||||
: PotionData.getMpPotionByTier(tier);
|
||||
|
||||
if (potion == null) {
|
||||
// 폴백: 기본 포션
|
||||
return ChestReward.potion('minor_health_patch', 1);
|
||||
}
|
||||
|
||||
// 수량 결정
|
||||
final count =
|
||||
_minPotionCount + _rng.nextInt(_maxPotionCount - _minPotionCount + 1);
|
||||
|
||||
debugPrint('[ChestService] Potion reward: ${potion.name} x$count');
|
||||
return ChestReward.potion(potion.id, count);
|
||||
}
|
||||
|
||||
/// 골드 보상 생성
|
||||
ChestReward _generateGoldReward(int playerLevel) {
|
||||
final baseGold = playerLevel * _goldPerLevel;
|
||||
final variance = _rng.nextInt(_goldVariance * 2 + 1) - _goldVariance;
|
||||
final gold = (baseGold + (baseGold * variance / 100)).round().clamp(
|
||||
10,
|
||||
99999,
|
||||
);
|
||||
|
||||
debugPrint('[ChestService] Gold reward: $gold');
|
||||
return ChestReward.gold(gold);
|
||||
}
|
||||
|
||||
/// 경험치 보상 생성
|
||||
ChestReward _generateExperienceReward(int playerLevel) {
|
||||
final baseExp = playerLevel * _expPerLevel;
|
||||
final variance = _rng.nextInt(_expVariance * 2 + 1) - _expVariance;
|
||||
final exp = (baseExp + (baseExp * variance / 100)).round().clamp(
|
||||
10,
|
||||
999999,
|
||||
);
|
||||
|
||||
debugPrint('[ChestService] Experience reward: $exp');
|
||||
return ChestReward.experience(exp);
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
// 헬퍼 메서드
|
||||
// ==========================================================================
|
||||
|
||||
/// 상자 희귀도 롤 (일반 샵보다 좋은 확률)
|
||||
/// Common 50%, Uncommon 30%, Rare 15%, Epic 4%, Legendary 1%
|
||||
ItemRarity _rollChestRarity() {
|
||||
final roll = _rng.nextInt(100);
|
||||
if (roll < 50) return ItemRarity.common;
|
||||
if (roll < 80) return ItemRarity.uncommon;
|
||||
if (roll < 95) return ItemRarity.rare;
|
||||
if (roll < 99) return ItemRarity.epic;
|
||||
return ItemRarity.legendary;
|
||||
}
|
||||
|
||||
/// 아이템 이름 생성
|
||||
String _generateItemName(EquipmentSlot slot, ItemRarity rarity, int level) {
|
||||
final prefix = _getRarityPrefix(rarity);
|
||||
final baseName = _getSlotBaseName(slot);
|
||||
final suffix = level > 10 ? ' +${level ~/ 10}' : '';
|
||||
return '$prefix$baseName$suffix'.trim();
|
||||
}
|
||||
|
||||
String _getRarityPrefix(ItemRarity rarity) {
|
||||
return switch (rarity) {
|
||||
ItemRarity.common => '',
|
||||
ItemRarity.uncommon => 'Fine ',
|
||||
ItemRarity.rare => 'Superior ',
|
||||
ItemRarity.epic => 'Epic ',
|
||||
ItemRarity.legendary => 'Legendary ',
|
||||
};
|
||||
}
|
||||
|
||||
String _getSlotBaseName(EquipmentSlot slot) {
|
||||
return switch (slot) {
|
||||
EquipmentSlot.weapon => 'Keyboard',
|
||||
EquipmentSlot.shield => 'Firewall Shield',
|
||||
EquipmentSlot.helm => 'Neural Headset',
|
||||
EquipmentSlot.hauberk => 'Server Rack Armor',
|
||||
EquipmentSlot.brassairts => 'Cable Brassairts',
|
||||
EquipmentSlot.vambraces => 'USB Vambraces',
|
||||
EquipmentSlot.gauntlets => 'Typing Gauntlets',
|
||||
EquipmentSlot.gambeson => 'Padded Gambeson',
|
||||
EquipmentSlot.cuisses => 'Circuit Cuisses',
|
||||
EquipmentSlot.greaves => 'Copper Greaves',
|
||||
EquipmentSlot.sollerets => 'Static Boots',
|
||||
};
|
||||
}
|
||||
|
||||
/// 스탯 생성
|
||||
ItemStats _generateItemStats(
|
||||
EquipmentSlot slot,
|
||||
int level,
|
||||
ItemRarity rarity,
|
||||
) {
|
||||
final multiplier = rarity.multiplier;
|
||||
final baseValue = (level * multiplier).round();
|
||||
|
||||
return switch (slot) {
|
||||
EquipmentSlot.weapon => ItemStats(
|
||||
atk: baseValue * 2,
|
||||
criRate: 0.01 * (level ~/ 5),
|
||||
parryRate: 0.005 * level,
|
||||
),
|
||||
EquipmentSlot.shield => ItemStats(
|
||||
def: baseValue,
|
||||
blockRate: 0.02 * (level ~/ 3).clamp(1, 10),
|
||||
),
|
||||
EquipmentSlot.helm => ItemStats(
|
||||
def: baseValue ~/ 2,
|
||||
magDef: baseValue ~/ 2,
|
||||
intBonus: level ~/ 10,
|
||||
),
|
||||
EquipmentSlot.hauberk => ItemStats(def: baseValue, hpBonus: level * 2),
|
||||
EquipmentSlot.brassairts => ItemStats(
|
||||
def: baseValue ~/ 2,
|
||||
strBonus: level ~/ 15,
|
||||
),
|
||||
EquipmentSlot.vambraces => ItemStats(
|
||||
def: baseValue ~/ 2,
|
||||
dexBonus: level ~/ 15,
|
||||
),
|
||||
EquipmentSlot.gauntlets => ItemStats(
|
||||
atk: baseValue ~/ 2,
|
||||
def: baseValue ~/ 4,
|
||||
),
|
||||
EquipmentSlot.gambeson => ItemStats(
|
||||
def: baseValue ~/ 2,
|
||||
conBonus: level ~/ 15,
|
||||
),
|
||||
EquipmentSlot.cuisses => ItemStats(
|
||||
def: baseValue ~/ 2,
|
||||
evasion: 0.005 * level,
|
||||
),
|
||||
EquipmentSlot.greaves => ItemStats(
|
||||
def: baseValue ~/ 2,
|
||||
evasion: 0.003 * level,
|
||||
),
|
||||
EquipmentSlot.sollerets => ItemStats(
|
||||
def: baseValue ~/ 3,
|
||||
evasion: 0.002 * level,
|
||||
dexBonus: level ~/ 20,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/// 무게 계산
|
||||
int _calculateWeight(EquipmentSlot slot, int level) {
|
||||
final baseWeight = switch (slot) {
|
||||
EquipmentSlot.weapon => 5,
|
||||
EquipmentSlot.shield => 8,
|
||||
EquipmentSlot.helm => 4,
|
||||
EquipmentSlot.hauberk => 15,
|
||||
EquipmentSlot.brassairts => 3,
|
||||
EquipmentSlot.vambraces => 3,
|
||||
EquipmentSlot.gauntlets => 2,
|
||||
EquipmentSlot.gambeson => 6,
|
||||
EquipmentSlot.cuisses => 5,
|
||||
EquipmentSlot.greaves => 4,
|
||||
EquipmentSlot.sollerets => 3,
|
||||
};
|
||||
return baseWeight + (level ~/ 10);
|
||||
}
|
||||
}
|
||||
@@ -98,8 +98,9 @@ class CombatCalculator {
|
||||
final isParried = parryRoll < defenderParryRate;
|
||||
|
||||
// 3. 기본 데미지 계산 (0.8 ~ 1.2 변동)
|
||||
// DEF 감산 비율: 0.4 (전체 데미지 상승 조정)
|
||||
final damageVariation = 0.8 + rng.nextDouble() * 0.4;
|
||||
var baseDamage = (attackerAtk * damageVariation - defenderDef * 0.5);
|
||||
var baseDamage = (attackerAtk * damageVariation - defenderDef * 0.4);
|
||||
|
||||
// 4. 크리티컬 판정
|
||||
final criRoll = rng.nextDouble();
|
||||
@@ -206,7 +207,7 @@ class CombatCalculator {
|
||||
required MonsterCombatStats monster,
|
||||
}) {
|
||||
// 플레이어 DPS (초당 데미지)
|
||||
final playerDamagePerHit = math.max(1, player.atk - monster.def * 0.5);
|
||||
final playerDamagePerHit = math.max(1, player.atk - monster.def * 0.4);
|
||||
final playerHitsPerSecond = 1000 / player.attackDelayMs;
|
||||
final playerDps =
|
||||
playerDamagePerHit * playerHitsPerSecond * player.accuracy;
|
||||
@@ -226,14 +227,14 @@ class CombatCalculator {
|
||||
required MonsterCombatStats monster,
|
||||
}) {
|
||||
// 플레이어 예상 생존 시간
|
||||
final monsterDamagePerHit = math.max(1, monster.atk - player.def * 0.5);
|
||||
final monsterDamagePerHit = math.max(1, monster.atk - player.def * 0.4);
|
||||
final monsterHitsPerSecond = 1000 / monster.attackDelayMs;
|
||||
final monsterDps =
|
||||
monsterDamagePerHit * monsterHitsPerSecond * monster.accuracy;
|
||||
final playerSurvivalTime = player.hpCurrent / monsterDps;
|
||||
|
||||
// 몬스터 예상 생존 시간
|
||||
final playerDamagePerHit = math.max(1, player.atk - monster.def * 0.5);
|
||||
final playerDamagePerHit = math.max(1, player.atk - monster.def * 0.4);
|
||||
final playerHitsPerSecond = 1000 / player.attackDelayMs;
|
||||
final playerDps =
|
||||
playerDamagePerHit * playerHitsPerSecond * player.accuracy;
|
||||
|
||||
477
lib/src/core/engine/combat_tick_service.dart
Normal file
477
lib/src/core/engine/combat_tick_service.dart
Normal file
@@ -0,0 +1,477 @@
|
||||
import 'package:asciineverdie/data/class_data.dart';
|
||||
import 'package:asciineverdie/data/skill_data.dart';
|
||||
import 'package:asciineverdie/src/core/engine/combat_calculator.dart';
|
||||
import 'package:asciineverdie/src/core/model/class_traits.dart';
|
||||
import 'package:asciineverdie/src/core/engine/player_attack_processor.dart';
|
||||
import 'package:asciineverdie/src/core/engine/potion_service.dart';
|
||||
import 'package:asciineverdie/src/core/engine/skill_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_event.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/potion.dart';
|
||||
import 'package:asciineverdie/src/core/model/skill.dart';
|
||||
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||
|
||||
/// 전투 틱 처리 결과
|
||||
class CombatTickResult {
|
||||
const CombatTickResult({
|
||||
required this.combat,
|
||||
required this.skillSystem,
|
||||
this.potionInventory,
|
||||
});
|
||||
|
||||
final CombatState combat;
|
||||
final SkillSystemState skillSystem;
|
||||
final PotionInventory? potionInventory;
|
||||
}
|
||||
|
||||
/// 전투 틱 처리 서비스
|
||||
///
|
||||
/// ProgressService에서 분리된 전투 로직 담당:
|
||||
/// - 스킬 자동 사용
|
||||
/// - DOT 처리
|
||||
/// - 물약 자동 사용
|
||||
/// - 플레이어/몬스터 공격 처리
|
||||
class CombatTickService {
|
||||
CombatTickService({required this.rng});
|
||||
|
||||
final DeterministicRandom rng;
|
||||
|
||||
/// 전투 틱 처리 (스킬 자동 사용, DOT, 물약 포함)
|
||||
///
|
||||
/// [state] 현재 게임 상태
|
||||
/// [combat] 현재 전투 상태
|
||||
/// [skillSystem] 스킬 시스템 상태
|
||||
/// [elapsedMs] 경과 시간 (밀리초)
|
||||
CombatTickResult processTick({
|
||||
required GameState state,
|
||||
required CombatState combat,
|
||||
required SkillSystemState skillSystem,
|
||||
required int elapsedMs,
|
||||
}) {
|
||||
if (!combat.isActive || combat.isCombatOver) {
|
||||
return CombatTickResult(
|
||||
combat: combat,
|
||||
skillSystem: skillSystem,
|
||||
potionInventory: null,
|
||||
);
|
||||
}
|
||||
|
||||
final calculator = CombatCalculator(rng: rng);
|
||||
final skillService = SkillService(rng: rng);
|
||||
final potionService = const PotionService();
|
||||
var playerStats = combat.playerStats;
|
||||
var monsterStats = combat.monsterStats;
|
||||
var playerAccumulator = combat.playerAttackAccumulatorMs + elapsedMs;
|
||||
var monsterAccumulator = combat.monsterAttackAccumulatorMs + elapsedMs;
|
||||
var totalDamageDealt = combat.totalDamageDealt;
|
||||
var totalDamageTaken = combat.totalDamageTaken;
|
||||
var turnsElapsed = combat.turnsElapsed;
|
||||
var updatedSkillSystem = skillSystem;
|
||||
var activeDoTs = [...combat.activeDoTs];
|
||||
var lastPotionUsedMs = combat.lastPotionUsedMs;
|
||||
var activeDebuffs = [...combat.activeDebuffs];
|
||||
PotionInventory? updatedPotionInventory;
|
||||
|
||||
// 새 전투 이벤트 수집
|
||||
final newEvents = <CombatEvent>[];
|
||||
final timestamp = updatedSkillSystem.elapsedMs;
|
||||
|
||||
// 만료된 디버프 정리
|
||||
activeDebuffs = activeDebuffs
|
||||
.where((debuff) => !debuff.isExpired(timestamp))
|
||||
.toList();
|
||||
|
||||
// DOT 틱 처리
|
||||
final dotResult = _processDotTicks(
|
||||
activeDoTs: activeDoTs,
|
||||
monsterStats: monsterStats,
|
||||
elapsedMs: elapsedMs,
|
||||
timestamp: timestamp,
|
||||
totalDamageDealt: totalDamageDealt,
|
||||
);
|
||||
activeDoTs = dotResult.activeDoTs;
|
||||
monsterStats = dotResult.monsterStats;
|
||||
totalDamageDealt = dotResult.totalDamageDealt;
|
||||
newEvents.addAll(dotResult.events);
|
||||
|
||||
// 클래스 패시브 조회 (healingBonus, firstStrikeBonus, multiAttack)
|
||||
final klass = ClassData.findById(state.traits.classId);
|
||||
final healingBonus =
|
||||
klass?.getPassiveValue(ClassPassiveType.healingBonus) ?? 0.0;
|
||||
final healingMultiplier = 1.0 + healingBonus;
|
||||
final firstStrikeBonus =
|
||||
klass?.getPassiveValue(ClassPassiveType.firstStrikeBonus) ?? 0.0;
|
||||
final hasMultiAttack =
|
||||
klass?.hasPassive(ClassPassiveType.multiAttack) ?? false;
|
||||
var isFirstPlayerAttack = combat.isFirstPlayerAttack;
|
||||
|
||||
// 긴급 물약 자동 사용 (HP < 30% 또는 MP < 50%)
|
||||
final potionResult = _tryEmergencyPotion(
|
||||
playerStats: playerStats,
|
||||
potionInventory: state.potionInventory,
|
||||
lastPotionUsedMs: lastPotionUsedMs,
|
||||
playerLevel: state.traits.level,
|
||||
timestamp: timestamp,
|
||||
potionService: potionService,
|
||||
healingMultiplier: healingMultiplier,
|
||||
);
|
||||
if (potionResult != null) {
|
||||
playerStats = potionResult.playerStats;
|
||||
lastPotionUsedMs = potionResult.lastPotionUsedMs;
|
||||
updatedPotionInventory = potionResult.potionInventory;
|
||||
newEvents.addAll(potionResult.events);
|
||||
}
|
||||
|
||||
// 스킬 버프 모디파이어 조회 (전투 계산에 적용)
|
||||
final buffMods = updatedSkillSystem.totalBuffModifiers;
|
||||
|
||||
// 플레이어 공격 체크
|
||||
if (playerAccumulator >= playerStats.attackDelayMs) {
|
||||
// 크리티컬 확률 버프 적용
|
||||
final buffedPlayerForAttack = buffMods.criMod != 0
|
||||
? playerStats.copyWith(
|
||||
criRate: (playerStats.criRate + buffMods.criMod).clamp(0.0, 1.0),
|
||||
)
|
||||
: playerStats;
|
||||
|
||||
final attackProcessor = PlayerAttackProcessor(rng: rng);
|
||||
final attackResult = attackProcessor.processAttack(
|
||||
state: state,
|
||||
playerStats: buffedPlayerForAttack,
|
||||
monsterStats: monsterStats,
|
||||
updatedSkillSystem: updatedSkillSystem,
|
||||
activeDoTs: activeDoTs,
|
||||
activeDebuffs: activeDebuffs,
|
||||
totalDamageDealt: totalDamageDealt,
|
||||
timestamp: timestamp,
|
||||
calculator: calculator,
|
||||
skillService: skillService,
|
||||
isFirstPlayerAttack: isFirstPlayerAttack,
|
||||
firstStrikeBonus: firstStrikeBonus > 0 ? firstStrikeBonus : 1.0,
|
||||
hasMultiAttack: hasMultiAttack,
|
||||
healingMultiplier: healingMultiplier,
|
||||
);
|
||||
|
||||
// 크리티컬 버프가 적용된 스탯에서 HP/MP만 원본에 반영
|
||||
final attackedPlayer = attackResult.playerStats;
|
||||
playerStats = buffMods.criMod != 0
|
||||
? playerStats.copyWith(
|
||||
hpCurrent: attackedPlayer.hpCurrent,
|
||||
mpCurrent: attackedPlayer.mpCurrent,
|
||||
)
|
||||
: attackedPlayer;
|
||||
monsterStats = attackResult.monsterStats;
|
||||
updatedSkillSystem = attackResult.skillSystem;
|
||||
activeDoTs = attackResult.activeDoTs;
|
||||
activeDebuffs = attackResult.activeDebuffs;
|
||||
totalDamageDealt = attackResult.totalDamageDealt;
|
||||
newEvents.addAll(attackResult.events);
|
||||
isFirstPlayerAttack = attackResult.isFirstPlayerAttack;
|
||||
|
||||
playerAccumulator -= playerStats.attackDelayMs;
|
||||
turnsElapsed++;
|
||||
}
|
||||
|
||||
// 몬스터가 살아있으면 반격
|
||||
if (monsterStats.isAlive &&
|
||||
monsterAccumulator >= monsterStats.attackDelayMs) {
|
||||
// 방어력/회피율 버프 적용
|
||||
final buffedPlayerForDefense =
|
||||
(buffMods.defMod != 0 || buffMods.evasionMod != 0)
|
||||
? playerStats.copyWith(
|
||||
def: (playerStats.def * (1.0 + buffMods.defMod)).round(),
|
||||
evasion: (playerStats.evasion + buffMods.evasionMod).clamp(
|
||||
0.0,
|
||||
1.0,
|
||||
),
|
||||
)
|
||||
: playerStats;
|
||||
|
||||
final monsterAttackResult = _processMonsterAttack(
|
||||
playerStats: buffedPlayerForDefense,
|
||||
monsterStats: monsterStats,
|
||||
activeDebuffs: activeDebuffs,
|
||||
totalDamageTaken: totalDamageTaken,
|
||||
timestamp: timestamp,
|
||||
calculator: calculator,
|
||||
);
|
||||
|
||||
// 버프 적용된 스탯에서 HP/MP만 원본에 반영
|
||||
final defendedPlayer = monsterAttackResult.playerStats;
|
||||
playerStats = playerStats.copyWith(
|
||||
hpCurrent: defendedPlayer.hpCurrent,
|
||||
mpCurrent: defendedPlayer.mpCurrent,
|
||||
);
|
||||
totalDamageTaken = monsterAttackResult.totalDamageTaken;
|
||||
newEvents.addAll(monsterAttackResult.events);
|
||||
monsterAccumulator -= monsterStats.attackDelayMs;
|
||||
}
|
||||
|
||||
// 전투 종료 체크
|
||||
final isActive = playerStats.isAlive && monsterStats.isAlive;
|
||||
|
||||
// 기존 이벤트와 합쳐서 최대 10개 유지
|
||||
final combinedEvents = [...combat.recentEvents, ...newEvents];
|
||||
final recentEvents = combinedEvents.length > 10
|
||||
? combinedEvents.sublist(combinedEvents.length - 10)
|
||||
: combinedEvents;
|
||||
|
||||
return CombatTickResult(
|
||||
combat: combat.copyWith(
|
||||
playerStats: playerStats,
|
||||
monsterStats: monsterStats,
|
||||
playerAttackAccumulatorMs: playerAccumulator,
|
||||
monsterAttackAccumulatorMs: monsterAccumulator,
|
||||
totalDamageDealt: totalDamageDealt,
|
||||
totalDamageTaken: totalDamageTaken,
|
||||
turnsElapsed: turnsElapsed,
|
||||
isActive: isActive,
|
||||
recentEvents: recentEvents,
|
||||
activeDoTs: activeDoTs,
|
||||
lastPotionUsedMs: lastPotionUsedMs,
|
||||
activeDebuffs: activeDebuffs,
|
||||
isFirstPlayerAttack: isFirstPlayerAttack,
|
||||
),
|
||||
skillSystem: updatedSkillSystem,
|
||||
potionInventory: updatedPotionInventory,
|
||||
);
|
||||
}
|
||||
|
||||
/// DOT 틱 처리
|
||||
({
|
||||
List<DotEffect> activeDoTs,
|
||||
MonsterCombatStats monsterStats,
|
||||
int totalDamageDealt,
|
||||
List<CombatEvent> events,
|
||||
})
|
||||
_processDotTicks({
|
||||
required List<DotEffect> activeDoTs,
|
||||
required MonsterCombatStats monsterStats,
|
||||
required int elapsedMs,
|
||||
required int timestamp,
|
||||
required int totalDamageDealt,
|
||||
}) {
|
||||
var dotDamageThisTick = 0;
|
||||
final updatedDoTs = <DotEffect>[];
|
||||
final events = <CombatEvent>[];
|
||||
var updatedMonster = monsterStats;
|
||||
|
||||
for (final dot in activeDoTs) {
|
||||
final (updatedDot, ticksTriggered) = dot.tick(elapsedMs);
|
||||
|
||||
if (ticksTriggered > 0) {
|
||||
final damage = dot.damagePerTick * ticksTriggered;
|
||||
dotDamageThisTick += damage;
|
||||
|
||||
// DOT 데미지 이벤트 생성
|
||||
final dotSkillName =
|
||||
SkillData.getSkillById(dot.skillId)?.name ?? dot.skillId;
|
||||
events.add(
|
||||
CombatEvent.dotTick(
|
||||
timestamp: timestamp,
|
||||
skillName: dotSkillName,
|
||||
damage: damage,
|
||||
targetName: updatedMonster.name,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 만료되지 않은 DOT만 유지
|
||||
if (updatedDot.isActive) {
|
||||
updatedDoTs.add(updatedDot);
|
||||
}
|
||||
}
|
||||
|
||||
// DOT 데미지 적용
|
||||
if (dotDamageThisTick > 0 && updatedMonster.isAlive) {
|
||||
final newMonsterHp = (updatedMonster.hpCurrent - dotDamageThisTick).clamp(
|
||||
0,
|
||||
updatedMonster.hpMax,
|
||||
);
|
||||
updatedMonster = updatedMonster.copyWith(hpCurrent: newMonsterHp);
|
||||
totalDamageDealt += dotDamageThisTick;
|
||||
}
|
||||
|
||||
return (
|
||||
activeDoTs: updatedDoTs,
|
||||
monsterStats: updatedMonster,
|
||||
totalDamageDealt: totalDamageDealt,
|
||||
events: events,
|
||||
);
|
||||
}
|
||||
|
||||
/// 긴급 물약 자동 사용 (HP/MP 통합 글로벌 쿨타임)
|
||||
({
|
||||
CombatStats playerStats,
|
||||
int lastPotionUsedMs,
|
||||
PotionInventory potionInventory,
|
||||
List<CombatEvent> events,
|
||||
})?
|
||||
_tryEmergencyPotion({
|
||||
required CombatStats playerStats,
|
||||
required PotionInventory potionInventory,
|
||||
required int lastPotionUsedMs,
|
||||
required int playerLevel,
|
||||
required int timestamp,
|
||||
required PotionService potionService,
|
||||
double healingMultiplier = 1.0,
|
||||
}) {
|
||||
// 글로벌 쿨타임 체크
|
||||
if (timestamp - lastPotionUsedMs < PotionService.globalPotionCooldownMs) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 우선순위 1: HP 물약 (소모된 HP >= 물약 회복량)
|
||||
final hpPotion = potionService.selectEmergencyHpPotion(
|
||||
currentHp: playerStats.hpCurrent,
|
||||
maxHp: playerStats.hpMax,
|
||||
inventory: potionInventory,
|
||||
playerLevel: playerLevel,
|
||||
);
|
||||
|
||||
if (hpPotion != null) {
|
||||
final result = potionService.usePotion(
|
||||
potionId: hpPotion.id,
|
||||
inventory: potionInventory,
|
||||
currentHp: playerStats.hpCurrent,
|
||||
maxHp: playerStats.hpMax,
|
||||
currentMp: playerStats.mpCurrent,
|
||||
maxMp: playerStats.mpMax,
|
||||
healingMultiplier: healingMultiplier,
|
||||
);
|
||||
|
||||
if (result.success) {
|
||||
return (
|
||||
playerStats: playerStats.copyWith(hpCurrent: result.newHp),
|
||||
lastPotionUsedMs: timestamp,
|
||||
potionInventory: result.newInventory!,
|
||||
events: [
|
||||
CombatEvent.playerPotion(
|
||||
timestamp: timestamp,
|
||||
potionName: hpPotion.name,
|
||||
healAmount: result.healedAmount,
|
||||
isHp: true,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 우선순위 2: MP 물약 (소모된 MP >= 물약 회복량)
|
||||
final mpPotion = potionService.selectEmergencyMpPotion(
|
||||
currentMp: playerStats.mpCurrent,
|
||||
maxMp: playerStats.mpMax,
|
||||
inventory: potionInventory,
|
||||
playerLevel: playerLevel,
|
||||
);
|
||||
|
||||
if (mpPotion != null) {
|
||||
final result = potionService.usePotion(
|
||||
potionId: mpPotion.id,
|
||||
inventory: potionInventory,
|
||||
currentHp: playerStats.hpCurrent,
|
||||
maxHp: playerStats.hpMax,
|
||||
currentMp: playerStats.mpCurrent,
|
||||
maxMp: playerStats.mpMax,
|
||||
healingMultiplier: healingMultiplier,
|
||||
);
|
||||
|
||||
if (result.success) {
|
||||
return (
|
||||
playerStats: playerStats.copyWith(mpCurrent: result.newMp),
|
||||
lastPotionUsedMs: timestamp,
|
||||
potionInventory: result.newInventory!,
|
||||
events: [
|
||||
CombatEvent.playerPotion(
|
||||
timestamp: timestamp,
|
||||
potionName: mpPotion.name,
|
||||
healAmount: result.healedAmount,
|
||||
isHp: false,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// 몬스터 공격 처리
|
||||
({CombatStats playerStats, int totalDamageTaken, List<CombatEvent> events})
|
||||
_processMonsterAttack({
|
||||
required CombatStats playerStats,
|
||||
required MonsterCombatStats monsterStats,
|
||||
required List<ActiveBuff> activeDebuffs,
|
||||
required int totalDamageTaken,
|
||||
required int timestamp,
|
||||
required CombatCalculator calculator,
|
||||
}) {
|
||||
final events = <CombatEvent>[];
|
||||
|
||||
// 디버프 효과 적용된 몬스터 스탯 계산
|
||||
var debuffedMonster = monsterStats;
|
||||
if (activeDebuffs.isNotEmpty) {
|
||||
double atkMod = 0;
|
||||
for (final debuff in activeDebuffs) {
|
||||
if (!debuff.isExpired(timestamp)) {
|
||||
atkMod += debuff.effect.atkModifier;
|
||||
}
|
||||
}
|
||||
// ATK 감소 적용 (최소 10% ATK 유지)
|
||||
final newAtk = (monsterStats.atk * (1 + atkMod)).round().clamp(
|
||||
monsterStats.atk ~/ 10,
|
||||
monsterStats.atk,
|
||||
);
|
||||
debuffedMonster = monsterStats.copyWith(atk: newAtk);
|
||||
}
|
||||
|
||||
final attackResult = calculator.monsterAttackPlayer(
|
||||
attacker: debuffedMonster,
|
||||
defender: playerStats,
|
||||
);
|
||||
|
||||
final result = attackResult.result;
|
||||
if (result.isEvaded) {
|
||||
events.add(
|
||||
CombatEvent.playerEvade(
|
||||
timestamp: timestamp,
|
||||
attackerName: monsterStats.name,
|
||||
),
|
||||
);
|
||||
} else if (result.isBlocked) {
|
||||
events.add(
|
||||
CombatEvent.playerBlock(
|
||||
timestamp: timestamp,
|
||||
reducedDamage: result.damage,
|
||||
attackerName: monsterStats.name,
|
||||
),
|
||||
);
|
||||
} else if (result.isParried) {
|
||||
events.add(
|
||||
CombatEvent.playerParry(
|
||||
timestamp: timestamp,
|
||||
reducedDamage: result.damage,
|
||||
attackerName: monsterStats.name,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
events.add(
|
||||
CombatEvent.monsterAttack(
|
||||
timestamp: timestamp,
|
||||
damage: result.damage,
|
||||
attackerName: monsterStats.name,
|
||||
attackDelayMs: monsterStats.attackDelayMs,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
playerStats: attackResult.updatedDefender,
|
||||
totalDamageTaken: totalDamageTaken + attackResult.result.damage,
|
||||
events: events,
|
||||
);
|
||||
}
|
||||
}
|
||||
172
lib/src/core/engine/death_handler.dart
Normal file
172
lib/src/core/engine/death_handler.dart
Normal file
@@ -0,0 +1,172 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import 'package:asciineverdie/src/core/model/equipment_item.dart';
|
||||
import 'package:asciineverdie/src/core/model/equipment_slot.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/item_stats.dart';
|
||||
|
||||
/// 플레이어 사망 처리 서비스
|
||||
///
|
||||
/// ProgressService에서 분리된 사망 관련 로직 담당:
|
||||
/// - 장비 손실 계산
|
||||
/// - 사망 정보 기록
|
||||
/// - 보스전 레벨링 모드 진입
|
||||
class DeathHandler {
|
||||
const DeathHandler();
|
||||
|
||||
/// 플레이어 사망 처리 (Phase 4)
|
||||
///
|
||||
/// 모든 장비 상실 및 사망 정보 기록.
|
||||
/// 보스전 사망 시: 장비 보호 + 5분 레벨링 모드 진입.
|
||||
GameState processPlayerDeath(
|
||||
GameState state, {
|
||||
required String killerName,
|
||||
required DeathCause cause,
|
||||
}) {
|
||||
// 사망 직전 전투 이벤트 저장 (최대 10개)
|
||||
final lastCombatEvents =
|
||||
state.progress.currentCombat?.recentEvents ?? const [];
|
||||
|
||||
// 보스전 사망 여부 확인 (최종 보스 fighting 상태)
|
||||
final isBossDeath =
|
||||
state.progress.finalBossState == FinalBossState.fighting;
|
||||
|
||||
// 보스전 사망이 아닐 경우에만 장비 손실
|
||||
var newEquipment = state.equipment;
|
||||
var lostCount = 0;
|
||||
String? lostItemName;
|
||||
EquipmentSlot? lostItemSlot;
|
||||
ItemRarity? lostItemRarity;
|
||||
EquipmentItem? lostEquipmentItem; // 광고 부활 시 복구용
|
||||
|
||||
if (!isBossDeath) {
|
||||
final lossResult = _calculateEquipmentLoss(state);
|
||||
newEquipment = lossResult.equipment;
|
||||
lostCount = lossResult.lostCount;
|
||||
lostItemName = lossResult.lostItemName;
|
||||
lostItemSlot = lossResult.lostItemSlot;
|
||||
lostItemRarity = lossResult.lostItemRarity;
|
||||
lostEquipmentItem = lossResult.lostItem;
|
||||
}
|
||||
|
||||
// 사망 정보 생성 (전투 로그 포함)
|
||||
final deathInfo = DeathInfo(
|
||||
cause: cause,
|
||||
killerName: killerName,
|
||||
lostEquipmentCount: lostCount,
|
||||
lostItemName: lostItemName,
|
||||
lostItemSlot: lostItemSlot,
|
||||
lostItemRarity: lostItemRarity,
|
||||
lostItem: lostEquipmentItem,
|
||||
goldAtDeath: state.inventory.gold,
|
||||
levelAtDeath: state.traits.level,
|
||||
timestamp: state.skillSystem.elapsedMs,
|
||||
lastCombatEvents: lastCombatEvents,
|
||||
);
|
||||
|
||||
// 보스전 사망 시 5분 레벨링 모드 진입
|
||||
final bossLevelingEndTime = isBossDeath
|
||||
? DateTime.now().millisecondsSinceEpoch +
|
||||
(5 * 60 * 1000) // 5분
|
||||
: null;
|
||||
|
||||
// 전투 상태 초기화 및 사망 횟수 증가
|
||||
final progress = state.progress.copyWith(
|
||||
clearCurrentCombat: true,
|
||||
deathCount: state.progress.deathCount + 1,
|
||||
bossLevelingEndTime: bossLevelingEndTime,
|
||||
);
|
||||
|
||||
return state.copyWith(
|
||||
equipment: newEquipment,
|
||||
progress: progress,
|
||||
deathInfo: deathInfo,
|
||||
);
|
||||
}
|
||||
|
||||
/// 장비 손실 계산
|
||||
({
|
||||
Equipment equipment,
|
||||
int lostCount,
|
||||
String? lostItemName,
|
||||
EquipmentSlot? lostItemSlot,
|
||||
ItemRarity? lostItemRarity,
|
||||
EquipmentItem? lostItem,
|
||||
})
|
||||
_calculateEquipmentLoss(GameState state) {
|
||||
var newEquipment = state.equipment;
|
||||
|
||||
// 레벨 기반 장비 손실 확률 계산
|
||||
// Lv 1: 20%, Lv 5: ~56%, Lv 10+: 100%
|
||||
// 공식: 20 + (level - 1) * 80 / 9
|
||||
final level = state.traits.level;
|
||||
final lossChancePercent = level >= 10
|
||||
? 100
|
||||
: (20 + ((level - 1) * 80 ~/ 9)).clamp(0, 100);
|
||||
final roll = state.rng.nextInt(100); // 0~99
|
||||
final shouldLoseEquipment = roll < lossChancePercent;
|
||||
|
||||
debugPrint(
|
||||
'[Death] Lv$level lossChance=$lossChancePercent% roll=$roll '
|
||||
'shouldLose=$shouldLoseEquipment',
|
||||
);
|
||||
|
||||
if (!shouldLoseEquipment) {
|
||||
return (
|
||||
equipment: newEquipment,
|
||||
lostCount: 0,
|
||||
lostItemName: null,
|
||||
lostItemSlot: null,
|
||||
lostItemRarity: null,
|
||||
lostItem: null,
|
||||
);
|
||||
}
|
||||
|
||||
// 무기(슬롯 0)를 제외한 장착된 장비 중 1개를 제물로 삭제
|
||||
final equippedNonWeaponSlots = <int>[];
|
||||
for (var i = 1; i < Equipment.slotCount; i++) {
|
||||
final item = state.equipment.getItemByIndex(i);
|
||||
if (item.isNotEmpty) {
|
||||
equippedNonWeaponSlots.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (equippedNonWeaponSlots.isEmpty) {
|
||||
return (
|
||||
equipment: newEquipment,
|
||||
lostCount: 0,
|
||||
lostItemName: null,
|
||||
lostItemSlot: null,
|
||||
lostItemRarity: null,
|
||||
lostItem: null,
|
||||
);
|
||||
}
|
||||
|
||||
// 랜덤하게 1개 슬롯 선택
|
||||
final sacrificeIndex =
|
||||
equippedNonWeaponSlots[state.rng.nextInt(
|
||||
equippedNonWeaponSlots.length,
|
||||
)];
|
||||
|
||||
// 제물로 바칠 아이템 정보 저장
|
||||
final lostItem = state.equipment.getItemByIndex(sacrificeIndex);
|
||||
final lostItemSlot = EquipmentSlot.values[sacrificeIndex];
|
||||
|
||||
// 해당 슬롯을 빈 장비로 교체
|
||||
newEquipment = newEquipment.setItemByIndex(
|
||||
sacrificeIndex,
|
||||
EquipmentItem.empty(lostItemSlot),
|
||||
);
|
||||
|
||||
debugPrint('[Death] Lost item: ${lostItem.name} (slot: $lostItemSlot)');
|
||||
|
||||
return (
|
||||
equipment: newEquipment,
|
||||
lostCount: 1,
|
||||
lostItemName: lostItem.name,
|
||||
lostItemSlot: lostItemSlot,
|
||||
lostItemRarity: lostItem.rarity,
|
||||
lostItem: lostItem,
|
||||
);
|
||||
}
|
||||
}
|
||||
151
lib/src/core/engine/debug_settings_service.dart
Normal file
151
lib/src/core/engine/debug_settings_service.dart
Normal file
@@ -0,0 +1,151 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:asciineverdie/src/core/infrastructure/iap_service.dart';
|
||||
|
||||
/// 디버그 설정 서비스 (Phase 8)
|
||||
///
|
||||
/// 개발/테스트 중 사용하는 디버그 옵션을 통합 관리합니다.
|
||||
/// kDebugMode에서만 활성화됩니다.
|
||||
class DebugSettingsService {
|
||||
DebugSettingsService._();
|
||||
|
||||
static DebugSettingsService? _instance;
|
||||
|
||||
/// 싱글톤 인스턴스
|
||||
static DebugSettingsService get instance {
|
||||
_instance ??= DebugSettingsService._();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// 상수
|
||||
// ===========================================================================
|
||||
|
||||
static const String _keyIapSimulated = 'debug_iap_simulated';
|
||||
static const String _keyOfflineHours = 'debug_offline_hours';
|
||||
|
||||
/// 오프라인 시간 시뮬레이션 옵션
|
||||
static const List<int> offlineHoursOptions = [0, 1, 5, 10, 24];
|
||||
|
||||
// ===========================================================================
|
||||
// 상태
|
||||
// ===========================================================================
|
||||
|
||||
bool _isInitialized = false;
|
||||
|
||||
/// IAP 구매 시뮬레이션 여부 (디버그 모드 전용)
|
||||
bool _iapSimulated = false;
|
||||
|
||||
/// 오프라인 시간 시뮬레이션 (시간 단위)
|
||||
int _offlineHours = 0;
|
||||
|
||||
// ===========================================================================
|
||||
// 초기화
|
||||
// ===========================================================================
|
||||
|
||||
/// 서비스 초기화 (저장된 설정 로드)
|
||||
Future<void> initialize() async {
|
||||
if (_isInitialized) return;
|
||||
if (!kDebugMode) {
|
||||
_isInitialized = true;
|
||||
return;
|
||||
}
|
||||
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
_iapSimulated = prefs.getBool(_keyIapSimulated) ?? false;
|
||||
_offlineHours = prefs.getInt(_keyOfflineHours) ?? 0;
|
||||
|
||||
// 다른 서비스에 설정 동기화
|
||||
_syncToServices();
|
||||
|
||||
_isInitialized = true;
|
||||
debugPrint(
|
||||
'[DebugSettings] Initialized: '
|
||||
'iap=$_iapSimulated, offline=$_offlineHours',
|
||||
);
|
||||
}
|
||||
|
||||
/// 설정을 다른 서비스에 동기화
|
||||
void _syncToServices() {
|
||||
IAPService.instance.debugIAPSimulated = _iapSimulated;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// 디버그 모드 확인
|
||||
// ===========================================================================
|
||||
|
||||
/// 디버그 모드 활성화 여부
|
||||
bool get isDebugMode => kDebugMode;
|
||||
|
||||
// ===========================================================================
|
||||
// IAP 설정
|
||||
// ===========================================================================
|
||||
|
||||
/// IAP 구매 시뮬레이션 여부
|
||||
///
|
||||
/// - true: 유료 유저로 동작 (광고 제거됨)
|
||||
/// - false: 무료 유저로 동작
|
||||
bool get iapSimulated => _iapSimulated;
|
||||
|
||||
/// IAP 구매 시뮬레이션 토글
|
||||
Future<void> setIapSimulated(bool value) async {
|
||||
if (!kDebugMode) return;
|
||||
|
||||
_iapSimulated = value;
|
||||
IAPService.instance.debugIAPSimulated = value;
|
||||
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setBool(_keyIapSimulated, value);
|
||||
|
||||
debugPrint('[DebugSettings] IAP simulated: $value');
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// 오프라인 시간 시뮬레이션
|
||||
// ===========================================================================
|
||||
|
||||
/// 오프라인 시간 시뮬레이션 (시간 단위)
|
||||
///
|
||||
/// 복귀 보상 테스트용. 0이면 시뮬레이션 비활성화.
|
||||
int get offlineHours => _offlineHours;
|
||||
|
||||
/// 오프라인 시간 시뮬레이션 설정
|
||||
Future<void> setOfflineHours(int hours) async {
|
||||
if (!kDebugMode) return;
|
||||
|
||||
_offlineHours = hours;
|
||||
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setInt(_keyOfflineHours, hours);
|
||||
|
||||
debugPrint('[DebugSettings] Offline hours: $hours');
|
||||
}
|
||||
|
||||
/// 시뮬레이션된 마지막 플레이 시간 계산
|
||||
///
|
||||
/// [actualLastPlayTime] 실제 마지막 플레이 시간
|
||||
/// Returns: 시뮬레이션 적용된 마지막 플레이 시간
|
||||
DateTime? getSimulatedLastPlayTime(DateTime? actualLastPlayTime) {
|
||||
if (!kDebugMode || _offlineHours == 0) {
|
||||
return actualLastPlayTime;
|
||||
}
|
||||
|
||||
// 시뮬레이션: 현재 시간에서 offlineHours만큼 뺀 시간을 마지막 플레이 시간으로
|
||||
return DateTime.now().subtract(Duration(hours: _offlineHours));
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// 전체 초기화
|
||||
// ===========================================================================
|
||||
|
||||
/// 모든 디버그 설정 초기화
|
||||
Future<void> resetAll() async {
|
||||
if (!kDebugMode) return;
|
||||
|
||||
await setIapSimulated(false);
|
||||
await setOfflineHours(0);
|
||||
|
||||
debugPrint('[DebugSettings] All settings reset');
|
||||
}
|
||||
}
|
||||
92
lib/src/core/engine/exp_handler.dart
Normal file
92
lib/src/core/engine/exp_handler.dart
Normal file
@@ -0,0 +1,92 @@
|
||||
import 'package:asciineverdie/data/race_data.dart';
|
||||
import 'package:asciineverdie/src/core/engine/game_mutations.dart';
|
||||
import 'package:asciineverdie/src/core/engine/reward_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/util/balance_constants.dart';
|
||||
|
||||
/// 경험치(EXP) 획득 및 레벨업(level-up) 처리를 담당하는 핸들러.
|
||||
class ExpHandler {
|
||||
const ExpHandler({
|
||||
required this.mutations,
|
||||
required this.rewards,
|
||||
required this.recalculateEncumbrance,
|
||||
});
|
||||
|
||||
final GameMutations mutations;
|
||||
final RewardService rewards;
|
||||
|
||||
/// 무게(encumbrance) 재계산 콜백
|
||||
final GameState Function(GameState) recalculateEncumbrance;
|
||||
|
||||
/// 경험치 획득 및 레벨업 처리
|
||||
({GameState state, ProgressState progress, bool leveledUp}) handleExpGain(
|
||||
GameState state,
|
||||
ProgressState progress,
|
||||
int monsterExpReward,
|
||||
) {
|
||||
var nextState = state;
|
||||
var leveledUp = false;
|
||||
|
||||
final race = RaceData.findById(nextState.traits.raceId);
|
||||
final expMultiplier = race?.expMultiplier ?? 1.0;
|
||||
final adjustedExp = (monsterExpReward * expMultiplier).round();
|
||||
final newExpPos = progress.exp.position + adjustedExp;
|
||||
|
||||
if (newExpPos >= progress.exp.max) {
|
||||
final overflowExp = newExpPos - progress.exp.max;
|
||||
nextState = levelUp(nextState);
|
||||
leveledUp = true;
|
||||
progress = nextState.progress;
|
||||
|
||||
if (overflowExp > 0 && nextState.traits.level < 100) {
|
||||
progress = progress.copyWith(
|
||||
exp: progress.exp.copyWith(position: overflowExp),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
progress = progress.copyWith(
|
||||
exp: progress.exp.copyWith(position: newExpPos),
|
||||
);
|
||||
}
|
||||
|
||||
return (state: nextState, progress: progress, leveledUp: leveledUp);
|
||||
}
|
||||
|
||||
/// 레벨업 처리 (스탯 증가, 스킬/주문 획득)
|
||||
GameState levelUp(GameState state) {
|
||||
// 최대 레벨(100) 안전장치: 이미 100레벨이면 레벨업하지 않음
|
||||
if (state.traits.level >= 100) {
|
||||
return state;
|
||||
}
|
||||
|
||||
final nextLevel = state.traits.level + 1;
|
||||
final rng = state.rng;
|
||||
|
||||
// HP/MP 증가량 (PlayerScaling 기반 + 랜덤 변동)
|
||||
// 기존: CON/3 + 1 + random(0-3) → ~6-9 HP/레벨 (너무 낮음)
|
||||
// 신규: 18 + CON/5 + random(0-4) → ~20-25 HP/레벨 (생존율 개선)
|
||||
final hpGain = 18 + state.stats.con ~/ 5 + rng.nextInt(5);
|
||||
final mpGain = 6 + state.stats.intelligence ~/ 5 + rng.nextInt(3);
|
||||
|
||||
var nextState = state.copyWith(
|
||||
traits: state.traits.copyWith(level: nextLevel),
|
||||
stats: state.stats.copyWith(
|
||||
hpMax: state.stats.hpMax + hpGain,
|
||||
mpMax: state.stats.mpMax + mpGain,
|
||||
),
|
||||
);
|
||||
|
||||
// 스탯 2회, 주문(spell) 1회 획득 (원본 레벨업 규칙)
|
||||
nextState = mutations.winStat(nextState);
|
||||
nextState = mutations.winStat(nextState);
|
||||
nextState = mutations.winSpell(nextState, nextState.stats.wis, nextLevel);
|
||||
|
||||
final expBar = ProgressBarState(
|
||||
position: 0,
|
||||
max: ExpConstants.requiredExp(nextLevel),
|
||||
);
|
||||
final progress = nextState.progress.copyWith(exp: expBar);
|
||||
nextState = nextState.copyWith(progress: progress);
|
||||
return recalculateEncumbrance(nextState);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
import 'package:asciineverdie/data/skill_data.dart';
|
||||
import 'package:asciineverdie/src/core/engine/item_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/equipment_slot.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/pq_config.dart';
|
||||
import 'package:asciineverdie/src/core/util/pq_logic.dart' as pq_logic;
|
||||
|
||||
/// Game state mutations that mirror the original PQ win/reward logic.
|
||||
/// 게임 상태 변경(mutation) 함수 — 보상, 장비, 스탯 획득 로직.
|
||||
class GameMutations {
|
||||
const GameMutations(this.config);
|
||||
|
||||
@@ -25,6 +26,7 @@ class GameMutations {
|
||||
name: name,
|
||||
slot: slot,
|
||||
level: level,
|
||||
cha: state.stats.cha,
|
||||
);
|
||||
|
||||
final updatedEquip = state.equipment
|
||||
@@ -43,12 +45,17 @@ class GameMutations {
|
||||
return state.copyWith(rng: state.rng, stats: updatedStats);
|
||||
}
|
||||
|
||||
/// 스펠 획득 (원본 WinSpell)
|
||||
///
|
||||
/// 스펠북에 추가하고, 전투용 스킬 슬롯에도 자동으로 장착 시도.
|
||||
/// 슬롯이 가득 찬 경우 기존 스킬보다 강할 때만 교체됨.
|
||||
GameState winSpell(GameState state, int wisdom, int level) {
|
||||
final result = pq_logic.winSpell(config, state.rng, wisdom, level);
|
||||
final parts = result.split('|');
|
||||
final name = parts[0];
|
||||
final rank = parts.length > 1 ? parts[1] : 'I';
|
||||
|
||||
// 스펠북 업데이트
|
||||
final skills = [...state.skillBook.skills];
|
||||
final index = skills.indexWhere((s) => s.name == name);
|
||||
if (index >= 0) {
|
||||
@@ -57,9 +64,20 @@ class GameMutations {
|
||||
skills.add(SkillEntry(name: name, rank: rank));
|
||||
}
|
||||
|
||||
// 전투 스킬 슬롯에 추가 시도
|
||||
var skillSystem = state.skillSystem;
|
||||
final combatSkill = SkillData.getSkillBySpellName(name);
|
||||
if (combatSkill != null) {
|
||||
final addResult = skillSystem.equippedSkills.tryAddSkill(combatSkill);
|
||||
if (addResult.success) {
|
||||
skillSystem = skillSystem.copyWith(equippedSkills: addResult.slots);
|
||||
}
|
||||
}
|
||||
|
||||
return state.copyWith(
|
||||
rng: state.rng,
|
||||
skillBook: state.skillBook.copyWith(skills: skills),
|
||||
skillSystem: skillSystem,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,23 +60,37 @@ class ItemService {
|
||||
// 희귀도 결정
|
||||
// ============================================================================
|
||||
|
||||
/// 희귀도 결정 (레벨 기반 확률)
|
||||
/// 희귀도 결정 (고정 확률 + CHA 보정)
|
||||
///
|
||||
/// 레벨이 높을수록 희귀한 아이템 확률 증가
|
||||
ItemRarity determineRarity(int level) {
|
||||
/// 기본 확률 분포:
|
||||
/// - Common: 34%
|
||||
/// - Uncommon: 40%
|
||||
/// - Rare: 20%
|
||||
/// - Epic: 5%
|
||||
/// - Legendary: 1%
|
||||
///
|
||||
/// CHA 보정(charisma bonus): (CHA - 10) * 0.5% 추가 희귀 확률.
|
||||
/// 보정값만큼 Common 확률이 줄고, Rare 이상 확률이 증가.
|
||||
ItemRarity determineRarity(int level, {int cha = 0}) {
|
||||
final roll = rng.nextInt(100);
|
||||
final legendaryChance = (level * 0.5).clamp(0, 5).toInt(); // 최대 5%
|
||||
final epicChance = (level * 1.0).clamp(0, 10).toInt(); // 최대 10%
|
||||
final rareChance = (level * 2.0).clamp(0, 20).toInt(); // 최대 20%
|
||||
final uncommonChance = (level * 3.0).clamp(0, 30).toInt(); // 최대 30%
|
||||
|
||||
if (roll < legendaryChance) return ItemRarity.legendary;
|
||||
if (roll < legendaryChance + epicChance) return ItemRarity.epic;
|
||||
if (roll < legendaryChance + epicChance + rareChance)
|
||||
return ItemRarity.rare;
|
||||
if (roll < legendaryChance + epicChance + rareChance + uncommonChance) {
|
||||
return ItemRarity.uncommon;
|
||||
}
|
||||
// CHA 보정: (CHA - 10) * 0.5, 0~10 범위
|
||||
final chaBonus = ((cha - 10) * 0.5).clamp(0.0, 10.0);
|
||||
|
||||
// 보정된 임계값 (chaBonus만큼 희귀 쪽으로 이동)
|
||||
final legendaryThreshold = 1.0 + chaBonus * 0.1; // 최대 2%
|
||||
final epicThreshold = 6.0 + chaBonus * 0.3; // 최대 9%
|
||||
final rareThreshold = 26.0 + chaBonus * 0.6; // 최대 32%
|
||||
|
||||
// Legendary
|
||||
if (roll < legendaryThreshold) return ItemRarity.legendary;
|
||||
// Epic
|
||||
if (roll < epicThreshold) return ItemRarity.epic;
|
||||
// Rare
|
||||
if (roll < rareThreshold) return ItemRarity.rare;
|
||||
// Uncommon: 26-65 (40%)
|
||||
if (roll < 66) return ItemRarity.uncommon;
|
||||
// Common: 66-99 (34%)
|
||||
return ItemRarity.common;
|
||||
}
|
||||
|
||||
@@ -85,12 +99,13 @@ class ItemService {
|
||||
// ============================================================================
|
||||
|
||||
/// 아이템 스탯 생성 (레벨/희귀도/슬롯 기반)
|
||||
/// baseValue 공식: level * 1.2 * rarity (DEF 스케일링 축소)
|
||||
ItemStats generateItemStats({
|
||||
required int level,
|
||||
required ItemRarity rarity,
|
||||
required EquipmentSlot slot,
|
||||
}) {
|
||||
final baseValue = (level * 2 * rarity.multiplier).round();
|
||||
final baseValue = (level * 1.2 * rarity.multiplier).round();
|
||||
|
||||
return switch (slot) {
|
||||
EquipmentSlot.weapon => _generateWeaponStats(baseValue, rarity),
|
||||
@@ -105,6 +120,8 @@ class ItemService {
|
||||
/// - 느린 무기 (1500ms): atk × 1.4
|
||||
/// - 기본 무기 (1000ms): atk × 1.0
|
||||
/// - 빠른 무기 (600ms): atk × 0.7
|
||||
///
|
||||
/// 마법 무기 확률: 30% (magAtk 부여)
|
||||
ItemStats _generateWeaponStats(int baseValue, ItemRarity rarity) {
|
||||
final criBonus = rarity.index >= ItemRarity.rare.index
|
||||
? 0.02 + rarity.index * 0.01
|
||||
@@ -114,59 +131,179 @@ class ItemService {
|
||||
: 0.0;
|
||||
|
||||
// 공속 결정 (600ms ~ 1500ms 범위)
|
||||
// 희귀도가 높을수록 공속 변동 폭 증가
|
||||
final speedVariance =
|
||||
300 + rarity.index * 100; // Common: 300, Legendary: 700
|
||||
final speedVariance = 300 + rarity.index * 100;
|
||||
final speedOffset = rng.nextInt(speedVariance * 2) - speedVariance;
|
||||
final attackSpeed = (1000 + speedOffset).clamp(600, 1500);
|
||||
|
||||
// 공속-데미지 역비례 계산
|
||||
// 기준: 1000ms = 1.0x, 600ms = 0.7x, 1500ms = 1.4x
|
||||
final speedMultiplier = 0.3 + (attackSpeed / 1000) * 0.7;
|
||||
final adjustedAtk = (baseValue * speedMultiplier).round();
|
||||
|
||||
// 마법 무기 여부 (30% 확률)
|
||||
final isMagicWeapon = rng.nextInt(100) < 30;
|
||||
final magAtk = isMagicWeapon ? (adjustedAtk * 0.8).round() : 0;
|
||||
|
||||
// 능력치 보너스 (Rare 이상)
|
||||
final strBonus = rarity.index >= ItemRarity.rare.index && !isMagicWeapon
|
||||
? rarity.index
|
||||
: 0;
|
||||
final intBonus = rarity.index >= ItemRarity.rare.index && isMagicWeapon
|
||||
? rarity.index
|
||||
: 0;
|
||||
|
||||
return ItemStats(
|
||||
atk: adjustedAtk,
|
||||
magAtk: magAtk,
|
||||
criRate: criBonus,
|
||||
parryRate: parryBonus,
|
||||
attackSpeed: attackSpeed,
|
||||
strBonus: strBonus,
|
||||
intBonus: intBonus,
|
||||
);
|
||||
}
|
||||
|
||||
/// 방패 스탯 생성
|
||||
///
|
||||
/// DEF 배율 조정 (v2): 방패 DEF를 0.15배로 축소
|
||||
/// 마법 방어(magDef), CON 보너스 추가
|
||||
ItemStats _generateShieldStats(int baseValue, ItemRarity rarity) {
|
||||
final blockBonus = 0.05 + rarity.index * 0.02;
|
||||
final def = (baseValue * 0.15).round();
|
||||
|
||||
return ItemStats(def: baseValue ~/ 2, blockRate: blockBonus);
|
||||
// 마법 방어 (50% 확률)
|
||||
final hasMagDef = rng.nextInt(100) < 50;
|
||||
final magDef = hasMagDef ? (def * 0.7).round() : 0;
|
||||
|
||||
// HP 보너스 (Uncommon 이상)
|
||||
final hpBonus = rarity.index >= ItemRarity.uncommon.index
|
||||
? baseValue ~/ 3
|
||||
: 0;
|
||||
|
||||
// CON 보너스 (Rare 이상)
|
||||
final conBonus = rarity.index >= ItemRarity.rare.index ? rarity.index : 0;
|
||||
|
||||
return ItemStats(
|
||||
def: def,
|
||||
magDef: magDef,
|
||||
blockRate: blockBonus,
|
||||
hpBonus: hpBonus,
|
||||
conBonus: conBonus,
|
||||
);
|
||||
}
|
||||
|
||||
/// 방어구 스탯 생성
|
||||
///
|
||||
/// DEF 배율 조정 (v2): 9개 방어구 합산 DEF ≈ 무기 ATK × 1.6
|
||||
/// 슬롯별 특화 보너스 추가:
|
||||
/// - 투구(helm): INT, WIS 보너스
|
||||
/// - 갑옷(hauberk): HP, CON 보너스
|
||||
/// - 상완갑/전완갑(brassairts, vambraces): STR, DEX 보너스
|
||||
/// - 건틀릿(gauntlets): STR, 크리티컬 보너스
|
||||
/// - 갬비슨(gambeson): HP, MP 보너스
|
||||
/// - 허벅지갑/정강이갑(cuisses, greaves): CON, 회피 보너스
|
||||
/// - 철제부츠(sollerets): DEX, 회피 보너스
|
||||
ItemStats _generateArmorStats(
|
||||
int baseValue,
|
||||
ItemRarity rarity,
|
||||
EquipmentSlot slot,
|
||||
) {
|
||||
// 슬롯별 방어력 가중치
|
||||
// 슬롯별 방어력 가중치 (총합 ~1.6으로 축소)
|
||||
final defMultiplier = switch (slot) {
|
||||
EquipmentSlot.hauberk => 1.5, // 갑옷류 최고
|
||||
EquipmentSlot.helm => 1.2,
|
||||
EquipmentSlot.gambeson => 1.0,
|
||||
EquipmentSlot.cuisses => 0.9,
|
||||
EquipmentSlot.greaves => 0.8,
|
||||
EquipmentSlot.brassairts => 0.7,
|
||||
EquipmentSlot.vambraces => 0.7,
|
||||
EquipmentSlot.gauntlets => 0.6,
|
||||
EquipmentSlot.sollerets => 0.6,
|
||||
_ => 0.5,
|
||||
EquipmentSlot.hauberk => 0.30,
|
||||
EquipmentSlot.helm => 0.25,
|
||||
EquipmentSlot.gambeson => 0.20,
|
||||
EquipmentSlot.cuisses => 0.18,
|
||||
EquipmentSlot.greaves => 0.16,
|
||||
EquipmentSlot.brassairts => 0.14,
|
||||
EquipmentSlot.vambraces => 0.14,
|
||||
EquipmentSlot.gauntlets => 0.12,
|
||||
EquipmentSlot.sollerets => 0.12,
|
||||
_ => 0.10,
|
||||
};
|
||||
|
||||
final def = (baseValue * defMultiplier).round();
|
||||
|
||||
// 희귀도에 따른 추가 보너스
|
||||
final hpBonus = rarity.index >= ItemRarity.rare.index ? baseValue ~/ 2 : 0;
|
||||
final evasionBonus = rarity.index >= ItemRarity.epic.index ? 0.01 : 0.0;
|
||||
// 슬롯별 특화 보너스 계산
|
||||
return switch (slot) {
|
||||
// 투구: 지능/지혜 보너스, 마법 방어
|
||||
EquipmentSlot.helm => ItemStats(
|
||||
def: def,
|
||||
magDef: rarity.index >= ItemRarity.uncommon.index ? def ~/ 2 : 0,
|
||||
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 3 : 0,
|
||||
intBonus: rarity.index >= ItemRarity.epic.index ? rarity.index : 0,
|
||||
wisBonus: rarity.index >= ItemRarity.rare.index ? rarity.index - 1 : 0,
|
||||
),
|
||||
|
||||
return ItemStats(def: def, hpBonus: hpBonus, evasion: evasionBonus);
|
||||
// 갑옷: HP, CON 보너스 (주력 방어구)
|
||||
EquipmentSlot.hauberk => ItemStats(
|
||||
def: def,
|
||||
hpBonus: rarity.index >= ItemRarity.uncommon.index ? baseValue : 0,
|
||||
conBonus: rarity.index >= ItemRarity.rare.index ? rarity.index : 0,
|
||||
strBonus: rarity.index >= ItemRarity.epic.index ? rarity.index - 1 : 0,
|
||||
),
|
||||
|
||||
// 상완갑: STR 보너스
|
||||
EquipmentSlot.brassairts => ItemStats(
|
||||
def: def,
|
||||
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 4 : 0,
|
||||
strBonus: rarity.index >= ItemRarity.uncommon.index ? rarity.index : 0,
|
||||
),
|
||||
|
||||
// 전완갑: DEX 보너스
|
||||
EquipmentSlot.vambraces => ItemStats(
|
||||
def: def,
|
||||
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 4 : 0,
|
||||
dexBonus: rarity.index >= ItemRarity.uncommon.index ? rarity.index : 0,
|
||||
),
|
||||
|
||||
// 건틀릿: STR, 크리티컬 보너스
|
||||
EquipmentSlot.gauntlets => ItemStats(
|
||||
def: def,
|
||||
criRate: rarity.index >= ItemRarity.rare.index
|
||||
? 0.01 + rarity.index * 0.005
|
||||
: 0.0,
|
||||
strBonus: rarity.index >= ItemRarity.uncommon.index ? rarity.index : 0,
|
||||
),
|
||||
|
||||
// 갬비슨: HP, MP 보너스
|
||||
EquipmentSlot.gambeson => ItemStats(
|
||||
def: def,
|
||||
hpBonus: rarity.index >= ItemRarity.uncommon.index ? baseValue ~/ 2 : 0,
|
||||
mpBonus: rarity.index >= ItemRarity.uncommon.index ? baseValue ~/ 3 : 0,
|
||||
wisBonus: rarity.index >= ItemRarity.epic.index ? rarity.index - 1 : 0,
|
||||
),
|
||||
|
||||
// 허벅지갑: CON, 회피 보너스
|
||||
EquipmentSlot.cuisses => ItemStats(
|
||||
def: def,
|
||||
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 3 : 0,
|
||||
conBonus: rarity.index >= ItemRarity.uncommon.index ? rarity.index : 0,
|
||||
evasion: rarity.index >= ItemRarity.epic.index ? 0.01 : 0.0,
|
||||
),
|
||||
|
||||
// 정강이갑: CON, 회피 보너스
|
||||
EquipmentSlot.greaves => ItemStats(
|
||||
def: def,
|
||||
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 3 : 0,
|
||||
conBonus: rarity.index >= ItemRarity.rare.index ? rarity.index - 1 : 0,
|
||||
evasion: rarity.index >= ItemRarity.epic.index ? 0.01 : 0.0,
|
||||
),
|
||||
|
||||
// 철제부츠: DEX, 회피 보너스
|
||||
EquipmentSlot.sollerets => ItemStats(
|
||||
def: def,
|
||||
dexBonus: rarity.index >= ItemRarity.uncommon.index ? rarity.index : 0,
|
||||
evasion: rarity.index >= ItemRarity.rare.index
|
||||
? 0.01 + rarity.index * 0.005
|
||||
: 0.0,
|
||||
),
|
||||
|
||||
// 기본 (무기, 방패는 여기 안옴)
|
||||
_ => ItemStats(
|
||||
def: def,
|
||||
hpBonus: rarity.index >= ItemRarity.rare.index ? baseValue ~/ 2 : 0,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -205,8 +342,9 @@ class ItemService {
|
||||
required EquipmentSlot slot,
|
||||
required int level,
|
||||
ItemRarity? rarity,
|
||||
int cha = 0,
|
||||
}) {
|
||||
final itemRarity = rarity ?? determineRarity(level);
|
||||
final itemRarity = rarity ?? determineRarity(level, cha: cha);
|
||||
final stats = generateItemStats(
|
||||
level: level,
|
||||
rarity: itemRarity,
|
||||
|
||||
129
lib/src/core/engine/kill_task_handler.dart
Normal file
129
lib/src/core/engine/kill_task_handler.dart
Normal file
@@ -0,0 +1,129 @@
|
||||
import 'package:asciineverdie/data/class_data.dart';
|
||||
import 'package:asciineverdie/src/core/engine/loot_handler.dart';
|
||||
import 'package:asciineverdie/src/core/engine/progress_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/class_traits.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_event.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/pq_config.dart';
|
||||
import 'package:asciineverdie/src/core/util/pq_logic.dart' as pq_logic;
|
||||
|
||||
/// 킬 태스크(kill task) 완료 시 처리를 담당하는 핸들러.
|
||||
///
|
||||
/// HP 회복, 전리품(loot) 획득, 보스 처리 등을 수행한다.
|
||||
class KillTaskHandler {
|
||||
const KillTaskHandler({
|
||||
required this.config,
|
||||
required this.lootHandler,
|
||||
required this.completeActFn,
|
||||
});
|
||||
|
||||
final PqConfig config;
|
||||
final LootHandler lootHandler;
|
||||
|
||||
/// Act 완료 처리 콜백 (ProgressService.completeAct 위임)
|
||||
final ({GameState state, bool gameComplete}) Function(GameState)
|
||||
completeActFn;
|
||||
|
||||
/// 킬 태스크 완료 처리 (HP 회복, 전리품, 보스 처리)
|
||||
({
|
||||
GameState state,
|
||||
ProgressState progress,
|
||||
QueueState queue,
|
||||
ProgressTickResult? earlyReturn,
|
||||
})
|
||||
handle(GameState state, ProgressState progress, QueueState queue) {
|
||||
var nextState = state;
|
||||
|
||||
// 전투 후 HP 회복(heal)
|
||||
final combat = progress.currentCombat;
|
||||
if (combat != null && combat.isActive) {
|
||||
final remainingHp = combat.playerStats.hpCurrent;
|
||||
final maxHp = combat.playerStats.hpMax;
|
||||
final conBonus = nextState.stats.con ~/ 2;
|
||||
var healAmount = (maxHp * 0.5).round() + conBonus;
|
||||
|
||||
final klass = ClassData.findById(nextState.traits.classId);
|
||||
if (klass != null) {
|
||||
final postCombatHealRate = klass.getPassiveValue(
|
||||
ClassPassiveType.postCombatHeal,
|
||||
);
|
||||
if (postCombatHealRate > 0) {
|
||||
healAmount += (maxHp * postCombatHealRate).round();
|
||||
}
|
||||
}
|
||||
|
||||
final newHp = (remainingHp + healAmount).clamp(0, maxHp);
|
||||
nextState = nextState.copyWith(
|
||||
stats: nextState.stats.copyWith(hpCurrent: newHp),
|
||||
);
|
||||
}
|
||||
|
||||
// 전리품(loot) 획득
|
||||
final lootResult = lootHandler.winLoot(nextState);
|
||||
nextState = lootResult.state;
|
||||
|
||||
// 물약(potion) 드랍 로그 추가
|
||||
var combatForReset = progress.currentCombat;
|
||||
if (lootResult.droppedPotion != null && combatForReset != null) {
|
||||
final potionDropEvent = CombatEvent.potionDrop(
|
||||
timestamp: nextState.skillSystem.elapsedMs,
|
||||
potionName: lootResult.droppedPotion!.name,
|
||||
isHp: lootResult.droppedPotion!.isHpPotion,
|
||||
);
|
||||
final updatedEvents = [...combatForReset.recentEvents, potionDropEvent];
|
||||
combatForReset = combatForReset.copyWith(
|
||||
recentEvents: updatedEvents.length > 10
|
||||
? updatedEvents.sublist(updatedEvents.length - 10)
|
||||
: updatedEvents,
|
||||
);
|
||||
progress = progress.copyWith(currentCombat: combatForReset);
|
||||
}
|
||||
|
||||
// 보스(Boss) 승리 처리
|
||||
if (progress.pendingActCompletion) {
|
||||
final cinematicEntries = pq_logic.interplotCinematic(
|
||||
config,
|
||||
nextState.rng,
|
||||
nextState.traits.level,
|
||||
progress.plotStageCount,
|
||||
);
|
||||
queue = QueueState(entries: [...queue.entries, ...cinematicEntries]);
|
||||
progress = progress.copyWith(
|
||||
currentCombat: null,
|
||||
monstersKilled: progress.monstersKilled + 1,
|
||||
pendingActCompletion: false,
|
||||
);
|
||||
} else {
|
||||
progress = progress.copyWith(
|
||||
currentCombat: null,
|
||||
monstersKilled: progress.monstersKilled + 1,
|
||||
);
|
||||
}
|
||||
|
||||
nextState = nextState.copyWith(progress: progress, queue: queue);
|
||||
|
||||
// 최종 보스(final boss) 처치 체크
|
||||
if (progress.finalBossState == FinalBossState.fighting) {
|
||||
progress = progress.copyWith(finalBossState: FinalBossState.defeated);
|
||||
nextState = nextState.copyWith(progress: progress);
|
||||
final actResult = completeActFn(nextState);
|
||||
return (
|
||||
state: actResult.state,
|
||||
progress: actResult.state.progress,
|
||||
queue: actResult.state.queue,
|
||||
earlyReturn: ProgressTickResult(
|
||||
state: actResult.state,
|
||||
completedAct: true,
|
||||
gameComplete: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
state: nextState,
|
||||
progress: progress,
|
||||
queue: queue,
|
||||
earlyReturn: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
80
lib/src/core/engine/loot_handler.dart
Normal file
80
lib/src/core/engine/loot_handler.dart
Normal file
@@ -0,0 +1,80 @@
|
||||
import 'package:asciineverdie/src/core/engine/game_mutations.dart';
|
||||
import 'package:asciineverdie/src/core/engine/potion_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_grade.dart';
|
||||
import 'package:asciineverdie/src/core/model/potion.dart';
|
||||
|
||||
/// 전리품 처리 서비스
|
||||
///
|
||||
/// ProgressService에서 분리된 전리품 획득 로직 담당:
|
||||
/// - 몬스터 부위 아이템 인벤토리 추가
|
||||
/// - 특수 아이템 획득 (WinItem)
|
||||
/// - 물약 드랍
|
||||
class LootHandler {
|
||||
const LootHandler({required this.mutations});
|
||||
|
||||
final GameMutations mutations;
|
||||
|
||||
/// 킬 태스크 완료 시 전리품 획득 (원본 Main.pas:625-630)
|
||||
({GameState state, Potion? droppedPotion}) winLoot(GameState state) {
|
||||
final taskInfo = state.progress.currentTask;
|
||||
final monsterPart = taskInfo.monsterPart ?? '';
|
||||
final monsterBaseName = taskInfo.monsterBaseName ?? '';
|
||||
|
||||
var resultState = state;
|
||||
|
||||
// 부위가 '*'이면 WinItem 호출 (특수 아이템)
|
||||
if (monsterPart == '*') {
|
||||
resultState = mutations.winItem(resultState);
|
||||
} else if (monsterPart.isNotEmpty && monsterBaseName.isNotEmpty) {
|
||||
// 원본: Add(Inventory, LowerCase(Split(fTask.Caption,1) + ' ' +
|
||||
// ProperCase(Split(fTask.Caption,3))), 1);
|
||||
// 예: "goblin Claw" 형태로 인벤토리 추가
|
||||
final itemName =
|
||||
'${monsterBaseName.toLowerCase()} ${_properCase(monsterPart)}';
|
||||
|
||||
// 인벤토리에 추가
|
||||
final items = [...resultState.inventory.items];
|
||||
final existing = items.indexWhere((e) => e.name == itemName);
|
||||
if (existing >= 0) {
|
||||
items[existing] = items[existing].copyWith(
|
||||
count: items[existing].count + 1,
|
||||
);
|
||||
} else {
|
||||
items.add(InventoryEntry(name: itemName, count: 1));
|
||||
}
|
||||
|
||||
resultState = resultState.copyWith(
|
||||
inventory: resultState.inventory.copyWith(items: items),
|
||||
);
|
||||
}
|
||||
|
||||
// 물약 드랍 시도
|
||||
final potionService = const PotionService();
|
||||
final rng = resultState.rng;
|
||||
final monsterLevel = taskInfo.monsterLevel ?? resultState.traits.level;
|
||||
final monsterGrade = taskInfo.monsterGrade ?? MonsterGrade.normal;
|
||||
final (updatedPotionInventory, droppedPotion) = potionService.tryPotionDrop(
|
||||
playerLevel: resultState.traits.level,
|
||||
monsterLevel: monsterLevel,
|
||||
monsterGrade: monsterGrade,
|
||||
inventory: resultState.potionInventory,
|
||||
roll: rng.nextInt(100),
|
||||
typeRoll: rng.nextInt(100),
|
||||
);
|
||||
|
||||
return (
|
||||
state: resultState.copyWith(
|
||||
rng: rng,
|
||||
potionInventory: updatedPotionInventory,
|
||||
),
|
||||
droppedPotion: droppedPotion,
|
||||
);
|
||||
}
|
||||
|
||||
/// 첫 글자만 대문자로 변환 (원본 ProperCase)
|
||||
String _properCase(String s) {
|
||||
if (s.isEmpty) return s;
|
||||
return s[0].toUpperCase() + s.substring(1);
|
||||
}
|
||||
}
|
||||
163
lib/src/core/engine/market_service.dart
Normal file
163
lib/src/core/engine/market_service.dart
Normal file
@@ -0,0 +1,163 @@
|
||||
import 'package:asciineverdie/data/game_text_l10n.dart' as l10n;
|
||||
import 'package:asciineverdie/src/core/engine/potion_service.dart';
|
||||
import 'package:asciineverdie/src/core/engine/shop_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/equipment_slot.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/item_stats.dart';
|
||||
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||
import 'package:asciineverdie/src/core/util/pq_logic.dart' as pq_logic;
|
||||
|
||||
/// 판매 처리 결과
|
||||
class SellResult {
|
||||
const SellResult({required this.state, required this.continuesSelling});
|
||||
|
||||
final GameState state;
|
||||
final bool continuesSelling;
|
||||
}
|
||||
|
||||
/// 시장/판매/구매 서비스
|
||||
///
|
||||
/// ProgressService에서 분리된 시장 로직 담당:
|
||||
/// - 장비 구매
|
||||
/// - 아이템 판매
|
||||
/// - 골드 관리
|
||||
class MarketService {
|
||||
const MarketService({required this.rng});
|
||||
|
||||
final DeterministicRandom rng;
|
||||
|
||||
/// 인벤토리에서 Gold 수량 반환
|
||||
int getGold(GameState state) {
|
||||
return state.inventory.gold;
|
||||
}
|
||||
|
||||
/// 장비 구매 완료 처리 (개선된 로직)
|
||||
///
|
||||
/// 1순위: 빈 슬롯에 Common 장비 최대한 채우기
|
||||
/// 2순위: 골드 남으면 물약 구매
|
||||
GameState completeBuying(GameState state) {
|
||||
var nextState = state;
|
||||
final level = state.traits.level;
|
||||
final shopService = ShopService(rng: rng);
|
||||
|
||||
// 1. 빈 슬롯 목록 수집
|
||||
final emptySlots = <int>[];
|
||||
for (var i = 0; i < Equipment.slotCount; i++) {
|
||||
if (nextState.equipment.getItemByIndex(i).isEmpty) {
|
||||
emptySlots.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 골드가 허용하는 한 빈 슬롯에 Common 장비 구매
|
||||
for (final slotIndex in emptySlots) {
|
||||
final slot = EquipmentSlot.values[slotIndex];
|
||||
final item = shopService.generateShopItem(
|
||||
playerLevel: level,
|
||||
slot: slot,
|
||||
targetRarity: ItemRarity.common,
|
||||
);
|
||||
final price = shopService.calculateBuyPrice(item, cha: state.stats.cha);
|
||||
|
||||
if (nextState.inventory.gold >= price) {
|
||||
nextState = nextState.copyWith(
|
||||
inventory: nextState.inventory.copyWith(
|
||||
gold: nextState.inventory.gold - price,
|
||||
),
|
||||
equipment: nextState.equipment
|
||||
.setItemByIndex(slotIndex, item)
|
||||
.copyWith(bestIndex: slotIndex),
|
||||
);
|
||||
} else {
|
||||
break; // 골드 부족 시 중단
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 물약 자동 구매 (남은 골드의 20% 사용)
|
||||
final potionService = const PotionService();
|
||||
final purchaseResult = potionService.autoPurchasePotions(
|
||||
playerLevel: level,
|
||||
inventory: nextState.potionInventory,
|
||||
gold: nextState.inventory.gold,
|
||||
spendRatio: 0.20,
|
||||
);
|
||||
|
||||
if (purchaseResult.success && purchaseResult.newInventory != null) {
|
||||
nextState = nextState.copyWith(
|
||||
inventory: nextState.inventory.copyWith(gold: purchaseResult.newGold),
|
||||
potionInventory: purchaseResult.newInventory,
|
||||
);
|
||||
}
|
||||
|
||||
return nextState;
|
||||
}
|
||||
|
||||
/// 판매 처리
|
||||
///
|
||||
/// [state] 현재 게임 상태
|
||||
/// Returns: 업데이트된 상태와 판매 계속 여부
|
||||
SellResult processSell(GameState state) {
|
||||
final taskType = state.progress.currentTask.type;
|
||||
var items = [...state.inventory.items];
|
||||
var goldAmount = state.inventory.gold;
|
||||
|
||||
// sell 태스크 완료 시 아이템 판매 (원본 Main.pas:636-643)
|
||||
if (taskType == TaskType.sell) {
|
||||
// 첫 번째 아이템 찾기 (items에는 Gold가 없음)
|
||||
if (items.isNotEmpty) {
|
||||
final item = items.first;
|
||||
final level = state.traits.level;
|
||||
|
||||
// 가격 계산: 수량 * 레벨
|
||||
var price = item.count * level;
|
||||
|
||||
// " of " 포함 시 보너스 (원본 639-640)
|
||||
if (item.name.contains(' of ')) {
|
||||
price =
|
||||
price *
|
||||
(1 + pq_logic.randomLow(rng, 10)) *
|
||||
(1 + pq_logic.randomLow(rng, level));
|
||||
}
|
||||
|
||||
// 아이템 삭제
|
||||
items.removeAt(0);
|
||||
|
||||
// Gold 추가 (inventory.gold 필드 사용)
|
||||
goldAmount += price;
|
||||
}
|
||||
}
|
||||
|
||||
// 판매할 아이템이 남아있는지 확인
|
||||
final hasItemsToSell = items.isNotEmpty;
|
||||
|
||||
if (hasItemsToSell) {
|
||||
// 다음 아이템 판매 태스크 시작
|
||||
final nextItem = items.first;
|
||||
final translatedName = l10n.translateItemNameL10n(nextItem.name);
|
||||
final itemDesc = l10n.indefiniteL10n(translatedName, nextItem.count);
|
||||
final taskResult = pq_logic.startTask(
|
||||
state.progress,
|
||||
l10n.taskSelling(itemDesc),
|
||||
1 * 1000,
|
||||
);
|
||||
final progress = taskResult.progress.copyWith(
|
||||
currentTask: TaskInfo(caption: taskResult.caption, type: TaskType.sell),
|
||||
currentCombat: null, // 비전투 태스크이므로 전투 상태 초기화
|
||||
);
|
||||
return SellResult(
|
||||
state: state.copyWith(
|
||||
inventory: state.inventory.copyWith(gold: goldAmount, items: items),
|
||||
progress: progress,
|
||||
),
|
||||
continuesSelling: true,
|
||||
);
|
||||
}
|
||||
|
||||
// 판매 완료 - 인벤토리 업데이트만 하고 다음 태스크로
|
||||
return SellResult(
|
||||
state: state.copyWith(
|
||||
inventory: state.inventory.copyWith(gold: goldAmount, items: items),
|
||||
),
|
||||
continuesSelling: false,
|
||||
);
|
||||
}
|
||||
}
|
||||
411
lib/src/core/engine/player_attack_processor.dart
Normal file
411
lib/src/core/engine/player_attack_processor.dart
Normal file
@@ -0,0 +1,411 @@
|
||||
import 'package:asciineverdie/data/skill_data.dart';
|
||||
import 'package:asciineverdie/src/core/engine/combat_calculator.dart';
|
||||
import 'package:asciineverdie/src/core/engine/skill_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_event.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/skill.dart';
|
||||
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||
|
||||
/// 플레이어 공격 처리 결과
|
||||
typedef PlayerAttackResult = ({
|
||||
CombatStats playerStats,
|
||||
MonsterCombatStats monsterStats,
|
||||
SkillSystemState skillSystem,
|
||||
List<DotEffect> activeDoTs,
|
||||
List<ActiveBuff> activeDebuffs,
|
||||
int totalDamageDealt,
|
||||
List<CombatEvent> events,
|
||||
bool isFirstPlayerAttack,
|
||||
});
|
||||
|
||||
/// 플레이어 공격 처리 서비스
|
||||
///
|
||||
/// CombatTickService에서 분리된 플레이어 공격 로직 담당:
|
||||
/// - 스킬 자동 선택 및 사용
|
||||
/// - 일반 공격 처리
|
||||
/// - 첫 공격 보너스
|
||||
/// - 연속 공격 (Multi-attack)
|
||||
class PlayerAttackProcessor {
|
||||
PlayerAttackProcessor({required this.rng});
|
||||
|
||||
final DeterministicRandom rng;
|
||||
|
||||
/// 플레이어 공격 처리
|
||||
PlayerAttackResult processAttack({
|
||||
required GameState state,
|
||||
required CombatStats playerStats,
|
||||
required MonsterCombatStats monsterStats,
|
||||
required SkillSystemState updatedSkillSystem,
|
||||
required List<DotEffect> activeDoTs,
|
||||
required List<ActiveBuff> activeDebuffs,
|
||||
required int totalDamageDealt,
|
||||
required int timestamp,
|
||||
required CombatCalculator calculator,
|
||||
required SkillService skillService,
|
||||
required bool isFirstPlayerAttack,
|
||||
required double firstStrikeBonus,
|
||||
required bool hasMultiAttack,
|
||||
double healingMultiplier = 1.0,
|
||||
}) {
|
||||
final events = <CombatEvent>[];
|
||||
var newPlayerStats = playerStats;
|
||||
var newMonsterStats = monsterStats;
|
||||
var newSkillSystem = updatedSkillSystem;
|
||||
var newActiveDoTs = [...activeDoTs];
|
||||
var newActiveBuffs = [...activeDebuffs];
|
||||
var newTotalDamageDealt = totalDamageDealt;
|
||||
|
||||
// 장착된 스킬 슬롯에서 사용 가능한 스킬 ID 목록 조회
|
||||
var availableSkillIds = state.skillSystem.equippedSkills.allSkills
|
||||
.map((s) => s.id)
|
||||
.toList();
|
||||
// 장착된 스킬이 없으면 기본 스킬 사용
|
||||
if (availableSkillIds.isEmpty) {
|
||||
availableSkillIds = SkillData.defaultSkillIds;
|
||||
}
|
||||
|
||||
final selectedSkill = skillService.selectAutoSkill(
|
||||
player: newPlayerStats,
|
||||
monster: newMonsterStats,
|
||||
skillSystem: newSkillSystem,
|
||||
availableSkillIds: availableSkillIds,
|
||||
activeDoTs: newActiveDoTs,
|
||||
activeDebuffs: newActiveBuffs,
|
||||
);
|
||||
|
||||
if (selectedSkill != null && selectedSkill.isAttack) {
|
||||
final result = _useAttackSkill(
|
||||
state: state,
|
||||
skill: selectedSkill,
|
||||
playerStats: newPlayerStats,
|
||||
monsterStats: newMonsterStats,
|
||||
skillSystem: newSkillSystem,
|
||||
skillService: skillService,
|
||||
timestamp: timestamp,
|
||||
);
|
||||
newPlayerStats = result.playerStats;
|
||||
newMonsterStats = result.monsterStats;
|
||||
newTotalDamageDealt += result.damage;
|
||||
newSkillSystem = result.skillSystem;
|
||||
events.add(result.event);
|
||||
} else if (selectedSkill != null && selectedSkill.isDot) {
|
||||
final result = _useDotSkill(
|
||||
state: state,
|
||||
skill: selectedSkill,
|
||||
playerStats: newPlayerStats,
|
||||
skillSystem: newSkillSystem,
|
||||
skillService: skillService,
|
||||
monsterName: newMonsterStats.name,
|
||||
timestamp: timestamp,
|
||||
);
|
||||
newPlayerStats = result.playerStats;
|
||||
newSkillSystem = result.skillSystem;
|
||||
if (result.dotEffect != null) newActiveDoTs.add(result.dotEffect!);
|
||||
events.add(result.event);
|
||||
} else if (selectedSkill != null && selectedSkill.isHeal) {
|
||||
final result = _useHealSkill(
|
||||
skill: selectedSkill,
|
||||
playerStats: newPlayerStats,
|
||||
skillSystem: newSkillSystem,
|
||||
skillService: skillService,
|
||||
healingMultiplier: healingMultiplier,
|
||||
timestamp: timestamp,
|
||||
);
|
||||
newPlayerStats = result.playerStats;
|
||||
newSkillSystem = result.skillSystem;
|
||||
events.add(result.event);
|
||||
} else if (selectedSkill != null && selectedSkill.isBuff) {
|
||||
final result = skillService.useBuffSkill(
|
||||
skill: selectedSkill,
|
||||
player: newPlayerStats,
|
||||
skillSystem: newSkillSystem,
|
||||
);
|
||||
newPlayerStats = result.updatedPlayer;
|
||||
newSkillSystem = result.updatedSkillSystem.startGlobalCooldown();
|
||||
events.add(
|
||||
CombatEvent.playerBuff(
|
||||
timestamp: timestamp,
|
||||
skillName: selectedSkill.name,
|
||||
),
|
||||
);
|
||||
} else if (selectedSkill != null && selectedSkill.isDebuff) {
|
||||
final result = _useDebuffSkill(
|
||||
skill: selectedSkill,
|
||||
playerStats: newPlayerStats,
|
||||
skillSystem: newSkillSystem,
|
||||
skillService: skillService,
|
||||
activeDebuffs: newActiveBuffs,
|
||||
monsterName: newMonsterStats.name,
|
||||
timestamp: timestamp,
|
||||
);
|
||||
newPlayerStats = result.playerStats;
|
||||
newSkillSystem = result.skillSystem;
|
||||
newActiveBuffs = result.activeDebuffs;
|
||||
events.add(result.event);
|
||||
} else {
|
||||
// 일반 공격
|
||||
final result = _processNormalAttack(
|
||||
playerStats: newPlayerStats,
|
||||
monsterStats: newMonsterStats,
|
||||
calculator: calculator,
|
||||
isFirstPlayerAttack: isFirstPlayerAttack,
|
||||
firstStrikeBonus: firstStrikeBonus,
|
||||
hasMultiAttack: hasMultiAttack,
|
||||
timestamp: timestamp,
|
||||
);
|
||||
newMonsterStats = result.monsterStats;
|
||||
newTotalDamageDealt += result.totalDamage;
|
||||
events.addAll(result.events);
|
||||
}
|
||||
|
||||
return (
|
||||
playerStats: newPlayerStats,
|
||||
monsterStats: newMonsterStats,
|
||||
skillSystem: newSkillSystem,
|
||||
activeDoTs: newActiveDoTs,
|
||||
activeDebuffs: newActiveBuffs,
|
||||
totalDamageDealt: newTotalDamageDealt,
|
||||
events: events,
|
||||
isFirstPlayerAttack: false,
|
||||
);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 스킬 사용 헬퍼
|
||||
// ============================================================================
|
||||
|
||||
({
|
||||
CombatStats playerStats,
|
||||
MonsterCombatStats monsterStats,
|
||||
int damage,
|
||||
SkillSystemState skillSystem,
|
||||
CombatEvent event,
|
||||
})
|
||||
_useAttackSkill({
|
||||
required GameState state,
|
||||
required Skill skill,
|
||||
required CombatStats playerStats,
|
||||
required MonsterCombatStats monsterStats,
|
||||
required SkillSystemState skillSystem,
|
||||
required SkillService skillService,
|
||||
required int timestamp,
|
||||
}) {
|
||||
final skillRank = skillService.getSkillRankFromSkillBook(
|
||||
state.skillBook,
|
||||
skill.id,
|
||||
);
|
||||
final skillResult = skillService.useAttackSkillWithRank(
|
||||
skill: skill,
|
||||
player: playerStats,
|
||||
monster: monsterStats,
|
||||
skillSystem: skillSystem,
|
||||
rank: skillRank,
|
||||
);
|
||||
return (
|
||||
playerStats: skillResult.updatedPlayer,
|
||||
monsterStats: skillResult.updatedMonster,
|
||||
damage: skillResult.result.damage,
|
||||
skillSystem: skillResult.updatedSkillSystem.startGlobalCooldown(),
|
||||
event: CombatEvent.playerSkill(
|
||||
timestamp: timestamp,
|
||||
skillName: skill.name,
|
||||
damage: skillResult.result.damage,
|
||||
targetName: monsterStats.name,
|
||||
attackDelayMs: playerStats.attackDelayMs,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
({
|
||||
CombatStats playerStats,
|
||||
SkillSystemState skillSystem,
|
||||
DotEffect? dotEffect,
|
||||
CombatEvent event,
|
||||
})
|
||||
_useDotSkill({
|
||||
required GameState state,
|
||||
required Skill skill,
|
||||
required CombatStats playerStats,
|
||||
required SkillSystemState skillSystem,
|
||||
required SkillService skillService,
|
||||
required String monsterName,
|
||||
required int timestamp,
|
||||
}) {
|
||||
final skillResult = skillService.useDotSkill(
|
||||
skill: skill,
|
||||
player: playerStats,
|
||||
skillSystem: skillSystem,
|
||||
playerInt: state.stats.intelligence,
|
||||
playerWis: state.stats.wis,
|
||||
);
|
||||
return (
|
||||
playerStats: skillResult.updatedPlayer,
|
||||
skillSystem: skillResult.updatedSkillSystem.startGlobalCooldown(),
|
||||
dotEffect: skillResult.dotEffect,
|
||||
event: CombatEvent.playerSkill(
|
||||
timestamp: timestamp,
|
||||
skillName: skill.name,
|
||||
damage: skillResult.result.damage,
|
||||
targetName: monsterName,
|
||||
attackDelayMs: playerStats.attackDelayMs,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
({CombatStats playerStats, SkillSystemState skillSystem, CombatEvent event})
|
||||
_useHealSkill({
|
||||
required Skill skill,
|
||||
required CombatStats playerStats,
|
||||
required SkillSystemState skillSystem,
|
||||
required SkillService skillService,
|
||||
required double healingMultiplier,
|
||||
required int timestamp,
|
||||
}) {
|
||||
final skillResult = skillService.useHealSkill(
|
||||
skill: skill,
|
||||
player: playerStats,
|
||||
skillSystem: skillSystem,
|
||||
healingMultiplier: healingMultiplier,
|
||||
);
|
||||
return (
|
||||
playerStats: skillResult.updatedPlayer,
|
||||
skillSystem: skillResult.updatedSkillSystem.startGlobalCooldown(),
|
||||
event: CombatEvent.playerHeal(
|
||||
timestamp: timestamp,
|
||||
healAmount: skillResult.result.healedAmount,
|
||||
skillName: skill.name,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
({
|
||||
CombatStats playerStats,
|
||||
SkillSystemState skillSystem,
|
||||
List<ActiveBuff> activeDebuffs,
|
||||
CombatEvent event,
|
||||
})
|
||||
_useDebuffSkill({
|
||||
required Skill skill,
|
||||
required CombatStats playerStats,
|
||||
required SkillSystemState skillSystem,
|
||||
required SkillService skillService,
|
||||
required List<ActiveBuff> activeDebuffs,
|
||||
required String monsterName,
|
||||
required int timestamp,
|
||||
}) {
|
||||
final skillResult = skillService.useDebuffSkill(
|
||||
skill: skill,
|
||||
player: playerStats,
|
||||
skillSystem: skillSystem,
|
||||
currentDebuffs: activeDebuffs,
|
||||
);
|
||||
var newDebuffs = activeDebuffs;
|
||||
if (skillResult.debuffEffect != null) {
|
||||
newDebuffs =
|
||||
activeDebuffs
|
||||
.where((d) => d.effect.id != skillResult.debuffEffect!.effect.id)
|
||||
.toList()
|
||||
..add(skillResult.debuffEffect!);
|
||||
}
|
||||
return (
|
||||
playerStats: skillResult.updatedPlayer,
|
||||
skillSystem: skillResult.updatedSkillSystem.startGlobalCooldown(),
|
||||
activeDebuffs: newDebuffs,
|
||||
event: CombatEvent.playerDebuff(
|
||||
timestamp: timestamp,
|
||||
skillName: skill.name,
|
||||
targetName: monsterName,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 일반 공격
|
||||
// ============================================================================
|
||||
|
||||
({MonsterCombatStats monsterStats, int totalDamage, List<CombatEvent> events})
|
||||
_processNormalAttack({
|
||||
required CombatStats playerStats,
|
||||
required MonsterCombatStats monsterStats,
|
||||
required CombatCalculator calculator,
|
||||
required bool isFirstPlayerAttack,
|
||||
required double firstStrikeBonus,
|
||||
required bool hasMultiAttack,
|
||||
required int timestamp,
|
||||
}) {
|
||||
final events = <CombatEvent>[];
|
||||
var newMonsterStats = monsterStats;
|
||||
var totalDamage = 0;
|
||||
|
||||
final attackResult = calculator.playerAttackMonster(
|
||||
attacker: playerStats,
|
||||
defender: newMonsterStats,
|
||||
);
|
||||
newMonsterStats = attackResult.updatedDefender;
|
||||
|
||||
// 첫 공격 배율 적용
|
||||
var damage = attackResult.result.damage;
|
||||
if (isFirstPlayerAttack && firstStrikeBonus > 1.0) {
|
||||
damage = (damage * firstStrikeBonus).round();
|
||||
final extraDamage = damage - attackResult.result.damage;
|
||||
if (extraDamage > 0) {
|
||||
final newHp = (newMonsterStats.hpCurrent - extraDamage).clamp(
|
||||
0,
|
||||
newMonsterStats.hpMax,
|
||||
);
|
||||
newMonsterStats = newMonsterStats.copyWith(hpCurrent: newHp);
|
||||
}
|
||||
}
|
||||
totalDamage += damage;
|
||||
|
||||
final result = attackResult.result;
|
||||
if (result.isEvaded) {
|
||||
events.add(
|
||||
CombatEvent.monsterEvade(
|
||||
timestamp: timestamp,
|
||||
targetName: newMonsterStats.name,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
events.add(
|
||||
CombatEvent.playerAttack(
|
||||
timestamp: timestamp,
|
||||
damage: damage,
|
||||
targetName: newMonsterStats.name,
|
||||
isCritical: result.isCritical,
|
||||
attackDelayMs: playerStats.attackDelayMs,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 연속 공격 (Refactor Monk 패시브) - 30% 확률로 추가 공격
|
||||
if (hasMultiAttack && newMonsterStats.isAlive && rng.nextDouble() < 0.3) {
|
||||
final extraAttack = calculator.playerAttackMonster(
|
||||
attacker: playerStats,
|
||||
defender: newMonsterStats,
|
||||
);
|
||||
newMonsterStats = extraAttack.updatedDefender;
|
||||
totalDamage += extraAttack.result.damage;
|
||||
|
||||
if (!extraAttack.result.isEvaded) {
|
||||
events.add(
|
||||
CombatEvent.playerAttack(
|
||||
timestamp: timestamp,
|
||||
damage: extraAttack.result.damage,
|
||||
targetName: newMonsterStats.name,
|
||||
isCritical: extraAttack.result.isCritical,
|
||||
attackDelayMs: playerStats.attackDelayMs,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
monsterStats: newMonsterStats,
|
||||
totalDamage: totalDamage,
|
||||
events: events,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,8 @@ import 'package:asciineverdie/src/core/model/potion.dart';
|
||||
class PotionService {
|
||||
const PotionService();
|
||||
|
||||
/// 긴급 물약 사용 HP 임계치 (30%)
|
||||
static const double emergencyHpThreshold = 0.30;
|
||||
|
||||
/// 긴급 물약 사용 MP 임계치 (20%)
|
||||
static const double emergencyMpThreshold = 0.20;
|
||||
/// 글로벌 물약 쿨타임 (1배속 기준 3초)
|
||||
static const int globalPotionCooldownMs = 3000;
|
||||
|
||||
// ============================================================================
|
||||
// 물약 사용 가능 여부
|
||||
@@ -40,11 +37,6 @@ class PotionService {
|
||||
return (false, PotionUseFailReason.outOfStock);
|
||||
}
|
||||
|
||||
// 전투당 종류별 1회 제한 체크
|
||||
if (!inventory.canUseType(potion.type)) {
|
||||
return (false, PotionUseFailReason.alreadyUsedThisBattle);
|
||||
}
|
||||
|
||||
return (true, null);
|
||||
}
|
||||
|
||||
@@ -60,6 +52,7 @@ class PotionService {
|
||||
/// [maxHp] 최대 HP
|
||||
/// [currentMp] 현재 MP
|
||||
/// [maxMp] 최대 MP
|
||||
/// [healingMultiplier] 회복력 배율 (기본 1.0, 클래스 패시브 적용)
|
||||
PotionUseResult usePotion({
|
||||
required String potionId,
|
||||
required PotionInventory inventory,
|
||||
@@ -67,6 +60,7 @@ class PotionService {
|
||||
required int maxHp,
|
||||
required int currentMp,
|
||||
required int maxMp,
|
||||
double healingMultiplier = 1.0,
|
||||
}) {
|
||||
final (canUse, failReason) = canUsePotion(potionId, inventory);
|
||||
if (!canUse) {
|
||||
@@ -79,16 +73,20 @@ class PotionService {
|
||||
int newMp = currentMp;
|
||||
|
||||
if (potion.isHpPotion) {
|
||||
healedAmount = potion.calculateHeal(maxHp);
|
||||
// 회복력 보너스 적용 (예: Debugger Paladin +10%)
|
||||
final baseHeal = potion.calculateHeal(maxHp);
|
||||
healedAmount = (baseHeal * healingMultiplier).round();
|
||||
newHp = (currentHp + healedAmount).clamp(0, maxHp);
|
||||
healedAmount = newHp - currentHp; // 실제 회복량
|
||||
} else if (potion.isMpPotion) {
|
||||
healedAmount = potion.calculateHeal(maxMp);
|
||||
// MP 물약에도 회복력 보너스 적용
|
||||
final baseHeal = potion.calculateHeal(maxMp);
|
||||
healedAmount = (baseHeal * healingMultiplier).round();
|
||||
newMp = (currentMp + healedAmount).clamp(0, maxMp);
|
||||
healedAmount = newMp - currentMp; // 실제 회복량
|
||||
}
|
||||
|
||||
final newInventory = inventory.usePotion(potionId, potion.type);
|
||||
final newInventory = inventory.usePotion(potionId);
|
||||
|
||||
return PotionUseResult(
|
||||
success: true,
|
||||
@@ -106,7 +104,7 @@ class PotionService {
|
||||
|
||||
/// 긴급 HP 물약 선택
|
||||
///
|
||||
/// HP가 임계치 이하일 때 사용할 최적의 물약 선택
|
||||
/// 소모된 HP >= 물약 회복량이면 사용할 최적의 물약 선택
|
||||
/// [currentHp] 현재 HP
|
||||
/// [maxHp] 최대 HP
|
||||
/// [inventory] 물약 인벤토리
|
||||
@@ -117,12 +115,8 @@ class PotionService {
|
||||
required PotionInventory inventory,
|
||||
required int playerLevel,
|
||||
}) {
|
||||
// 임계치 체크
|
||||
final hpRatio = currentHp / maxHp;
|
||||
if (hpRatio > emergencyHpThreshold) return null;
|
||||
|
||||
// 전투 중 이미 HP 물약 사용했으면 불가
|
||||
if (!inventory.canUseType(PotionType.hp)) return null;
|
||||
final hpLost = maxHp - currentHp;
|
||||
if (hpLost <= 0) return null;
|
||||
|
||||
// 적정 티어 계산
|
||||
final targetTier = PotionData.tierForLevel(playerLevel);
|
||||
@@ -131,7 +125,10 @@ class PotionService {
|
||||
for (var tier = targetTier; tier >= 1; tier--) {
|
||||
final potion = PotionData.getHpPotionByTier(tier);
|
||||
if (potion != null && inventory.hasPotion(potion.id)) {
|
||||
return potion;
|
||||
final healAmount = potion.calculateHeal(maxHp);
|
||||
if (hpLost >= healAmount) {
|
||||
return potion;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +136,10 @@ class PotionService {
|
||||
for (var tier = targetTier + 1; tier <= 5; tier++) {
|
||||
final potion = PotionData.getHpPotionByTier(tier);
|
||||
if (potion != null && inventory.hasPotion(potion.id)) {
|
||||
return potion;
|
||||
final healAmount = potion.calculateHeal(maxHp);
|
||||
if (hpLost >= healAmount) {
|
||||
return potion;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,19 +148,15 @@ class PotionService {
|
||||
|
||||
/// 긴급 MP 물약 선택
|
||||
///
|
||||
/// MP가 임계치 이하일 때 사용할 최적의 물약 선택
|
||||
/// 소모된 MP >= 물약 회복량이면 사용할 최적의 물약 선택
|
||||
Potion? selectEmergencyMpPotion({
|
||||
required int currentMp,
|
||||
required int maxMp,
|
||||
required PotionInventory inventory,
|
||||
required int playerLevel,
|
||||
}) {
|
||||
// 임계치 체크
|
||||
final mpRatio = currentMp / maxMp;
|
||||
if (mpRatio > emergencyMpThreshold) return null;
|
||||
|
||||
// 전투 중 이미 MP 물약 사용했으면 불가
|
||||
if (!inventory.canUseType(PotionType.mp)) return null;
|
||||
final mpLost = maxMp - currentMp;
|
||||
if (mpLost <= 0) return null;
|
||||
|
||||
// 적정 티어 계산
|
||||
final targetTier = PotionData.tierForLevel(playerLevel);
|
||||
@@ -169,7 +165,10 @@ class PotionService {
|
||||
for (var tier = targetTier; tier >= 1; tier--) {
|
||||
final potion = PotionData.getMpPotionByTier(tier);
|
||||
if (potion != null && inventory.hasPotion(potion.id)) {
|
||||
return potion;
|
||||
final healAmount = potion.calculateHeal(maxMp);
|
||||
if (mpLost >= healAmount) {
|
||||
return potion;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +176,10 @@ class PotionService {
|
||||
for (var tier = targetTier + 1; tier <= 5; tier++) {
|
||||
final potion = PotionData.getMpPotionByTier(tier);
|
||||
if (potion != null && inventory.hasPotion(potion.id)) {
|
||||
return potion;
|
||||
final healAmount = potion.calculateHeal(maxMp);
|
||||
if (mpLost >= healAmount) {
|
||||
return potion;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,11 +190,6 @@ class PotionService {
|
||||
// 인벤토리 관리
|
||||
// ============================================================================
|
||||
|
||||
/// 전투 종료 시 사용 기록 초기화
|
||||
PotionInventory resetBattleUsage(PotionInventory inventory) {
|
||||
return inventory.resetBattleUsage();
|
||||
}
|
||||
|
||||
/// 물약 드랍 추가
|
||||
PotionInventory addPotionDrop(
|
||||
PotionInventory inventory,
|
||||
@@ -375,8 +372,10 @@ class PotionService {
|
||||
required int typeRoll,
|
||||
}) {
|
||||
// 기본 드랍 확률 계산
|
||||
var dropChance = (baseDropChance + playerLevel * dropChancePerLevel)
|
||||
.clamp(baseDropChance, maxDropChance);
|
||||
var dropChance = (baseDropChance + playerLevel * dropChancePerLevel).clamp(
|
||||
baseDropChance,
|
||||
maxDropChance,
|
||||
);
|
||||
|
||||
// 몬스터 등급 보너스 (Elite +5%, Boss +15%)
|
||||
dropChance += monsterGrade.potionDropBonus;
|
||||
@@ -468,8 +467,8 @@ enum PotionUseFailReason {
|
||||
/// 보유 물약 없음 (재고 부족)
|
||||
outOfStock,
|
||||
|
||||
/// 이번 전투에서 이미 해당 종류 물약 사용
|
||||
alreadyUsedThisBattle,
|
||||
/// 글로벌 쿨타임 중
|
||||
onCooldown,
|
||||
}
|
||||
|
||||
/// 물약 구매 결과
|
||||
|
||||
@@ -89,6 +89,14 @@ class ProgressLoop {
|
||||
_speedMultiplier = _availableSpeeds[nextIndex];
|
||||
}
|
||||
|
||||
/// 특정 배속으로 직접 설정
|
||||
/// 가용 배속 목록에 있는 경우에만 설정
|
||||
void setSpeed(int speed) {
|
||||
if (_availableSpeeds.contains(speed)) {
|
||||
_speedMultiplier = speed;
|
||||
}
|
||||
}
|
||||
|
||||
/// 가용 배속 목록 업데이트 (명예의 전당 상태 변경 시)
|
||||
void updateAvailableSpeeds(List<int> speeds) {
|
||||
if (speeds.isEmpty) return;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
177
lib/src/core/engine/quest_completion_handler.dart
Normal file
177
lib/src/core/engine/quest_completion_handler.dart
Normal file
@@ -0,0 +1,177 @@
|
||||
import 'package:asciineverdie/src/core/engine/act_progression_service.dart';
|
||||
import 'package:asciineverdie/src/core/engine/reward_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/pq_config.dart';
|
||||
import 'package:asciineverdie/src/core/util/pq_logic.dart' as pq_logic;
|
||||
|
||||
/// 퀘스트(quest) 완료 및 플롯(plot) 진행을 담당하는 핸들러.
|
||||
class QuestCompletionHandler {
|
||||
const QuestCompletionHandler({
|
||||
required this.config,
|
||||
required this.rewards,
|
||||
required this.recalculateEncumbrance,
|
||||
});
|
||||
|
||||
final PqConfig config;
|
||||
final RewardService rewards;
|
||||
|
||||
/// 무게(encumbrance) 재계산 콜백
|
||||
final GameState Function(GameState) recalculateEncumbrance;
|
||||
|
||||
/// 퀘스트 진행 처리
|
||||
({GameState state, ProgressState progress, QueueState queue, bool completed})
|
||||
handleQuestProgress(
|
||||
GameState state,
|
||||
ProgressState progress,
|
||||
QueueState queue,
|
||||
bool gain,
|
||||
int incrementSeconds,
|
||||
) {
|
||||
var nextState = state;
|
||||
var questDone = false;
|
||||
|
||||
final canQuestProgress =
|
||||
gain &&
|
||||
progress.plotStageCount > 1 &&
|
||||
progress.questCount > 0 &&
|
||||
progress.quest.max > 0;
|
||||
|
||||
if (canQuestProgress) {
|
||||
if (progress.quest.position + incrementSeconds >= progress.quest.max) {
|
||||
nextState = completeQuest(nextState);
|
||||
questDone = true;
|
||||
progress = nextState.progress;
|
||||
queue = nextState.queue;
|
||||
} else {
|
||||
progress = progress.copyWith(
|
||||
quest: progress.quest.copyWith(
|
||||
position: progress.quest.position + incrementSeconds,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
state: nextState,
|
||||
progress: progress,
|
||||
queue: queue,
|
||||
completed: questDone,
|
||||
);
|
||||
}
|
||||
|
||||
/// 퀘스트 완료 처리 (보상 적용, 다음 퀘스트 생성)
|
||||
GameState completeQuest(GameState state) {
|
||||
final result = pq_logic.completeQuest(
|
||||
config,
|
||||
state.rng,
|
||||
state.traits.level,
|
||||
);
|
||||
|
||||
var nextState = _applyReward(state, result.reward);
|
||||
final questCount = nextState.progress.questCount + 1;
|
||||
|
||||
// 퀘스트 히스토리(history) 업데이트: 이전 퀘스트 완료 표시, 새 퀘스트 추가
|
||||
final updatedQuestHistory = [
|
||||
...nextState.progress.questHistory.map(
|
||||
(e) => e.isComplete ? e : e.copyWith(isComplete: true),
|
||||
),
|
||||
HistoryEntry(caption: result.caption, isComplete: false),
|
||||
];
|
||||
|
||||
// 퀘스트 몬스터 정보 저장 (Exterminate 타입용)
|
||||
final questMonster = result.monsterIndex != null
|
||||
? QuestMonsterInfo(
|
||||
monsterData: result.monsterName!,
|
||||
monsterIndex: result.monsterIndex!,
|
||||
)
|
||||
: null;
|
||||
|
||||
// 큐에 퀘스트 태스크 추가
|
||||
final updatedQueue = QueueState(
|
||||
entries: [
|
||||
...nextState.queue.entries,
|
||||
QueueEntry(
|
||||
kind: QueueKind.task,
|
||||
durationMillis: 50 + nextState.rng.nextInt(100),
|
||||
caption: result.caption,
|
||||
taskType: TaskType.neutral,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
// 퀘스트 진행 바(bar) 리셋
|
||||
final progress = nextState.progress.copyWith(
|
||||
quest: ProgressBarState(
|
||||
position: 0,
|
||||
max: 50 + nextState.rng.nextInt(100),
|
||||
),
|
||||
questCount: questCount,
|
||||
questHistory: updatedQuestHistory,
|
||||
currentQuestMonster: questMonster,
|
||||
);
|
||||
|
||||
return recalculateEncumbrance(
|
||||
nextState.copyWith(progress: progress, queue: updatedQueue),
|
||||
);
|
||||
}
|
||||
|
||||
/// 플롯 진행 및 Act 보스(Boss) 소환 처리
|
||||
ProgressState handlePlotProgress(
|
||||
GameState state,
|
||||
ProgressState progress,
|
||||
bool gain,
|
||||
int incrementSeconds,
|
||||
) {
|
||||
if (gain &&
|
||||
progress.plot.max > 0 &&
|
||||
progress.plot.position >= progress.plot.max &&
|
||||
!progress.pendingActCompletion) {
|
||||
final actProgressionService = ActProgressionService(config: config);
|
||||
final actBoss = actProgressionService.createActBoss(state);
|
||||
return progress.copyWith(
|
||||
plot: progress.plot.copyWith(position: 0),
|
||||
currentCombat: actBoss,
|
||||
pendingActCompletion: true,
|
||||
);
|
||||
} else if (progress.currentTask.type != TaskType.load &&
|
||||
progress.plot.max > 0 &&
|
||||
!progress.pendingActCompletion) {
|
||||
final uncappedPlot = progress.plot.position + incrementSeconds;
|
||||
final int newPlotPos = uncappedPlot > progress.plot.max
|
||||
? progress.plot.max
|
||||
: uncappedPlot;
|
||||
return progress.copyWith(
|
||||
plot: progress.plot.copyWith(position: newPlotPos),
|
||||
);
|
||||
}
|
||||
return progress;
|
||||
}
|
||||
|
||||
/// Act 완료 처리 (보상 적용 후 다음 Act로 진행)
|
||||
/// gameComplete=true이면 최종 보스 격파로 게임 종료.
|
||||
({GameState state, bool gameComplete}) completeAct(GameState state) {
|
||||
final actProgressionService = ActProgressionService(config: config);
|
||||
|
||||
// Act 보상 먼저 적용
|
||||
final actRewards = actProgressionService.getActRewards(
|
||||
state.progress.plotStageCount,
|
||||
);
|
||||
var nextState = state;
|
||||
for (final reward in actRewards) {
|
||||
nextState = _applyReward(nextState, reward);
|
||||
}
|
||||
|
||||
// Act 완료 처리 (ActProgressionService 위임)
|
||||
final result = actProgressionService.completeAct(nextState);
|
||||
|
||||
return (
|
||||
state: recalculateEncumbrance(result.state),
|
||||
gameComplete: result.gameComplete,
|
||||
);
|
||||
}
|
||||
|
||||
GameState _applyReward(GameState state, pq_logic.RewardKind reward) {
|
||||
final updated = rewards.applyReward(state, reward);
|
||||
return recalculateEncumbrance(updated);
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,7 @@ class ResurrectionService {
|
||||
}
|
||||
|
||||
String? lostItemName;
|
||||
EquipmentSlot? lostItemSlot;
|
||||
var newEquipment = state.equipment;
|
||||
|
||||
if (equippedItems.isNotEmpty) {
|
||||
@@ -55,12 +56,12 @@ class ResurrectionService {
|
||||
final slotIndex = equippedItems[random.nextInt(equippedItems.length)];
|
||||
final lostItem = state.equipment.getItemByIndex(slotIndex);
|
||||
lostItemName = lostItem.name;
|
||||
lostItemSlot = EquipmentSlot.values[slotIndex];
|
||||
|
||||
// 해당 슬롯만 빈 아이템으로 교체
|
||||
final slot = EquipmentSlot.values[slotIndex];
|
||||
newEquipment = state.equipment.setItemByIndex(
|
||||
slotIndex,
|
||||
EquipmentItem.empty(slot),
|
||||
EquipmentItem.empty(lostItemSlot),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -70,13 +71,14 @@ class ResurrectionService {
|
||||
killerName: killerName,
|
||||
lostEquipmentCount: lostItemName != null ? 1 : 0,
|
||||
lostItemName: lostItemName,
|
||||
lostItemSlot: lostItemSlot,
|
||||
goldAtDeath: state.inventory.gold,
|
||||
levelAtDeath: state.traits.level,
|
||||
timestamp: state.skillSystem.elapsedMs,
|
||||
);
|
||||
|
||||
// 전투 상태 초기화
|
||||
final progress = state.progress.copyWith(currentCombat: null);
|
||||
final progress = state.progress.copyWith(clearCurrentCombat: true);
|
||||
|
||||
return state.copyWith(
|
||||
equipment: newEquipment,
|
||||
@@ -103,6 +105,7 @@ class ResurrectionService {
|
||||
playerLevel: state.traits.level,
|
||||
currentGold: state.inventory.gold,
|
||||
currentEquipment: state.equipment,
|
||||
cha: state.stats.cha,
|
||||
);
|
||||
|
||||
// 장비 적용
|
||||
@@ -167,10 +170,7 @@ class ResurrectionService {
|
||||
caption: firstTask.caption,
|
||||
type: firstTask.taskType,
|
||||
),
|
||||
task: ProgressBarState(
|
||||
position: 0,
|
||||
max: firstTask.durationMillis,
|
||||
),
|
||||
task: ProgressBarState(position: 0, max: firstTask.durationMillis),
|
||||
currentCombat: null, // 전투 상태 명시적 초기화
|
||||
),
|
||||
);
|
||||
@@ -241,6 +241,132 @@ class ResurrectionService {
|
||||
return state.inventory.gold >= cost;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 광고 부활 (HP 100% + 아이템 복구)
|
||||
// ============================================================================
|
||||
|
||||
/// 광고 부활 처리
|
||||
///
|
||||
/// 1. 상실한 아이템 복구 (있는 경우)
|
||||
/// 2. HP/MP 100% 회복
|
||||
/// 3. 사망 상태 해제
|
||||
/// 4. 안전 지역으로 이동 태스크 설정
|
||||
///
|
||||
/// Note: 10분 자동부활 버프는 GameSessionController에서 처리
|
||||
GameState processAdRevive(GameState state) {
|
||||
if (!state.isDead) return state;
|
||||
|
||||
var nextState = state;
|
||||
|
||||
// 1. 상실한 아이템 복구 (있는 경우)
|
||||
if (canRecoverLostItem(state)) {
|
||||
nextState = processItemRecovery(nextState);
|
||||
}
|
||||
|
||||
// 2. 전체 HP/MP 계산 (장비 + 종족 + 클래스 보너스 포함)
|
||||
final totalHpMax = _calculateTotalHpMax(nextState);
|
||||
final totalMpMax = _calculateTotalMpMax(nextState);
|
||||
|
||||
// HP/MP 100% 회복 (장비 구매 없이)
|
||||
nextState = nextState.copyWith(
|
||||
stats: nextState.stats.copyWith(
|
||||
hpCurrent: totalHpMax,
|
||||
mpCurrent: totalMpMax,
|
||||
),
|
||||
clearDeathInfo: true, // 사망 상태 해제
|
||||
);
|
||||
|
||||
// 스킬 쿨타임 초기화
|
||||
nextState = nextState.copyWith(
|
||||
skillSystem: SkillSystemState.empty().copyWith(
|
||||
elapsedMs: nextState.skillSystem.elapsedMs,
|
||||
),
|
||||
);
|
||||
|
||||
// 4. 부활 후 태스크 시퀀스 설정
|
||||
final resurrectionQueue = <QueueEntry>[
|
||||
QueueEntry(
|
||||
kind: QueueKind.task,
|
||||
durationMillis: 3000,
|
||||
caption: l10n.taskReturningToTown,
|
||||
taskType: TaskType.neutral,
|
||||
),
|
||||
QueueEntry(
|
||||
kind: QueueKind.task,
|
||||
durationMillis: 3000,
|
||||
caption: l10n.taskRestockingAtShop,
|
||||
taskType: TaskType.market,
|
||||
),
|
||||
QueueEntry(
|
||||
kind: QueueKind.task,
|
||||
durationMillis: 2000,
|
||||
caption: l10n.taskHeadingToHuntingGrounds,
|
||||
taskType: TaskType.neutral,
|
||||
),
|
||||
];
|
||||
|
||||
final firstTask = resurrectionQueue.removeAt(0);
|
||||
nextState = nextState.copyWith(
|
||||
queue: QueueState(entries: resurrectionQueue),
|
||||
progress: nextState.progress.copyWith(
|
||||
currentTask: TaskInfo(
|
||||
caption: firstTask.caption,
|
||||
type: firstTask.taskType,
|
||||
),
|
||||
task: ProgressBarState(position: 0, max: firstTask.durationMillis),
|
||||
currentCombat: null,
|
||||
),
|
||||
);
|
||||
|
||||
return nextState;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 아이템 복구 (Phase 5)
|
||||
// ============================================================================
|
||||
|
||||
/// 상실한 아이템 복구 가능 여부 확인
|
||||
///
|
||||
/// 사망 상태이고 상실한 아이템이 있을 때만 true
|
||||
bool canRecoverLostItem(GameState state) {
|
||||
if (!state.isDead) return false;
|
||||
if (state.deathInfo == null) return false;
|
||||
return state.deathInfo!.lostItem != null;
|
||||
}
|
||||
|
||||
/// 상실한 아이템 복구 처리
|
||||
///
|
||||
/// 광고 시청 후 호출되며 상실한 아이템을 장비에 복원합니다.
|
||||
/// Returns: 복구된 상태 (복구 불가 시 원본 상태 반환)
|
||||
GameState processItemRecovery(GameState state) {
|
||||
if (!canRecoverLostItem(state)) return state;
|
||||
|
||||
final deathInfo = state.deathInfo!;
|
||||
final lostItem = deathInfo.lostItem!;
|
||||
final lostSlot = deathInfo.lostItemSlot!;
|
||||
|
||||
// 해당 슬롯에 아이템 복원
|
||||
final slotIndex = lostSlot.index;
|
||||
final updatedEquipment = state.equipment.setItemByIndex(
|
||||
slotIndex,
|
||||
lostItem,
|
||||
);
|
||||
|
||||
// DeathInfo에서 상실 아이템 정보 제거 (복구 완료)
|
||||
final updatedDeathInfo = deathInfo.copyWith(
|
||||
lostEquipmentCount: 0,
|
||||
lostItemName: null,
|
||||
lostItemSlot: null,
|
||||
lostItemRarity: null,
|
||||
lostItem: null,
|
||||
);
|
||||
|
||||
return state.copyWith(
|
||||
equipment: updatedEquipment,
|
||||
deathInfo: updatedDeathInfo,
|
||||
);
|
||||
}
|
||||
|
||||
/// 장비 보존 아이템 적용 (향후 확장용)
|
||||
///
|
||||
/// [protectedSlots] 보존할 슬롯 인덱스 목록
|
||||
|
||||
205
lib/src/core/engine/return_rewards_service.dart
Normal file
205
lib/src/core/engine/return_rewards_service.dart
Normal file
@@ -0,0 +1,205 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import 'package:asciineverdie/src/core/infrastructure/ad_service.dart';
|
||||
import 'package:asciineverdie/src/core/engine/chest_service.dart';
|
||||
import 'package:asciineverdie/src/core/infrastructure/iap_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/treasure_chest.dart';
|
||||
|
||||
/// 복귀 보상 서비스 (Phase 7)
|
||||
///
|
||||
/// 플레이어가 게임에 복귀했을 때 떠나있던 시간에 따라 보물 상자를 제공합니다.
|
||||
/// - 최소 복귀 시간: 1시간
|
||||
/// - 최대 복귀 시간: 24시간 (그 이상은 24시간으로 계산)
|
||||
/// - 기본 보상: 4시간당 1상자
|
||||
/// - 보너스 보상: 광고 시청 시 상자 2배
|
||||
class ReturnRewardsService {
|
||||
ReturnRewardsService._() : _chestService = ChestService();
|
||||
|
||||
static ReturnRewardsService? _instance;
|
||||
|
||||
/// 싱글톤 인스턴스
|
||||
static ReturnRewardsService get instance {
|
||||
_instance ??= ReturnRewardsService._();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
final ChestService _chestService;
|
||||
|
||||
// ===========================================================================
|
||||
// 상수
|
||||
// ===========================================================================
|
||||
|
||||
/// 최소 복귀 시간 (시간)
|
||||
static const int minHoursAway = 1;
|
||||
|
||||
/// 최대 복귀 시간 (시간) - 이 이상은 동일 보상
|
||||
static const int maxHoursAway = 24;
|
||||
|
||||
/// 상자 1개당 필요 시간 (시간)
|
||||
static const int hoursPerChest = 4;
|
||||
|
||||
/// 최대 상자 개수 (무료 유저)
|
||||
static const int maxChestsFree = 5;
|
||||
|
||||
/// 최대 상자 개수 (유료 유저)
|
||||
static const int maxChestsPaid = 10;
|
||||
|
||||
// ===========================================================================
|
||||
// 보상 계산
|
||||
// ===========================================================================
|
||||
|
||||
/// 복귀 보상 계산
|
||||
///
|
||||
/// [lastPlayTime] 마지막 플레이 시각 (null이면 보상 없음)
|
||||
/// [currentTime] 현재 시각
|
||||
/// [isPaidUser] 유료 유저 여부 (최대 상자 개수 결정)
|
||||
/// Returns: 복귀 보상 데이터 (시간이 부족하면 hasReward = false)
|
||||
ReturnChestReward calculateReward({
|
||||
required DateTime? lastPlayTime,
|
||||
required DateTime currentTime,
|
||||
required bool isPaidUser,
|
||||
}) {
|
||||
// 마지막 플레이 시간이 없으면 보상 없음
|
||||
if (lastPlayTime == null) {
|
||||
debugPrint('[ReturnRewards] No lastPlayTime, no reward');
|
||||
return const ReturnChestReward(
|
||||
hoursAway: 0,
|
||||
chestCount: 0,
|
||||
bonusChestCount: 0,
|
||||
);
|
||||
}
|
||||
|
||||
// 경과 시간 계산
|
||||
final difference = currentTime.difference(lastPlayTime);
|
||||
final hoursAway = difference.inHours;
|
||||
|
||||
// 최소 시간 미만이면 보상 없음
|
||||
if (hoursAway < minHoursAway) {
|
||||
debugPrint('[ReturnRewards] Only $hoursAway hours, need $minHoursAway');
|
||||
return ReturnChestReward(
|
||||
hoursAway: hoursAway,
|
||||
chestCount: 0,
|
||||
bonusChestCount: 0,
|
||||
);
|
||||
}
|
||||
|
||||
// 유료 유저: 오프라인 시간 2배 인정
|
||||
final creditedHours = isPaidUser ? hoursAway * 2 : hoursAway;
|
||||
|
||||
// 최대 시간 초과 시 최대로 제한
|
||||
final effectiveHours = creditedHours > maxHoursAway
|
||||
? maxHoursAway
|
||||
: creditedHours;
|
||||
|
||||
// 상자 개수 계산
|
||||
final maxChests = isPaidUser ? maxChestsPaid : maxChestsFree;
|
||||
final rawChestCount = effectiveHours ~/ hoursPerChest;
|
||||
final chestCount = rawChestCount.clamp(0, maxChests);
|
||||
|
||||
// 보너스 상자 (광고 시청 시 동일 개수 추가)
|
||||
final bonusChestCount = chestCount;
|
||||
|
||||
debugPrint(
|
||||
'[ReturnRewards] $hoursAway hours away, '
|
||||
'chests=$chestCount, bonus=$bonusChestCount, paid=$isPaidUser',
|
||||
);
|
||||
|
||||
return ReturnChestReward(
|
||||
hoursAway: hoursAway,
|
||||
chestCount: chestCount,
|
||||
bonusChestCount: bonusChestCount,
|
||||
);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// 상자 오픈
|
||||
// ===========================================================================
|
||||
|
||||
/// 상자 오픈하여 보상 생성
|
||||
///
|
||||
/// [count] 오픈할 상자 개수
|
||||
/// [playerLevel] 플레이어 레벨 (보상 스케일링용)
|
||||
List<ChestReward> openChests(int count, int playerLevel) {
|
||||
return _chestService.openMultipleChests(count, playerLevel);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// 보상 수령
|
||||
// ===========================================================================
|
||||
|
||||
/// 기본 보상 수령 (광고 없이)
|
||||
///
|
||||
/// [reward] 복귀 보상 데이터
|
||||
/// [playerLevel] 플레이어 레벨
|
||||
/// Returns: 오픈된 상자 보상 목록
|
||||
List<ChestReward> claimBasicReward(
|
||||
ReturnChestReward reward,
|
||||
int playerLevel,
|
||||
) {
|
||||
if (!reward.hasReward) return [];
|
||||
debugPrint(
|
||||
'[ReturnRewards] Basic reward claimed: ${reward.chestCount} chests',
|
||||
);
|
||||
return openChests(reward.chestCount, playerLevel);
|
||||
}
|
||||
|
||||
/// 보너스 보상 수령 (광고 시청 후)
|
||||
///
|
||||
/// 유료 유저: 무료 보너스
|
||||
/// 무료 유저: 리워드 광고 시청 후 보너스
|
||||
/// [reward] 복귀 보상 데이터
|
||||
/// [playerLevel] 플레이어 레벨
|
||||
/// Returns: 오픈된 보너스 상자 보상 목록 (광고 실패 시 빈 목록)
|
||||
Future<List<ChestReward>> claimBonusReward(
|
||||
ReturnChestReward reward,
|
||||
int playerLevel,
|
||||
) async {
|
||||
if (!reward.hasReward || reward.bonusChestCount <= 0) return [];
|
||||
|
||||
// 유료 유저는 무료 보너스
|
||||
if (IAPService.instance.isAdRemovalPurchased) {
|
||||
debugPrint(
|
||||
'[ReturnRewards] Bonus claimed (paid user): '
|
||||
'${reward.bonusChestCount} chests',
|
||||
);
|
||||
return openChests(reward.bonusChestCount, playerLevel);
|
||||
}
|
||||
|
||||
// 무료 유저는 리워드 광고 필요
|
||||
List<ChestReward> bonusRewards = [];
|
||||
final adResult = await AdService.instance.showRewardedAd(
|
||||
adType: AdType.rewardReturn, // 복귀 보상용 리워드 광고
|
||||
onRewarded: () {
|
||||
bonusRewards = openChests(reward.bonusChestCount, playerLevel);
|
||||
},
|
||||
);
|
||||
|
||||
if (adResult == AdResult.completed || adResult == AdResult.debugSkipped) {
|
||||
debugPrint(
|
||||
'[ReturnRewards] Bonus claimed (free user with ad): '
|
||||
'${bonusRewards.length} chests',
|
||||
);
|
||||
return bonusRewards;
|
||||
}
|
||||
|
||||
debugPrint('[ReturnRewards] Bonus claim failed: $adResult');
|
||||
return [];
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// 시간 포맷팅
|
||||
// ===========================================================================
|
||||
|
||||
/// 복귀 시간을 표시용 문자열로 변환
|
||||
String formatHoursAway(int hours) {
|
||||
if (hours < 24) {
|
||||
return '${hours}h';
|
||||
}
|
||||
final days = hours ~/ 24;
|
||||
final remainingHours = hours % 24;
|
||||
if (remainingHours == 0) {
|
||||
return '${days}d';
|
||||
}
|
||||
return '${days}d ${remainingHours}h';
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,82 @@
|
||||
import 'package:asciineverdie/src/core/engine/game_mutations.dart';
|
||||
import 'package:asciineverdie/src/core/engine/item_service.dart';
|
||||
import 'package:asciineverdie/src/core/engine/shop_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/equipment_slot.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/util/pq_logic.dart';
|
||||
import 'package:asciineverdie/src/core/model/pq_config.dart';
|
||||
import 'package:asciineverdie/src/core/util/pq_logic.dart' as pq_logic;
|
||||
|
||||
/// Applies quest/act rewards to the GameState using shared RNG.
|
||||
class RewardService {
|
||||
RewardService(this.mutations);
|
||||
RewardService(this.mutations, this.config);
|
||||
|
||||
final GameMutations mutations;
|
||||
final PqConfig config;
|
||||
|
||||
GameState applyReward(GameState state, RewardKind reward) {
|
||||
GameState applyReward(GameState state, pq_logic.RewardKind reward) {
|
||||
switch (reward) {
|
||||
case RewardKind.spell:
|
||||
case pq_logic.RewardKind.spell:
|
||||
return mutations.winSpell(state, state.stats.wis, state.traits.level);
|
||||
case RewardKind.equip:
|
||||
// 원본 Main.pas:797 - Random(Equips.Items.Count) (11개 슬롯)
|
||||
final slotIndex = state.rng.nextInt(Equipment.slotCount);
|
||||
return mutations.winEquipByIndex(state, state.traits.level, slotIndex);
|
||||
case RewardKind.stat:
|
||||
case pq_logic.RewardKind.equip:
|
||||
return _applyEquipReward(state);
|
||||
case pq_logic.RewardKind.stat:
|
||||
return mutations.winStat(state);
|
||||
case RewardKind.item:
|
||||
case pq_logic.RewardKind.item:
|
||||
return mutations.winItem(state);
|
||||
}
|
||||
}
|
||||
|
||||
/// 장비 보상 처리 (개선된 로직)
|
||||
///
|
||||
/// - 빈 슬롯: 무조건 장착
|
||||
/// - 기존 장비 있음: 점수 비교 → 업그레이드만 / 다운그레이드 시 판매
|
||||
GameState _applyEquipReward(GameState state) {
|
||||
final slotIndex = state.rng.nextInt(Equipment.slotCount);
|
||||
final slot = EquipmentSlot.values[slotIndex];
|
||||
final currentItem = state.equipment.getItemByIndex(slotIndex);
|
||||
final level = state.traits.level;
|
||||
|
||||
// 새 장비 생성
|
||||
final itemService = ItemService(rng: state.rng);
|
||||
final name = pq_logic.winEquip(config, state.rng, level, slotIndex);
|
||||
final newItem = itemService.generateEquipment(
|
||||
name: name,
|
||||
slot: slot,
|
||||
level: level,
|
||||
);
|
||||
|
||||
// 빈 슬롯이면 무조건 장착
|
||||
if (currentItem.isEmpty) {
|
||||
return state.copyWith(
|
||||
rng: state.rng,
|
||||
equipment: state.equipment
|
||||
.setItemByIndex(slotIndex, newItem)
|
||||
.copyWith(bestIndex: slotIndex),
|
||||
);
|
||||
}
|
||||
|
||||
// 점수 비교
|
||||
final currentScore = ItemService.calculateEquipmentScore(currentItem);
|
||||
final newScore = ItemService.calculateEquipmentScore(newItem);
|
||||
|
||||
if (newScore > currentScore) {
|
||||
// 업그레이드: 새 장비 장착
|
||||
return state.copyWith(
|
||||
rng: state.rng,
|
||||
equipment: state.equipment
|
||||
.setItemByIndex(slotIndex, newItem)
|
||||
.copyWith(bestIndex: slotIndex),
|
||||
);
|
||||
} else {
|
||||
// 다운그레이드: 새 장비 판매 (골드로 변환)
|
||||
final shopService = ShopService(rng: state.rng);
|
||||
final sellPrice = shopService.calculateSellPrice(newItem);
|
||||
return state.copyWith(
|
||||
rng: state.rng,
|
||||
inventory: state.inventory.copyWith(
|
||||
gold: state.inventory.gold + sellPrice,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,21 @@ class ShopService {
|
||||
|
||||
/// 장비 구매 가격 계산
|
||||
///
|
||||
/// 가격 = 아이템 레벨 * 50 * 희귀도 배율
|
||||
int calculateBuyPrice(EquipmentItem item) {
|
||||
/// 가격 = 아이템 레벨 * 50 * 희귀도 배율 * (1 - CHA 할인율)
|
||||
/// CHA 할인율(charisma discount): (CHA - 10) * 1%, 최대 15%, 최소 0%
|
||||
int calculateBuyPrice(EquipmentItem item, {int cha = 0}) {
|
||||
if (item.isEmpty) return 0;
|
||||
return (item.level * 50 * _getRarityPriceMultiplier(item.rarity)).round();
|
||||
final basePrice = (item.level * 50 * _getRarityPriceMultiplier(item.rarity))
|
||||
.round();
|
||||
final discount = chaDiscount(cha);
|
||||
return (basePrice * (1.0 - discount)).round();
|
||||
}
|
||||
|
||||
/// CHA 기반 할인율 계산
|
||||
///
|
||||
/// (CHA - 10) * 0.01, 0~0.15 범위로 클램프
|
||||
static double chaDiscount(int cha) {
|
||||
return ((cha - 10) * 0.01).clamp(0.0, 0.15);
|
||||
}
|
||||
|
||||
/// 장비 판매 가격 계산
|
||||
@@ -211,6 +222,7 @@ class ShopService {
|
||||
required int playerLevel,
|
||||
required int currentGold,
|
||||
required Equipment currentEquipment,
|
||||
int cha = 0,
|
||||
}) {
|
||||
var remainingGold = currentGold;
|
||||
final purchasedItems = <EquipmentItem>[];
|
||||
@@ -230,7 +242,7 @@ class ShopService {
|
||||
targetRarity: ItemRarity.common, // 부활 시 Common만 구매
|
||||
);
|
||||
|
||||
final price = calculateBuyPrice(shopItem);
|
||||
final price = calculateBuyPrice(shopItem, cha: cha);
|
||||
if (price <= remainingGold) {
|
||||
remainingGold -= price;
|
||||
purchasedItems.add(shopItem);
|
||||
@@ -254,6 +266,7 @@ class ShopService {
|
||||
required int currentGold,
|
||||
required EquipmentSlot slot,
|
||||
ItemRarity? preferredRarity,
|
||||
int cha = 0,
|
||||
}) {
|
||||
final item = generateShopItem(
|
||||
playerLevel: playerLevel,
|
||||
@@ -261,7 +274,7 @@ class ShopService {
|
||||
targetRarity: preferredRarity,
|
||||
);
|
||||
|
||||
final price = calculateBuyPrice(item);
|
||||
final price = calculateBuyPrice(item, cha: cha);
|
||||
if (price > currentGold) return null;
|
||||
|
||||
return PurchaseResult(
|
||||
|
||||
200
lib/src/core/engine/skill_auto_selector.dart
Normal file
200
lib/src/core/engine/skill_auto_selector.dart
Normal file
@@ -0,0 +1,200 @@
|
||||
import 'package:asciineverdie/data/skill_data.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/skill.dart';
|
||||
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||
|
||||
/// 스킬 자동 선택 AI
|
||||
///
|
||||
/// SkillService에서 분리된 전투 중 스킬 자동 선택 로직.
|
||||
/// 상황별 우선순위에 따라 최적의 스킬을 선택한다.
|
||||
class SkillAutoSelector {
|
||||
const SkillAutoSelector({required this.rng});
|
||||
|
||||
final DeterministicRandom rng;
|
||||
|
||||
/// 전투 중 자동 스킬 선택
|
||||
///
|
||||
/// 우선순위:
|
||||
/// 1. HP < 30% -> 회복 스킬 (최우선)
|
||||
/// 2. 70% 확률로 일반 공격 (MP 절약, 기본 전투)
|
||||
/// 3. 30% 확률로 스킬 사용:
|
||||
/// - 버프: HP > 80% & MP > 60% & 활성 버프 없음
|
||||
/// - 디버프: 몬스터 HP > 80% & 활성 디버프 없음
|
||||
/// - DOT: 몬스터 HP > 60% & 활성 DOT 없음
|
||||
/// - 공격: 보스전이면 강력한 스킬, 일반전이면 효율적 스킬
|
||||
/// 4. MP < 20% -> 일반 공격
|
||||
Skill? selectAutoSkill({
|
||||
required CombatStats player,
|
||||
required MonsterCombatStats monster,
|
||||
required SkillSystemState skillSystem,
|
||||
required List<String> availableSkillIds,
|
||||
required bool Function(Skill) canUse,
|
||||
List<DotEffect> activeDoTs = const [],
|
||||
List<ActiveBuff> activeDebuffs = const [],
|
||||
}) {
|
||||
final mpRatio = player.mpRatio;
|
||||
final hpRatio = player.hpRatio;
|
||||
|
||||
// MP 20% 미만이면 일반 공격
|
||||
if (mpRatio < 0.2) return null;
|
||||
|
||||
// 사용 가능한 스킬 필터링
|
||||
final availableSkills = availableSkillIds
|
||||
.map((id) => SkillData.getSkillById(id))
|
||||
.whereType<Skill>()
|
||||
.where(canUse)
|
||||
.toList();
|
||||
|
||||
if (availableSkills.isEmpty) return null;
|
||||
|
||||
// HP < 30% -> 회복 스킬 최우선 (생존)
|
||||
if (hpRatio < 0.3) {
|
||||
final healSkill = _findBestHealSkill(availableSkills, player.mpCurrent);
|
||||
if (healSkill != null) return healSkill;
|
||||
}
|
||||
|
||||
// 70% 확률로 일반 공격 (스킬은 특별한 상황에서만)
|
||||
final useNormalAttack = rng.nextInt(100) < 70;
|
||||
if (useNormalAttack) return null;
|
||||
|
||||
// === 아래부터 30% 확률로 스킬 사용 ===
|
||||
|
||||
// 버프: HP > 80% & MP > 60% (매우 안전할 때만)
|
||||
if (hpRatio > 0.8 && mpRatio > 0.6) {
|
||||
final hasActiveBuff = skillSystem.activeBuffs.isNotEmpty;
|
||||
if (!hasActiveBuff) {
|
||||
final buffSkill = _findBestBuffSkill(availableSkills, player.mpCurrent);
|
||||
if (buffSkill != null) return buffSkill;
|
||||
}
|
||||
}
|
||||
|
||||
// 디버프: 몬스터 HP > 80% & 활성 디버프 없음 (전투 초반)
|
||||
if (monster.hpRatio > 0.8 && activeDebuffs.isEmpty) {
|
||||
final debuffSkill = _findBestDebuffSkill(
|
||||
availableSkills,
|
||||
player.mpCurrent,
|
||||
);
|
||||
if (debuffSkill != null) return debuffSkill;
|
||||
}
|
||||
|
||||
// DOT: 몬스터 HP > 60% & 활성 DOT 없음 (장기전 유리)
|
||||
if (monster.hpRatio > 0.6 && activeDoTs.isEmpty) {
|
||||
final dotSkill = _findBestDotSkill(availableSkills, player.mpCurrent);
|
||||
if (dotSkill != null) return dotSkill;
|
||||
}
|
||||
|
||||
// 보스전 판단 (몬스터 레벨 20 이상 & HP 50% 이상)
|
||||
final isBossFight = monster.level >= 20 && monster.hpRatio > 0.5;
|
||||
|
||||
if (isBossFight) {
|
||||
return _findStrongestAttackSkill(availableSkills);
|
||||
}
|
||||
|
||||
// 일반 전투 -> MP 효율 좋은 공격 스킬
|
||||
return _findEfficientAttackSkill(availableSkills);
|
||||
}
|
||||
|
||||
/// 가장 좋은 DOT 스킬 찾기
|
||||
Skill? _findBestDotSkill(List<Skill> skills, int currentMp) {
|
||||
final dotSkills = skills
|
||||
.where((s) => s.isDot && s.mpCost <= currentMp)
|
||||
.toList();
|
||||
|
||||
if (dotSkills.isEmpty) return null;
|
||||
|
||||
dotSkills.sort((a, b) {
|
||||
final aTotal =
|
||||
(a.baseDotDamage ?? 0) *
|
||||
((a.baseDotDurationMs ?? 0) ~/ (a.baseDotTickMs ?? 1000));
|
||||
final bTotal =
|
||||
(b.baseDotDamage ?? 0) *
|
||||
((b.baseDotDurationMs ?? 0) ~/ (b.baseDotTickMs ?? 1000));
|
||||
return bTotal.compareTo(aTotal);
|
||||
});
|
||||
|
||||
return dotSkills.first;
|
||||
}
|
||||
|
||||
/// 가장 좋은 회복 스킬 찾기
|
||||
Skill? _findBestHealSkill(List<Skill> skills, int currentMp) {
|
||||
final healSkills = skills
|
||||
.where((s) => s.isHeal && s.mpCost <= currentMp)
|
||||
.toList();
|
||||
|
||||
if (healSkills.isEmpty) return null;
|
||||
|
||||
healSkills.sort((a, b) {
|
||||
final aValue = a.healPercent * 100 + a.healAmount;
|
||||
final bValue = b.healPercent * 100 + b.healAmount;
|
||||
return bValue.compareTo(aValue);
|
||||
});
|
||||
|
||||
return healSkills.first;
|
||||
}
|
||||
|
||||
/// 가장 강력한 공격 스킬 찾기
|
||||
Skill? _findStrongestAttackSkill(List<Skill> skills) {
|
||||
final attackSkills = skills.where((s) => s.isAttack).toList();
|
||||
if (attackSkills.isEmpty) return null;
|
||||
|
||||
attackSkills.sort(
|
||||
(a, b) => b.damageMultiplier.compareTo(a.damageMultiplier),
|
||||
);
|
||||
return attackSkills.first;
|
||||
}
|
||||
|
||||
/// MP 효율 좋은 공격 스킬 찾기
|
||||
Skill? _findEfficientAttackSkill(List<Skill> skills) {
|
||||
final attackSkills = skills.where((s) => s.isAttack).toList();
|
||||
if (attackSkills.isEmpty) return null;
|
||||
|
||||
attackSkills.sort((a, b) => b.mpEfficiency.compareTo(a.mpEfficiency));
|
||||
return attackSkills.first;
|
||||
}
|
||||
|
||||
/// 가장 좋은 버프 스킬 찾기
|
||||
Skill? _findBestBuffSkill(List<Skill> skills, int currentMp) {
|
||||
final buffSkills = skills
|
||||
.where((s) => s.isBuff && s.mpCost <= currentMp && s.buff != null)
|
||||
.toList();
|
||||
|
||||
if (buffSkills.isEmpty) return null;
|
||||
|
||||
buffSkills.sort((a, b) {
|
||||
final aValue =
|
||||
(a.buff?.atkModifier ?? 0) +
|
||||
(a.buff?.defModifier ?? 0) * 0.5 +
|
||||
(a.buff?.criRateModifier ?? 0) * 0.3;
|
||||
final bValue =
|
||||
(b.buff?.atkModifier ?? 0) +
|
||||
(b.buff?.defModifier ?? 0) * 0.5 +
|
||||
(b.buff?.criRateModifier ?? 0) * 0.3;
|
||||
return bValue.compareTo(aValue);
|
||||
});
|
||||
|
||||
return buffSkills.first;
|
||||
}
|
||||
|
||||
/// 가장 좋은 디버프 스킬 찾기
|
||||
Skill? _findBestDebuffSkill(List<Skill> skills, int currentMp) {
|
||||
final debuffSkills = skills
|
||||
.where((s) => s.isDebuff && s.mpCost <= currentMp && s.buff != null)
|
||||
.toList();
|
||||
|
||||
if (debuffSkills.isEmpty) return null;
|
||||
|
||||
debuffSkills.sort((a, b) {
|
||||
final aValue =
|
||||
(a.buff?.atkModifier ?? 0).abs() +
|
||||
(a.buff?.defModifier ?? 0).abs() * 0.5;
|
||||
final bValue =
|
||||
(b.buff?.atkModifier ?? 0).abs() +
|
||||
(b.buff?.defModifier ?? 0).abs() * 0.5;
|
||||
return bValue.compareTo(aValue);
|
||||
});
|
||||
|
||||
return debuffSkills.first;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:asciineverdie/data/skill_data.dart';
|
||||
import 'package:asciineverdie/src/core/engine/skill_auto_selector.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_combat_stats.dart';
|
||||
@@ -24,6 +25,11 @@ class SkillService {
|
||||
required int currentMp,
|
||||
required SkillSystemState skillSystem,
|
||||
}) {
|
||||
// GCD 체크 (글로벌 쿨타임 1500ms)
|
||||
if (skillSystem.isGlobalCooldownActive) {
|
||||
return SkillFailReason.onGlobalCooldown;
|
||||
}
|
||||
|
||||
// MP 체크
|
||||
if (currentMp < skill.mpCost) {
|
||||
return SkillFailReason.notEnoughMp;
|
||||
@@ -58,18 +64,25 @@ class SkillService {
|
||||
required MonsterCombatStats monster,
|
||||
required SkillSystemState skillSystem,
|
||||
}) {
|
||||
// 데미지 타입에 따른 공격력/방어력 선택
|
||||
final (attackStat, defenseStat) = _getStatsByDamageType(
|
||||
skill.damageType,
|
||||
player,
|
||||
monster,
|
||||
);
|
||||
|
||||
// 기본 데미지 계산
|
||||
final baseDamage = player.atk * skill.damageMultiplier;
|
||||
final baseDamage = attackStat * skill.damageMultiplier;
|
||||
|
||||
// 버프 효과 적용
|
||||
final buffMods = skillSystem.totalBuffModifiers;
|
||||
final buffedDamage = baseDamage * (1 + buffMods.atkMod);
|
||||
|
||||
// 적 방어력 감소 적용
|
||||
final effectiveMonsterDef = monster.def * (1 - skill.targetDefReduction);
|
||||
final effectiveMonsterDef = defenseStat * (1 - skill.targetDefReduction);
|
||||
|
||||
// 최종 데미지 계산 (방어력 감산)
|
||||
final finalDamage = (buffedDamage - effectiveMonsterDef * 0.5)
|
||||
// 최종 데미지 계산 (방어력 감산 0.3)
|
||||
final finalDamage = (buffedDamage - effectiveMonsterDef * 0.3)
|
||||
.round()
|
||||
.clamp(1, 9999);
|
||||
|
||||
@@ -100,6 +113,8 @@ class SkillService {
|
||||
}
|
||||
|
||||
/// 회복 스킬 사용
|
||||
///
|
||||
/// [healingMultiplier] 회복력 배율 (기본 1.0, 클래스 패시브 적용)
|
||||
({
|
||||
SkillUseResult result,
|
||||
CombatStats updatedPlayer,
|
||||
@@ -109,6 +124,7 @@ class SkillService {
|
||||
required Skill skill,
|
||||
required CombatStats player,
|
||||
required SkillSystemState skillSystem,
|
||||
double healingMultiplier = 1.0,
|
||||
}) {
|
||||
// 회복량 계산
|
||||
int healAmount = skill.healAmount;
|
||||
@@ -116,6 +132,9 @@ class SkillService {
|
||||
healAmount += (player.hpMax * skill.healPercent).round();
|
||||
}
|
||||
|
||||
// 회복력 보너스 적용 (예: Debugger Paladin +10%, Exception Handler +15%)
|
||||
healAmount = (healAmount * healingMultiplier).round();
|
||||
|
||||
// HP 회복
|
||||
var updatedPlayer = player.applyHeal(healAmount);
|
||||
|
||||
@@ -291,19 +310,12 @@ class SkillService {
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 자동 스킬 선택
|
||||
// 자동 스킬 선택 (SkillAutoSelector에 위임)
|
||||
// ============================================================================
|
||||
|
||||
/// 전투 중 자동 스킬 선택
|
||||
///
|
||||
/// 우선순위:
|
||||
/// 1. HP < 30% → 회복 스킬
|
||||
/// 2. HP > 70% & MP > 50% → 버프 스킬 (안전할 때)
|
||||
/// 3. 몬스터 HP > 70% & 활성 디버프 없음 → 디버프 스킬
|
||||
/// 4. 몬스터 HP > 50% & DOT 없음 → DOT 스킬 (장기전 유리)
|
||||
/// 5. 보스전 (레벨 차이 10 이상) → 가장 강력한 공격 스킬
|
||||
/// 6. 일반 전투 → MP 효율이 좋은 스킬
|
||||
/// 7. MP < 20% → null (일반 공격)
|
||||
/// 세부 로직은 SkillAutoSelector에 위임.
|
||||
Skill? selectAutoSkill({
|
||||
required CombatStats player,
|
||||
required MonsterCombatStats monster,
|
||||
@@ -312,172 +324,22 @@ class SkillService {
|
||||
List<DotEffect> activeDoTs = const [],
|
||||
List<ActiveBuff> activeDebuffs = const [],
|
||||
}) {
|
||||
final currentMp = player.mpCurrent;
|
||||
final mpRatio = player.mpRatio;
|
||||
final hpRatio = player.hpRatio;
|
||||
|
||||
// MP 20% 미만이면 일반 공격
|
||||
if (mpRatio < 0.2) return null;
|
||||
|
||||
// 사용 가능한 스킬 필터링
|
||||
final availableSkills = availableSkillIds
|
||||
.map((id) => SkillData.getSkillById(id))
|
||||
.whereType<Skill>()
|
||||
.where(
|
||||
(skill) =>
|
||||
canUseSkill(
|
||||
skill: skill,
|
||||
currentMp: currentMp,
|
||||
skillSystem: skillSystem,
|
||||
) ==
|
||||
null,
|
||||
)
|
||||
.toList();
|
||||
|
||||
if (availableSkills.isEmpty) return null;
|
||||
|
||||
// HP < 30% → 회복 스킬 우선
|
||||
if (hpRatio < 0.3) {
|
||||
final healSkill = _findBestHealSkill(availableSkills, currentMp);
|
||||
if (healSkill != null) return healSkill;
|
||||
}
|
||||
|
||||
// HP > 70% & MP > 50% → 버프 스킬 (안전할 때)
|
||||
if (hpRatio > 0.7 && mpRatio > 0.5) {
|
||||
final buffSkill = _findBestBuffSkill(availableSkills, currentMp);
|
||||
if (buffSkill != null) return buffSkill;
|
||||
}
|
||||
|
||||
// 몬스터 HP > 70% & 활성 디버프 없음 → 디버프 스킬
|
||||
if (monster.hpRatio > 0.7 && activeDebuffs.isEmpty) {
|
||||
final debuffSkill = _findBestDebuffSkill(availableSkills, currentMp);
|
||||
if (debuffSkill != null) return debuffSkill;
|
||||
}
|
||||
|
||||
// 몬스터 HP > 50% & 활성 DOT 없음 → DOT 스킬 사용
|
||||
if (monster.hpRatio > 0.5 && activeDoTs.isEmpty) {
|
||||
final dotSkill = _findBestDotSkill(availableSkills, currentMp);
|
||||
if (dotSkill != null) return dotSkill;
|
||||
}
|
||||
|
||||
// 보스전 판단 (몬스터 레벨이 높음)
|
||||
final isBossFight = monster.level >= 10 && monster.hpRatio > 0.5;
|
||||
|
||||
if (isBossFight) {
|
||||
// 가장 강력한 공격 스킬
|
||||
return _findStrongestAttackSkill(availableSkills);
|
||||
}
|
||||
|
||||
// 일반 전투 → MP 효율 좋은 스킬
|
||||
return _findEfficientAttackSkill(availableSkills);
|
||||
}
|
||||
|
||||
/// 가장 좋은 DOT 스킬 찾기
|
||||
///
|
||||
/// 예상 총 데미지 (틱 × 데미지) 기준으로 선택
|
||||
Skill? _findBestDotSkill(List<Skill> skills, int currentMp) {
|
||||
final dotSkills = skills
|
||||
.where((s) => s.isDot && s.mpCost <= currentMp)
|
||||
.toList();
|
||||
|
||||
if (dotSkills.isEmpty) return null;
|
||||
|
||||
// 예상 총 데미지 기준 정렬
|
||||
dotSkills.sort((a, b) {
|
||||
final aTotal =
|
||||
(a.baseDotDamage ?? 0) *
|
||||
((a.baseDotDurationMs ?? 0) ~/ (a.baseDotTickMs ?? 1000));
|
||||
final bTotal =
|
||||
(b.baseDotDamage ?? 0) *
|
||||
((b.baseDotDurationMs ?? 0) ~/ (b.baseDotTickMs ?? 1000));
|
||||
return bTotal.compareTo(aTotal);
|
||||
});
|
||||
|
||||
return dotSkills.first;
|
||||
}
|
||||
|
||||
/// 가장 좋은 회복 스킬 찾기
|
||||
Skill? _findBestHealSkill(List<Skill> skills, int currentMp) {
|
||||
final healSkills = skills
|
||||
.where((s) => s.isHeal && s.mpCost <= currentMp)
|
||||
.toList();
|
||||
|
||||
if (healSkills.isEmpty) return null;
|
||||
|
||||
// 회복량 기준 정렬 (% 회복 > 고정 회복)
|
||||
healSkills.sort((a, b) {
|
||||
final aValue = a.healPercent * 100 + a.healAmount;
|
||||
final bValue = b.healPercent * 100 + b.healAmount;
|
||||
return bValue.compareTo(aValue);
|
||||
});
|
||||
|
||||
return healSkills.first;
|
||||
}
|
||||
|
||||
/// 가장 강력한 공격 스킬 찾기
|
||||
Skill? _findStrongestAttackSkill(List<Skill> skills) {
|
||||
final attackSkills = skills.where((s) => s.isAttack).toList();
|
||||
if (attackSkills.isEmpty) return null;
|
||||
|
||||
attackSkills.sort(
|
||||
(a, b) => b.damageMultiplier.compareTo(a.damageMultiplier),
|
||||
final selector = SkillAutoSelector(rng: rng);
|
||||
return selector.selectAutoSkill(
|
||||
player: player,
|
||||
monster: monster,
|
||||
skillSystem: skillSystem,
|
||||
availableSkillIds: availableSkillIds,
|
||||
canUse: (skill) =>
|
||||
canUseSkill(
|
||||
skill: skill,
|
||||
currentMp: player.mpCurrent,
|
||||
skillSystem: skillSystem,
|
||||
) ==
|
||||
null,
|
||||
activeDoTs: activeDoTs,
|
||||
activeDebuffs: activeDebuffs,
|
||||
);
|
||||
return attackSkills.first;
|
||||
}
|
||||
|
||||
/// MP 효율 좋은 공격 스킬 찾기
|
||||
Skill? _findEfficientAttackSkill(List<Skill> skills) {
|
||||
final attackSkills = skills.where((s) => s.isAttack).toList();
|
||||
if (attackSkills.isEmpty) return null;
|
||||
|
||||
attackSkills.sort((a, b) => b.mpEfficiency.compareTo(a.mpEfficiency));
|
||||
return attackSkills.first;
|
||||
}
|
||||
|
||||
/// 가장 좋은 버프 스킬 찾기
|
||||
///
|
||||
/// ATK 증가 버프 우선, 그 다음 복합 버프
|
||||
Skill? _findBestBuffSkill(List<Skill> skills, int currentMp) {
|
||||
final buffSkills = skills
|
||||
.where((s) => s.isBuff && s.mpCost <= currentMp && s.buff != null)
|
||||
.toList();
|
||||
|
||||
if (buffSkills.isEmpty) return null;
|
||||
|
||||
// ATK 증가량 기준 정렬
|
||||
buffSkills.sort((a, b) {
|
||||
final aValue = (a.buff?.atkModifier ?? 0) +
|
||||
(a.buff?.defModifier ?? 0) * 0.5 +
|
||||
(a.buff?.criRateModifier ?? 0) * 0.3;
|
||||
final bValue = (b.buff?.atkModifier ?? 0) +
|
||||
(b.buff?.defModifier ?? 0) * 0.5 +
|
||||
(b.buff?.criRateModifier ?? 0) * 0.3;
|
||||
return bValue.compareTo(aValue);
|
||||
});
|
||||
|
||||
return buffSkills.first;
|
||||
}
|
||||
|
||||
/// 가장 좋은 디버프 스킬 찾기
|
||||
///
|
||||
/// 적 ATK 감소 디버프 우선
|
||||
Skill? _findBestDebuffSkill(List<Skill> skills, int currentMp) {
|
||||
final debuffSkills = skills
|
||||
.where((s) => s.isDebuff && s.mpCost <= currentMp && s.buff != null)
|
||||
.toList();
|
||||
|
||||
if (debuffSkills.isEmpty) return null;
|
||||
|
||||
// 디버프 효과 크기 기준 정렬 (음수 값이므로 절대값으로 비교)
|
||||
debuffSkills.sort((a, b) {
|
||||
final aValue = (a.buff?.atkModifier ?? 0).abs() +
|
||||
(a.buff?.defModifier ?? 0).abs() * 0.5;
|
||||
final bValue = (b.buff?.atkModifier ?? 0).abs() +
|
||||
(b.buff?.defModifier ?? 0).abs() * 0.5;
|
||||
return bValue.compareTo(aValue);
|
||||
});
|
||||
|
||||
return debuffSkills.first;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -616,18 +478,25 @@ class SkillService {
|
||||
// 실제 MP 비용 계산
|
||||
final actualMpCost = (skill.mpCost * mpMult).round();
|
||||
|
||||
// 데미지 타입에 따른 공격력/방어력 선택
|
||||
final (attackStat, defenseStat) = _getStatsByDamageType(
|
||||
skill.damageType,
|
||||
player,
|
||||
monster,
|
||||
);
|
||||
|
||||
// 기본 데미지 계산 (랭크 배율 적용)
|
||||
final baseDamage = player.atk * skill.damageMultiplier * rankMult;
|
||||
final baseDamage = attackStat * skill.damageMultiplier * rankMult;
|
||||
|
||||
// 버프 효과 적용
|
||||
final buffMods = skillSystem.totalBuffModifiers;
|
||||
final buffedDamage = baseDamage * (1 + buffMods.atkMod);
|
||||
|
||||
// 적 방어력 감소 적용
|
||||
final effectiveMonsterDef = monster.def * (1 - skill.targetDefReduction);
|
||||
final effectiveMonsterDef = defenseStat * (1 - skill.targetDefReduction);
|
||||
|
||||
// 최종 데미지 계산 (방어력 감산)
|
||||
final finalDamage = (buffedDamage - effectiveMonsterDef * 0.5)
|
||||
// 최종 데미지 계산 (방어력 감산 0.3)
|
||||
final finalDamage = (buffedDamage - effectiveMonsterDef * 0.3)
|
||||
.round()
|
||||
.clamp(1, 9999);
|
||||
|
||||
@@ -688,4 +557,32 @@ class SkillService {
|
||||
|
||||
return state.copyWith(skillStates: skillStates);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 데미지 타입 헬퍼
|
||||
// ============================================================================
|
||||
|
||||
/// 데미지 타입에 따른 공격력/방어력 스탯 반환
|
||||
///
|
||||
/// [damageType] 스킬의 데미지 타입
|
||||
/// [player] 플레이어 전투 스탯
|
||||
/// [monster] 몬스터 전투 스탯
|
||||
/// Returns: (공격력, 방어력) 튜플
|
||||
(double, double) _getStatsByDamageType(
|
||||
DamageType damageType,
|
||||
CombatStats player,
|
||||
MonsterCombatStats monster,
|
||||
) {
|
||||
return switch (damageType) {
|
||||
DamageType.physical => (player.atk.toDouble(), monster.def.toDouble()),
|
||||
DamageType.magical => (
|
||||
player.magAtk.toDouble(),
|
||||
monster.magDef.toDouble(),
|
||||
),
|
||||
DamageType.hybrid => (
|
||||
(player.atk + player.magAtk) / 2,
|
||||
(monster.def + monster.magDef) / 2,
|
||||
),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,17 +187,6 @@ class StatCalculator {
|
||||
return bonus > 0 ? bonus : 1.0;
|
||||
}
|
||||
|
||||
/// 사망 시 보존할 장비 개수 (Coredump Undead 패시브)
|
||||
///
|
||||
/// [race] 종족 특성
|
||||
/// Returns: 보존 장비 개수
|
||||
int calculateDeathEquipmentPreserve(RaceTraits race) {
|
||||
if (race.hasPassive(PassiveType.deathEquipmentPreserve)) {
|
||||
return race.getPassiveValue(PassiveType.deathEquipmentPreserve).round();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// 연속 공격 가능 여부 (Refactor Monk 패시브)
|
||||
bool hasMultiAttack(ClassTraits klass) {
|
||||
return klass.hasPassive(ClassPassiveType.multiAttack);
|
||||
|
||||
259
lib/src/core/engine/task_generator.dart
Normal file
259
lib/src/core/engine/task_generator.dart
Normal file
@@ -0,0 +1,259 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:asciineverdie/data/game_text_l10n.dart' as l10n;
|
||||
import 'package:asciineverdie/src/shared/animation/monster_size.dart';
|
||||
import 'package:asciineverdie/src/core/engine/act_progression_service.dart';
|
||||
import 'package:asciineverdie/src/core/engine/combat_calculator.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_grade.dart';
|
||||
import 'package:asciineverdie/src/core/model/pq_config.dart';
|
||||
import 'package:asciineverdie/src/core/util/balance_constants.dart';
|
||||
import 'package:asciineverdie/src/core/util/pq_logic.dart' as pq_logic;
|
||||
|
||||
/// 태스크 생성 서비스
|
||||
///
|
||||
/// ProgressService에서 분리된 다음 태스크 생성 로직 담당:
|
||||
/// - 시장 이동, 전환 태스크, 보스 리트라이, 몬스터 전투 생성
|
||||
class TaskGenerator {
|
||||
const TaskGenerator({required this.config});
|
||||
|
||||
final PqConfig config;
|
||||
|
||||
/// 큐가 비어있을 때 다음 태스크 생성 (원본 Dequeue 667-684줄)
|
||||
({ProgressState progress, QueueState queue}) generateNextTask(
|
||||
GameState state,
|
||||
) {
|
||||
var progress = state.progress;
|
||||
final queue = state.queue;
|
||||
final oldTaskType = progress.currentTask.type;
|
||||
|
||||
// 1. Encumbrance 초과 시 시장 이동
|
||||
if (_shouldGoToMarket(progress)) {
|
||||
return _createMarketTask(progress, queue);
|
||||
}
|
||||
|
||||
// 2. 전환 태스크 (buying/heading)
|
||||
if (_needsTransitionTask(oldTaskType)) {
|
||||
return _createTransitionTask(state, progress, queue);
|
||||
}
|
||||
|
||||
// 3. Act Boss 리트라이
|
||||
if (state.progress.pendingActCompletion) {
|
||||
return _createActBossRetryTask(state, progress, queue);
|
||||
}
|
||||
|
||||
// 4. 최종 보스 전투
|
||||
if (state.progress.finalBossState == FinalBossState.fighting &&
|
||||
!state.progress.isInBossLevelingMode) {
|
||||
if (state.progress.bossLevelingEndTime != null) {
|
||||
progress = progress.copyWith(clearBossLevelingEndTime: true);
|
||||
}
|
||||
final actProgressionService = ActProgressionService(config: config);
|
||||
return actProgressionService.startFinalBossFight(state, progress, queue);
|
||||
}
|
||||
|
||||
// 5. 일반 몬스터 전투
|
||||
return _createMonsterTask(state, progress, queue);
|
||||
}
|
||||
|
||||
/// 시장 이동 조건 확인
|
||||
bool _shouldGoToMarket(ProgressState progress) {
|
||||
return progress.encumbrance.position >= progress.encumbrance.max &&
|
||||
progress.encumbrance.max > 0;
|
||||
}
|
||||
|
||||
/// 전환 태스크 필요 여부 확인
|
||||
bool _needsTransitionTask(TaskType oldTaskType) {
|
||||
return oldTaskType != TaskType.kill &&
|
||||
oldTaskType != TaskType.neutral &&
|
||||
oldTaskType != TaskType.buying;
|
||||
}
|
||||
|
||||
/// 시장 이동 태스크 생성
|
||||
({ProgressState progress, QueueState queue}) _createMarketTask(
|
||||
ProgressState progress,
|
||||
QueueState queue,
|
||||
) {
|
||||
final taskResult = pq_logic.startTask(
|
||||
progress,
|
||||
l10n.taskHeadingToMarket(),
|
||||
4 * 1000,
|
||||
);
|
||||
final updatedProgress = taskResult.progress.copyWith(
|
||||
currentTask: TaskInfo(caption: taskResult.caption, type: TaskType.market),
|
||||
currentCombat: null,
|
||||
);
|
||||
return (progress: updatedProgress, queue: queue);
|
||||
}
|
||||
|
||||
/// 전환 태스크 생성 (buying 또는 heading)
|
||||
({ProgressState progress, QueueState queue}) _createTransitionTask(
|
||||
GameState state,
|
||||
ProgressState progress,
|
||||
QueueState queue,
|
||||
) {
|
||||
final gold = state.inventory.gold;
|
||||
final equipPrice = state.traits.level * 50;
|
||||
|
||||
// Gold 충분 시 장비 구매
|
||||
if (gold > equipPrice) {
|
||||
final taskResult = pq_logic.startTask(
|
||||
progress,
|
||||
l10n.taskUpgradingHardware(),
|
||||
5 * 1000,
|
||||
);
|
||||
final updatedProgress = taskResult.progress.copyWith(
|
||||
currentTask: TaskInfo(
|
||||
caption: taskResult.caption,
|
||||
type: TaskType.buying,
|
||||
),
|
||||
currentCombat: null,
|
||||
);
|
||||
return (progress: updatedProgress, queue: queue);
|
||||
}
|
||||
|
||||
// Gold 부족 시 전장 이동
|
||||
final taskResult = pq_logic.startTask(
|
||||
progress,
|
||||
l10n.taskEnteringDebugZone(),
|
||||
4 * 1000,
|
||||
);
|
||||
final updatedProgress = taskResult.progress.copyWith(
|
||||
currentTask: TaskInfo(
|
||||
caption: taskResult.caption,
|
||||
type: TaskType.neutral,
|
||||
),
|
||||
currentCombat: null,
|
||||
);
|
||||
return (progress: updatedProgress, queue: queue);
|
||||
}
|
||||
|
||||
/// Act Boss 재도전 태스크 생성
|
||||
({ProgressState progress, QueueState queue}) _createActBossRetryTask(
|
||||
GameState state,
|
||||
ProgressState progress,
|
||||
QueueState queue,
|
||||
) {
|
||||
final actProgressionService = ActProgressionService(config: config);
|
||||
final actBoss = actProgressionService.createActBoss(state);
|
||||
final combatCalculator = CombatCalculator(rng: state.rng);
|
||||
final durationMillis = combatCalculator.estimateCombatDurationMs(
|
||||
player: actBoss.playerStats,
|
||||
monster: actBoss.monsterStats,
|
||||
);
|
||||
|
||||
final taskResult = pq_logic.startTask(
|
||||
progress,
|
||||
l10n.taskDebugging(actBoss.monsterStats.name),
|
||||
durationMillis,
|
||||
);
|
||||
|
||||
final updatedProgress = taskResult.progress.copyWith(
|
||||
currentTask: TaskInfo(
|
||||
caption: taskResult.caption,
|
||||
type: TaskType.kill,
|
||||
monsterBaseName: actBoss.monsterStats.name,
|
||||
monsterPart: '*',
|
||||
monsterLevel: actBoss.monsterStats.level,
|
||||
monsterGrade: MonsterGrade.boss,
|
||||
monsterSize: getBossSizeForAct(state.progress.plotStageCount),
|
||||
),
|
||||
currentCombat: actBoss,
|
||||
);
|
||||
|
||||
return (progress: updatedProgress, queue: queue);
|
||||
}
|
||||
|
||||
/// 일반 몬스터 전투 태스크 생성
|
||||
({ProgressState progress, QueueState queue}) _createMonsterTask(
|
||||
GameState state,
|
||||
ProgressState progress,
|
||||
QueueState queue,
|
||||
) {
|
||||
final level = state.traits.level;
|
||||
|
||||
// 퀘스트 몬스터 데이터 확인
|
||||
final questMonster = state.progress.currentQuestMonster;
|
||||
final questMonsterData = questMonster?.monsterData;
|
||||
final questLevel = questMonsterData != null
|
||||
? int.tryParse(questMonsterData.split('|').elementAtOrNull(1) ?? '') ??
|
||||
0
|
||||
: null;
|
||||
|
||||
// 몬스터 생성
|
||||
final monsterResult = pq_logic.monsterTask(
|
||||
config,
|
||||
state.rng,
|
||||
level,
|
||||
questMonsterData,
|
||||
questLevel,
|
||||
);
|
||||
|
||||
// 몬스터 레벨 조정 (밸런스)
|
||||
final actMinLevel = ActMonsterLevel.forPlotStage(
|
||||
state.progress.plotStageCount,
|
||||
);
|
||||
final baseLevel = math.max(level, actMinLevel);
|
||||
final effectiveMonsterLevel = monsterResult.level
|
||||
.clamp(math.max(1, baseLevel - 3), baseLevel + 3)
|
||||
.toInt();
|
||||
|
||||
// 전투 스탯 생성
|
||||
final playerCombatStats = CombatStats.fromStats(
|
||||
stats: state.stats,
|
||||
equipment: state.equipment,
|
||||
level: level,
|
||||
monsterLevel: effectiveMonsterLevel,
|
||||
);
|
||||
|
||||
final monsterCombatStats = MonsterCombatStats.fromLevel(
|
||||
name: monsterResult.displayName,
|
||||
level: effectiveMonsterLevel,
|
||||
speedType: MonsterCombatStats.inferSpeedType(monsterResult.baseName),
|
||||
plotStageCount: state.progress.plotStageCount,
|
||||
);
|
||||
|
||||
// 전투 상태 및 지속시간
|
||||
final combatState = CombatState.start(
|
||||
playerStats: playerCombatStats,
|
||||
monsterStats: monsterCombatStats,
|
||||
);
|
||||
|
||||
final combatCalculator = CombatCalculator(rng: state.rng);
|
||||
final durationMillis = combatCalculator.estimateCombatDurationMs(
|
||||
player: playerCombatStats,
|
||||
monster: monsterCombatStats,
|
||||
);
|
||||
|
||||
final taskResult = pq_logic.startTask(
|
||||
progress,
|
||||
l10n.taskDebugging(monsterResult.displayName),
|
||||
durationMillis,
|
||||
);
|
||||
|
||||
// 몬스터 사이즈 결정
|
||||
final monsterSize = getMonsterSizeForAct(
|
||||
plotStageCount: state.progress.plotStageCount,
|
||||
grade: monsterResult.grade,
|
||||
rng: state.rng,
|
||||
);
|
||||
|
||||
final updatedProgress = taskResult.progress.copyWith(
|
||||
currentTask: TaskInfo(
|
||||
caption: taskResult.caption,
|
||||
type: TaskType.kill,
|
||||
monsterBaseName: monsterResult.baseName,
|
||||
monsterPart: monsterResult.part,
|
||||
monsterLevel: effectiveMonsterLevel,
|
||||
monsterGrade: monsterResult.grade,
|
||||
monsterSize: monsterSize,
|
||||
),
|
||||
currentCombat: combatState,
|
||||
);
|
||||
|
||||
return (progress: updatedProgress, queue: queue);
|
||||
}
|
||||
}
|
||||
256
lib/src/core/engine/test_character_service.dart
Normal file
256
lib/src/core/engine/test_character_service.dart
Normal file
@@ -0,0 +1,256 @@
|
||||
import 'package:asciineverdie/data/skill_data.dart';
|
||||
import 'package:asciineverdie/src/core/engine/item_service.dart';
|
||||
import 'package:asciineverdie/src/core/model/combat_stats.dart';
|
||||
import 'package:asciineverdie/src/core/model/equipment_item.dart';
|
||||
import 'package:asciineverdie/src/core/model/equipment_slot.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/hall_of_fame.dart';
|
||||
import 'package:asciineverdie/src/core/model/item_stats.dart';
|
||||
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||
import 'package:asciineverdie/src/core/util/roman.dart';
|
||||
|
||||
/// 테스트 캐릭터 생성 서비스 (디버그 모드 전용)
|
||||
///
|
||||
/// 현재 캐릭터를 레벨 100, 고급 장비, 다수의 스킬을 가진
|
||||
/// 캐릭터로 변환하여 명예의 전당에 등록할 수 있게 함.
|
||||
class TestCharacterService {
|
||||
TestCharacterService({required this.rng});
|
||||
|
||||
final DeterministicRandom rng;
|
||||
|
||||
/// 테스트 캐릭터 데이터 생성
|
||||
///
|
||||
/// 현재 GameState를 기반으로:
|
||||
/// - 레벨 100
|
||||
/// - 장비: Rare+, 최소 Epic 2개, Legendary 1개
|
||||
/// - 스킬: 20~30개 랜덤
|
||||
HallOfFameEntry createTestCharacter(GameState state) {
|
||||
// 1. 장비 생성 (Rare+, Epic 2+, Legendary 1+)
|
||||
final equipment = _generateTestEquipment();
|
||||
|
||||
// 2. 스킬 생성 (20~30개)
|
||||
final skills = _generateTestSkills();
|
||||
|
||||
// 3. 레벨 100 기준 스탯 계산
|
||||
final testStats = _generateTestStats();
|
||||
|
||||
// 4. CombatStats 계산
|
||||
final combatStats = CombatStats.fromStats(
|
||||
stats: testStats,
|
||||
equipment: equipment,
|
||||
level: 100,
|
||||
);
|
||||
|
||||
// 5. HallOfFameEntry 생성
|
||||
return HallOfFameEntry(
|
||||
id: DateTime.now().millisecondsSinceEpoch.toString(),
|
||||
characterName: state.traits.name,
|
||||
race: state.traits.race,
|
||||
raceId: state.traits.raceId,
|
||||
klass: state.traits.klass,
|
||||
level: 100,
|
||||
totalPlayTimeMs: 36000000, // 10시간 (테스트용 기본값)
|
||||
totalDeaths: rng.nextInt(50), // 0~49 랜덤 사망 횟수
|
||||
monstersKilled: 5000 + rng.nextInt(5000), // 5000~10000 처치
|
||||
questsCompleted: 100 + rng.nextInt(50), // 100~150 퀘스트
|
||||
clearedAt: DateTime.now(),
|
||||
finalStats: combatStats,
|
||||
finalEquipment: equipment.items,
|
||||
finalSkills: skills,
|
||||
);
|
||||
}
|
||||
|
||||
/// 테스트용 장비 생성
|
||||
///
|
||||
/// 조건:
|
||||
/// - 모든 장비 Rare 이상
|
||||
/// - 최소 Epic 2개
|
||||
/// - 최소 Legendary 1개
|
||||
Equipment _generateTestEquipment() {
|
||||
final itemService = ItemService(rng: rng);
|
||||
final items = <EquipmentItem>[];
|
||||
|
||||
// 희귀도 분배 결정
|
||||
// 11개 슬롯: 1 Legendary, 2 Epic, 나머지 Rare
|
||||
final rarities = <ItemRarity>[
|
||||
ItemRarity.legendary, // 1개
|
||||
ItemRarity.epic, ItemRarity.epic, // 2개
|
||||
ItemRarity.rare, ItemRarity.rare, ItemRarity.rare, // 3개
|
||||
ItemRarity.rare, ItemRarity.rare, ItemRarity.rare, // 3개
|
||||
ItemRarity.rare, ItemRarity.rare, // 2개
|
||||
];
|
||||
|
||||
// 희귀도 셔플
|
||||
_shuffleList(rarities);
|
||||
|
||||
// 각 슬롯별 장비 생성
|
||||
for (var i = 0; i < Equipment.slotCount; i++) {
|
||||
final slot = EquipmentSlot.values[i];
|
||||
final rarity = rarities[i];
|
||||
final name = _generateEquipmentName(slot, rarity);
|
||||
|
||||
final item = itemService.generateEquipment(
|
||||
name: name,
|
||||
slot: slot,
|
||||
level: 100,
|
||||
rarity: rarity,
|
||||
);
|
||||
items.add(item);
|
||||
}
|
||||
|
||||
// Legendary 슬롯을 bestIndex로 설정
|
||||
final legendaryIndex = rarities.indexOf(ItemRarity.legendary);
|
||||
|
||||
return Equipment(items: items, bestIndex: legendaryIndex);
|
||||
}
|
||||
|
||||
/// 희귀도에 맞는 장비 이름 생성
|
||||
String _generateEquipmentName(EquipmentSlot slot, ItemRarity rarity) {
|
||||
final prefixes = switch (rarity) {
|
||||
ItemRarity.legendary => [
|
||||
'Divine',
|
||||
'Mythical',
|
||||
'Godlike',
|
||||
'Eternal',
|
||||
'Transcendent',
|
||||
],
|
||||
ItemRarity.epic => [
|
||||
'Ancient',
|
||||
'Infernal',
|
||||
'Celestial',
|
||||
'Void',
|
||||
'Corrupted',
|
||||
],
|
||||
ItemRarity.rare => [
|
||||
'Superior',
|
||||
'Enchanted',
|
||||
'Reinforced',
|
||||
'Blessed',
|
||||
'Refined',
|
||||
],
|
||||
_ => ['Standard', 'Basic', 'Common'],
|
||||
};
|
||||
|
||||
final slotNames = switch (slot) {
|
||||
EquipmentSlot.weapon => [
|
||||
'Keyboard of Power',
|
||||
'Binary Blade',
|
||||
'Compiler Crusher',
|
||||
],
|
||||
EquipmentSlot.shield => [
|
||||
'Firewall Shield',
|
||||
'Exception Handler',
|
||||
'Null Guard',
|
||||
],
|
||||
EquipmentSlot.helm => ['Neural Helm', 'Thought Processor', 'Mind Buffer'],
|
||||
EquipmentSlot.hauberk => ['Matrix Armor', 'Byte Mail', 'Kernel Plate'],
|
||||
EquipmentSlot.brassairts => [
|
||||
'Bit Guards',
|
||||
'Stream Bracers',
|
||||
'Thread Wraps',
|
||||
],
|
||||
EquipmentSlot.vambraces => [
|
||||
'Code Vambraces',
|
||||
'Debug Cuffs',
|
||||
'Loop Guards',
|
||||
],
|
||||
EquipmentSlot.gauntlets => [
|
||||
'Input Gloves',
|
||||
'Handler Mitts',
|
||||
'Pointer Grips',
|
||||
],
|
||||
EquipmentSlot.gambeson => ['Layer Vest', 'Cache Coat', 'Buffer Jacket'],
|
||||
EquipmentSlot.cuisses => [
|
||||
'Register Guards',
|
||||
'Stack Protectors',
|
||||
'Heap Leggings',
|
||||
],
|
||||
EquipmentSlot.greaves => [
|
||||
'Runtime Greaves',
|
||||
'Compile Shins',
|
||||
'Execute Boots',
|
||||
],
|
||||
EquipmentSlot.sollerets => [
|
||||
'Boot Loader',
|
||||
'System Treads',
|
||||
'Process Soles',
|
||||
],
|
||||
};
|
||||
|
||||
final prefix = prefixes[rng.nextInt(prefixes.length)];
|
||||
final slotName = slotNames[rng.nextInt(slotNames.length)];
|
||||
|
||||
return '$prefix $slotName';
|
||||
}
|
||||
|
||||
/// 테스트용 스킬 생성 (20~30개)
|
||||
///
|
||||
/// SkillData.spellNameToSkill에 정의된 전투 스킬만 선택
|
||||
List<Map<String, String>> _generateTestSkills() {
|
||||
// 전투에서 실제로 사용 가능한 스킬 목록
|
||||
final validSpells = SkillData.spellNameToSkill.keys.toList();
|
||||
final skillCount = 20 + rng.nextInt(11); // 20~30개
|
||||
final selectedSpells = <String>{};
|
||||
final skills = <Map<String, String>>[];
|
||||
|
||||
// 중복 없이 스킬 선택
|
||||
while (selectedSpells.length < skillCount &&
|
||||
selectedSpells.length < validSpells.length) {
|
||||
final index = rng.nextInt(validSpells.length);
|
||||
final spell = validSpells[index];
|
||||
if (selectedSpells.add(spell)) {
|
||||
// 랭크: V~X 랜덤 (레벨 100 기준 높은 랭크)
|
||||
final rank = _randomHighRank();
|
||||
skills.add({'name': spell, 'rank': rank});
|
||||
}
|
||||
}
|
||||
|
||||
return skills;
|
||||
}
|
||||
|
||||
/// 높은 랭크 생성 (V~X 선호)
|
||||
String _randomHighRank() {
|
||||
// 5~10 범위 (V~X)
|
||||
final rankValue = 5 + rng.nextInt(6);
|
||||
return intToRoman(rankValue);
|
||||
}
|
||||
|
||||
/// 테스트용 스탯 생성 (레벨 100 기준)
|
||||
Stats _generateTestStats() {
|
||||
// 레벨 100 기준 높은 스탯
|
||||
// 기본 스탯: 50~80 범위
|
||||
final str = 50 + rng.nextInt(31);
|
||||
final con = 50 + rng.nextInt(31);
|
||||
final dex = 50 + rng.nextInt(31);
|
||||
final int_ = 50 + rng.nextInt(31);
|
||||
final wis = 50 + rng.nextInt(31);
|
||||
final cha = 50 + rng.nextInt(31);
|
||||
|
||||
// HP/MP 계산 (레벨 100 기준)
|
||||
final hpMax = 500 + con * 10;
|
||||
final mpMax = 200 + int_ * 5 + wis * 3;
|
||||
|
||||
return Stats(
|
||||
str: str,
|
||||
con: con,
|
||||
dex: dex,
|
||||
intelligence: int_,
|
||||
wis: wis,
|
||||
cha: cha,
|
||||
hpMax: hpMax,
|
||||
mpMax: mpMax,
|
||||
hpCurrent: hpMax,
|
||||
mpCurrent: mpMax,
|
||||
);
|
||||
}
|
||||
|
||||
/// 리스트 셔플 (Fisher-Yates)
|
||||
void _shuffleList<T>(List<T> list) {
|
||||
for (var i = list.length - 1; i > 0; i--) {
|
||||
final j = rng.nextInt(i + 1);
|
||||
final temp = list[i];
|
||||
list[i] = list[j];
|
||||
list[j] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user