Skip to content

Commit 5017168

Browse files
committedDec 23, 2023
update transaction and dice type def
1 parent 18a5feb commit 5017168

26 files changed

+191
-73
lines changed
 

‎coc-dan-backend/migration/src/m20231210_000006_create_transaction.rs

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ impl MigrationTrait for Migration {
1919
.primary_key()
2020
.auto_increment()
2121
)
22+
.col(ColumnDef::new(Transaction::TxId).integer().not_null())
2223
.col(
2324
ColumnDef::new(Transaction::StageUuid)
2425
.uuid()
@@ -29,6 +30,8 @@ impl MigrationTrait for Migration {
2930
.integer()
3031
.not_null()
3132
)
33+
.col(ColumnDef::new(Transaction::Time).date_time().not_null())
34+
.col(ColumnDef::new(Transaction::Tx).json().not_null())
3235
.foreign_key(
3336
ForeignKey::create()
3437
.name("fk-tx-user_id")
@@ -56,6 +59,9 @@ impl MigrationTrait for Migration {
5659
pub enum Transaction {
5760
Table,
5861
Id,
62+
TxId,
5963
StageUuid,
6064
UserId,
65+
Time,
66+
Tx
6167
}

‎coc-dan-backend/resource/occupation.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"occupational_skills" : [
88
"Accounting",
99
"Law",
10-
"Library Use",
10+
"LibraryUse",
1111
"Listen",
1212
"Persuade",
13-
"Spot Hidden",
13+
"SpotHidden",
1414
{
1515
"category" : "Any",
1616
"candidates" : [],
@@ -27,7 +27,7 @@
2727
"Accounting",
2828
{
2929
"category" : "ArtAndCraft",
30-
"candidates" : ["Typing", "Short Hand"],
30+
"candidates" : ["Typing", "ShortHand"],
3131
"limit" : 1
3232
},
3333
{
@@ -38,7 +38,7 @@
3838
"Language",
3939
{
4040
"category" : "Custom",
41-
"candidates" : ["Library Use", "Computer Use"],
41+
"candidates" : ["LibraryUse", "ComputerUse"],
4242
"limit" : 1
4343
},
4444
"Psychoanalysis",

‎coc-dan-backend/resource/skills.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@
3030
"category" : "None"
3131
},
3232
{
33-
"name" : "Computer Use",
33+
"name" : "ComputerUse",
3434
"initial" : 5,
3535
"era" : "Contemporary",
3636
"category" : "None"
3737
},
3838
{
39-
"name" : "Credit Rating",
39+
"name" : "CreditRating",
4040
"initial" : 0,
4141
"era" : "None",
4242
"category" : "None"
4343
},
4444
{
45-
"name" : "Cthulhu Mythos",
45+
"name" : "CthulhuMythos",
4646
"initial" : 0,
4747
"era" : "None",
4848
"category" : "None"
@@ -66,7 +66,7 @@
6666
"category" : "None"
6767
},
6868
{
69-
"name" : "Electrical Repair",
69+
"name" : "ElectricalRepair",
7070
"initial" : 10,
7171
"era" : "Modern",
7272
"category" : "None"
@@ -78,7 +78,7 @@
7878
"category" : "None"
7979
},
8080
{
81-
"name" : "Fast Talk",
81+
"name" : "FastTalk",
8282
"initial" : 5,
8383
"era" : "None",
8484
"category" : "Social"
@@ -102,7 +102,7 @@
102102
"category" : "None"
103103
},
104104
{
105-
"name" : "First Aid",
105+
"name" : "FirstAid",
106106
"initial" : 30,
107107
"era" : "None",
108108
"category" : "None"
@@ -132,7 +132,7 @@
132132
"category" : "None"
133133
},
134134
{
135-
"name" : "Language (Other)",
135+
"name" : "Language(Other)",
136136
"initial" : 1,
137137
"era" : "None",
138138
"category" : "None"
@@ -144,7 +144,7 @@
144144
"category" : "None"
145145
},
146146
{
147-
"name" : "Library Use",
147+
"name" : "LibraryUse",
148148
"initial" : 20,
149149
"era" : "None",
150150
"category" : "None"
@@ -162,7 +162,7 @@
162162
"category" : "None"
163163
},
164164
{
165-
"name" : "Mechanical Repair",
165+
"name" : "MechanicalRepair",
166166
"initial" : 10,
167167
"era" : "Modern",
168168
"category" : "None"
@@ -174,7 +174,7 @@
174174
"category" : "None"
175175
},
176176
{
177-
"name" : "Natural World",
177+
"name" : "NaturalWorld",
178178
"initial" : 10,
179179
"era" : "None",
180180
"category" : "None"
@@ -192,7 +192,7 @@
192192
"category" : "None"
193193
},
194194
{
195-
"name" : "Operate Heavy Machinery",
195+
"name" : "OperateHeavyMachinery",
196196
"initial" : 1,
197197
"era" : "Modern",
198198
"category" : "None"
@@ -234,13 +234,13 @@
234234
"category" : "None"
235235
},
236236
{
237-
"name" : "Sleight of Hand",
237+
"name" : "SleightOfHand",
238238
"initial" : 10,
239239
"era" : "None",
240240
"category" : "None"
241241
},
242242
{
243-
"name" : "Spot Hidden",
243+
"name" : "SpotHidden",
244244
"initial" : 25,
245245
"era" : "None",
246246
"category" : "None"
@@ -276,7 +276,7 @@
276276
"category" : "ArtAndCraft"
277277
},
278278
{
279-
"name" : "Short Hand",
279+
"name" : "ShortHand",
280280
"initial" : 9,
281281
"era" : "None",
282282
"category" : "ArtAndCraft"

‎coc-dan-backend/src/def/avatar.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use super::skills::{Occupation, OCCUPATIONS, SkillAssigned};
88

99
use super::weapon::Weapon;
1010

11-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq)]
11+
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Debug, Clone)]
1212
#[ts(export, rename = "IGender", export_to = "bindings/avatar/IGender.ts")]
1313
pub enum Gender {
1414
Other,
@@ -22,15 +22,15 @@ impl Default for Gender {
2222
}
2323
}
2424

25-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Default)]
25+
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Default, Debug, Clone)]
2626
#[ts(export, rename = "IDescriptor", export_to = "bindings/avatar/IDescriptor.ts")]
2727
pub struct Descriptor {
2828
age : u32,
2929
gender : Gender,
3030
homeland : String,
3131
}
3232

33-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq)]
33+
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Debug, Clone)]
3434
#[ts(export, rename = "IMentalStatus", export_to = "bindings/avatar/IMentalStatus.ts")]
3535
pub enum MentalStatus {
3636
Lucid,
@@ -40,7 +40,7 @@ pub enum MentalStatus {
4040
PermanentInsanity
4141
}
4242

43-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq)]
43+
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Debug, Clone)]
4444
#[ts(export, rename = "IHealthStatus", export_to = "bindings/avatar/IHealthStatus.ts")]
4545
pub enum HealthStatus {
4646
Healthy,
@@ -50,7 +50,7 @@ pub enum HealthStatus {
5050
Dead
5151
}
5252

53-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq)]
53+
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Debug, Clone)]
5454
#[ts(export, rename = "IStatus", export_to = "bindings/avatar/IStatus.ts")]
5555
pub struct Status {
5656
pub hp : u32,
@@ -78,7 +78,7 @@ impl Default for Status {
7878
}
7979
}
8080

81-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Default)]
81+
#[derive(serde::Deserialize, serde::Serialize, TS, PartialEq, Default, Debug, Clone)]
8282
#[ts(export, rename = "ICharacteristics", export_to = "bindings/avatar/ICharacteristics.ts")]
8383
pub struct Characteristics {
8484
pub str : u32,
@@ -94,7 +94,7 @@ pub struct Characteristics {
9494
pub mov_adj : Option<f32>
9595
}
9696

97-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Debug, Clone)]
97+
#[derive(serde::Deserialize, serde::Serialize, TS, PartialEq, Debug, Clone)]
9898
#[ts(export, rename = "ICharacteristicEnum", export_to = "bindings/avatar/ICharacteristicEnum.ts")]
9999
#[serde(rename_all = "lowercase")]
100100
pub enum Characteristic {
@@ -110,27 +110,27 @@ pub enum Characteristic {
110110
Luk
111111
}
112112

113-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq)]
113+
#[derive(serde::Deserialize, serde::Serialize, TS, PartialEq, Debug, Clone)]
114114
#[ts(export, rename = "ICustomEquipment", export_to = "bindings/ICustomEquipment.ts")]
115115
pub struct CustomEquipment {
116116
pub description : String
117117
}
118118

119-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq)]
119+
#[derive(serde::Deserialize, serde::Serialize, TS, PartialEq, Debug, Clone)]
120120
#[ts(export, rename = "IEquipmentItem", export_to = "bindings/IEquipmentItem.ts")]
121121
pub enum EquipmentItem {
122122
Weapon(Weapon),
123123
Custom(CustomEquipment)
124124
}
125125

126-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq)]
126+
#[derive(serde::Deserialize, serde::Serialize, TS, PartialEq, Debug, Clone)]
127127
#[ts(export, rename = "IEquipment", export_to = "bindings/IEquipment.ts")]
128128
pub struct Equipment {
129129
pub name : String,
130130
pub item : EquipmentItem
131131
}
132132

133-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq)]
133+
#[derive(serde::Deserialize, serde::Serialize, TS, PartialEq, Debug, Clone)]
134134
#[ts(export, rename = "IDetail", export_to = "bindings/avatar/IDetail.ts")]
135135
pub struct Detail {
136136
pub status : Status,
@@ -158,7 +158,7 @@ impl Default for Detail {
158158
}
159159
}
160160

161-
#[derive(serde::Deserialize, serde::Serialize, TS, PartialEq)]
161+
#[derive(serde::Deserialize, serde::Serialize, TS, PartialEq, Debug, Clone)]
162162
#[ts(export, rename = "IAvatar", export_to = "bindings/IAvatar.ts")]
163163
pub struct IAvatar {
164164
pub id: i32,

‎coc-dan-backend/src/def/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub mod skills;
55
pub mod dice;
66
pub mod weapon;
77
pub mod common;
8+
pub mod transaction;
89

910
pub use map::Area;
1011
pub use map::GameMap;

‎coc-dan-backend/src/def/skills.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl Default for SkillAssignType {
9191
}
9292
}
9393

94-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Default, Debug)]
94+
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Default, Debug, Clone)]
9595
#[ts(export, rename = "ISkillAssigned", export_to = "bindings/avatar/ISkillAssigned.ts")]
9696
pub struct SkillAssigned {
9797
pub name : String,
+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
use ts_rs::TS;
2+
3+
use super::avatar::IAvatar;
4+
5+
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, PartialEq, TS)]
6+
#[ts(export, rename = "ITransaction", export_to = "bindings/tx/ITransaction.ts")]
7+
pub struct ITransaction {
8+
pub id : i32,
9+
pub tx_id : i32,
10+
pub stage_uuid : String,
11+
pub user_id : i32,
12+
pub time : String,
13+
pub tx : Tx
14+
}
15+
16+
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, PartialEq, TS)]
17+
#[ts(export, rename = "ITx", export_to = "bindings/tx/ITx.ts")]
18+
pub enum Tx {
19+
Speak (Speak),
20+
Dice (Dice),
21+
UpdateAvatar {
22+
before : IAvatar,
23+
after : IAvatar
24+
}
25+
}
26+
27+
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, PartialEq, TS)]
28+
#[ts(export, rename = "ISpeak", export_to = "bindings/tx/ISpeak.ts")]
29+
pub struct Speak {
30+
pub message : String
31+
}
32+
33+
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, PartialEq, TS)]
34+
#[ts(export, rename = "IDice", export_to = "bindings/dice/IDice.ts")]
35+
pub struct Dice {
36+
pub tx_id : u32,
37+
pub result : DiceResult,
38+
pub command : String, // sc 1/1d3, rc str, rb LibraryUse....
39+
}
40+
41+
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, PartialEq, TS)]
42+
#[ts(export, rename = "IDiceResult", export_to = "bindings/dice/IDiceResult.ts")]
43+
pub enum DiceResult {
44+
DiceNaive (DiceNaive),
45+
DiceCheck (DiceCheck),
46+
DiceSanCheck (DiceSanCheck)
47+
}
48+
49+
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, PartialEq, TS)]
50+
#[ts(export, rename = "IDiceNaive", export_to = "bindings/dice/IDiceNaive.ts")]
51+
pub struct DiceNaive { // naive dice, r1d3, r2d10, r1d100 * 2......
52+
pub result : u32
53+
}
54+
55+
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, PartialEq, TS)]
56+
#[ts(export, rename = "IDiceCheck", export_to = "bindings/dice/IDiceCheck.ts")]
57+
pub struct DiceCheck { // check dice, rc str, rc pow, rc str/2
58+
pub result : u32,
59+
pub rate_of_success : u32,
60+
pub dice_against : String // what you are dicing against
61+
}
62+
63+
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, PartialEq, TS)]
64+
#[ts(export, rename = "IDiceSanLoss", export_to = "bindings/dice/IDiceSanLoss.ts")]
65+
pub enum DiceSanLoss {
66+
Success (u32),
67+
Failure (u32)
68+
}
69+
70+
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, PartialEq, TS)]
71+
#[ts(export, rename = "IDiceSanCheck", export_to = "bindings/dice/IDiceSanCheck.ts")]
72+
pub struct DiceSanCheck { // sc 1/1d3
73+
pub san_check : u32, // san check dice rolled out
74+
pub san_loss : DiceSanLoss
75+
}

‎coc-dan-backend/src/def/weapon.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ impl Default for ExtraEffect {
4343
}
4444
}
4545

46-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Default, Debug)]
46+
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Default, Debug, Clone)]
4747
#[ts(export, rename = "IWeaponDamage", export_to = "bindings/weapon/IWeaponDamage.ts")]
4848
pub struct WeaponDamage {
4949
pub dice : String, // Dice command like 1d3, 2d6, 4D6+2/2D6+1/1D4, etc...
5050
pub side_effect : Option<ExtraEffect>
5151
}
5252

53-
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Default, Debug)]
53+
#[derive(serde::Serialize, serde::Deserialize, TS, PartialEq, Default, Debug, Clone)]
5454
#[ts(export, rename = "IWeapon", export_to = "bindings/weapon/IWeapon.ts")]
5555
pub struct Weapon {
5656
pub name : String,

‎coc-dan-backend/src/entities/transaction.rs

+3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ use serde::Serialize;
88
pub struct Model {
99
#[sea_orm(primary_key)]
1010
pub id: i32,
11+
pub tx_id: i32,
1112
pub stage_uuid: String,
1213
pub user_id: i32,
14+
pub time: String,
15+
pub tx: String,
1316
}
1417

1518
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2+
import type { IDiceResult } from "./IDiceResult";
3+
4+
export interface IDice { tx_id: number, result: IDiceResult, command: string, }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2+
3+
export interface IDiceCheck { result: number, rate_of_success: number, dice_against: string, }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2+
3+
export interface IDiceNaive { result: number, }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2+
import type { IDiceCheck } from "./IDiceCheck";
3+
import type { IDiceNaive } from "./IDiceNaive";
4+
import type { IDiceSanCheck } from "./IDiceSanCheck";
5+
6+
export type IDiceResult = { "DiceNaive": IDiceNaive } | { "DiceCheck": IDiceCheck } | { "DiceSanCheck": IDiceSanCheck };
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2+
import type { IDiceSanLoss } from "./IDiceSanLoss";
3+
4+
export interface IDiceSanCheck { san_check: number, san_loss: IDiceSanLoss, }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2+
3+
export type IDiceSanLoss = { "Success": number } | { "Failure": number };
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2+
3+
export interface ISpeak { message: string, }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2+
import type { ITx } from "./ITx";
3+
4+
export interface ITransaction { id: number, tx_id: number, stage_uuid: string, user_id: number, time: string, tx: ITx, }
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2+
import type { IAvatar } from "../IAvatar";
3+
import type { IDice } from "../dice/IDice";
4+
import type { ISpeak } from "./ISpeak";
5+
6+
export type ITx = { "Speak": ISpeak } | { "Dice": IDice } | { "UpdateAvatar": { before: IAvatar, after: IAvatar, } };

‎coc-dan-frontend/src/core/card/occupation.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"occupational_skills" : [
88
"Accounting",
99
"Law",
10-
"Library Use",
10+
"LibraryUse",
1111
"Listen",
1212
"Persuade",
13-
"Spot Hidden",
13+
"SpotHidden",
1414
{
1515
"category" : "Any",
1616
"candidates" : [],
@@ -27,7 +27,7 @@
2727
"Accounting",
2828
{
2929
"category" : "ArtAndCraft",
30-
"candidates" : ["Typing", "Short Hand"],
30+
"candidates" : ["Typing", "ShortHand"],
3131
"limit" : 1
3232
},
3333
{
@@ -38,7 +38,7 @@
3838
"Language",
3939
{
4040
"category" : "Custom",
41-
"candidates" : ["Library Use", "Computer Use"],
41+
"candidates" : ["LibraryUse", "ComputerUse"],
4242
"limit" : 1
4343
},
4444
"Psychoanalysis",

‎coc-dan-frontend/src/core/card/resource.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ export function initOccupationalSkill(attrs : ICharacteristics, occupation : IOc
7575
}
7676
}
7777

78-
const creditRating = SKILLS.get("Credit Rating")
78+
const creditRating = SKILLS.get("CreditRating")
7979
if (creditRating == undefined) {
80-
throw Error("Credit Rating not found")
80+
throw Error("CreditRating not found")
8181
}
8282
const language = SKILLS.get("Language")
8383
if (language == undefined) {

‎coc-dan-frontend/src/core/card/skills.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@
3030
"category" : "None"
3131
},
3232
{
33-
"name" : "Computer Use",
33+
"name" : "ComputerUse",
3434
"initial" : 5,
3535
"era" : "Contemporary",
3636
"category" : "None"
3737
},
3838
{
39-
"name" : "Credit Rating",
39+
"name" : "CreditRating",
4040
"initial" : 0,
4141
"era" : "None",
4242
"category" : "None"
4343
},
4444
{
45-
"name" : "Cthulhu Mythos",
45+
"name" : "CthulhuMythos",
4646
"initial" : 0,
4747
"era" : "None",
4848
"category" : "None"
@@ -66,7 +66,7 @@
6666
"category" : "None"
6767
},
6868
{
69-
"name" : "Electrical Repair",
69+
"name" : "ElectricalRepair",
7070
"initial" : 10,
7171
"era" : "Modern",
7272
"category" : "None"
@@ -78,7 +78,7 @@
7878
"category" : "None"
7979
},
8080
{
81-
"name" : "Fast Talk",
81+
"name" : "FastTalk",
8282
"initial" : 5,
8383
"era" : "None",
8484
"category" : "Social"
@@ -102,7 +102,7 @@
102102
"category" : "None"
103103
},
104104
{
105-
"name" : "First Aid",
105+
"name" : "FirstAid",
106106
"initial" : 30,
107107
"era" : "None",
108108
"category" : "None"
@@ -132,7 +132,7 @@
132132
"category" : "None"
133133
},
134134
{
135-
"name" : "Language (Other)",
135+
"name" : "Language(Other)",
136136
"initial" : 1,
137137
"era" : "None",
138138
"category" : "None"
@@ -144,7 +144,7 @@
144144
"category" : "None"
145145
},
146146
{
147-
"name" : "Library Use",
147+
"name" : "LibraryUse",
148148
"initial" : 20,
149149
"era" : "None",
150150
"category" : "None"
@@ -162,7 +162,7 @@
162162
"category" : "None"
163163
},
164164
{
165-
"name" : "Mechanical Repair",
165+
"name" : "MechanicalRepair",
166166
"initial" : 10,
167167
"era" : "Modern",
168168
"category" : "None"
@@ -174,7 +174,7 @@
174174
"category" : "None"
175175
},
176176
{
177-
"name" : "Natural World",
177+
"name" : "NaturalWorld",
178178
"initial" : 10,
179179
"era" : "None",
180180
"category" : "None"
@@ -192,7 +192,7 @@
192192
"category" : "None"
193193
},
194194
{
195-
"name" : "Operate Heavy Machinery",
195+
"name" : "OperateHeavyMachinery",
196196
"initial" : 1,
197197
"era" : "Modern",
198198
"category" : "None"
@@ -234,13 +234,13 @@
234234
"category" : "None"
235235
},
236236
{
237-
"name" : "Sleight of Hand",
237+
"name" : "SleightOfHand",
238238
"initial" : 10,
239239
"era" : "None",
240240
"category" : "None"
241241
},
242242
{
243-
"name" : "Spot Hidden",
243+
"name" : "SpotHidden",
244244
"initial" : 25,
245245
"era" : "None",
246246
"category" : "None"
@@ -276,7 +276,7 @@
276276
"category" : "ArtAndCraft"
277277
},
278278
{
279-
"name" : "Short Hand",
279+
"name" : "ShortHand",
280280
"initial" : 9,
281281
"era" : "None",
282282
"category" : "ArtAndCraft"

‎coc-dan-frontend/src/core/card/test.json

-3
This file was deleted.

‎coc-dan-frontend/src/core/skill/i18n/en-US.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const dict = {
66
"Law" : {
77
"name" : "Law"
88
},
9-
"Library Use" : {
9+
"LibraryUse" : {
1010
"name" : "Library Use"
1111
},
1212
"Listen" : {
@@ -15,16 +15,16 @@ const dict = {
1515
"Persuade" : {
1616
"name" : "Persuade"
1717
},
18-
"Spot Hidden" : {
18+
"SpotHidden" : {
1919
"name" : "Spot Hidden"
2020
},
21-
"Credit Rating" : {
22-
"name" : "Credit Rating"
21+
"CreditRating" : {
22+
"name" : "CreditRating"
2323
},
2424
"Charm" : {
2525
"name" : "Charm"
2626
},
27-
"Fast Talk" : {
27+
"FastTalk" : {
2828
"name" : "Fast Talk"
2929
},
3030
"Intimidate" : {
@@ -36,13 +36,13 @@ const dict = {
3636
"Psychoanalysis" : {
3737
"name" : "Psychoanalysis"
3838
},
39-
"Computer Use" : {
39+
"ComputerUse" : {
4040
"name" : "Computer Use"
4141
},
4242
"Typing" : {
4343
"name" : "Typing"
4444
},
45-
"Short Hand" : {
45+
"ShortHand" : {
4646
"name" : "Short Hand"
4747
},
4848
"Dodge" : {

‎coc-dan-frontend/src/core/skill/i18n/zh-CN.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const dict : ICardI18NRaw = {
99
"Law" : {
1010
"name" : "法律"
1111
},
12-
"Library Use" : {
12+
"LibraryUse" : {
1313
"name" : "图书馆使用"
1414
},
1515
"Listen" : {
@@ -18,16 +18,16 @@ const dict : ICardI18NRaw = {
1818
"Persuade" : {
1919
"name" : "说服"
2020
},
21-
"Spot Hidden" : {
21+
"SpotHidden" : {
2222
"name" : "侦察"
2323
},
24-
"Credit Rating" : {
24+
"CreditRating" : {
2525
"name" : "信用评级"
2626
},
2727
"Charm" : {
2828
"name" : "魅惑"
2929
},
30-
"Fast Talk" : {
30+
"FastTalk" : {
3131
"name" : "话术"
3232
},
3333
"Intimidate" : {
@@ -39,13 +39,13 @@ const dict : ICardI18NRaw = {
3939
"Psychoanalysis" : {
4040
"name" : "精神分析"
4141
},
42-
"Computer Use" : {
42+
"ComputerUse" : {
4343
"name" : "计算机使用"
4444
},
4545
"Typing" : {
4646
"name" : "打字"
4747
},
48-
"Short Hand" : {
48+
"ShortHand" : {
4949
"name" : "速记"
5050
},
5151
"Dodge" : {

‎coc-dan-frontend/src/pages/Card/components/Skills/core.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export function setSkill(item: ISkillAssigned, avatar: IAvatar, setAvatar: SetSt
1010
const total = item.occupation_skill_point + item.initial + item.interest_skill_point
1111
if (total < 0) return false
1212
if (total > 99) return false
13-
if (item.name == "Credit Rating" && total < avatar.detail.occupation.credit_rating[0]) return false
14-
if (item.name == "Credit Rating" && total > avatar.detail.occupation.credit_rating[1]) return false
13+
if (item.name == "CreditRating" && total < avatar.detail.occupation.credit_rating[0]) return false
14+
if (item.name == "CreditRating" && total > avatar.detail.occupation.credit_rating[1]) return false
1515
if (item.interest_skill_point < 0 || item.occupation_skill_point < 0) return false
1616

1717
for (const key in avatar.detail.skills) {

‎coc-dan-frontend/src/pages/Card/components/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export function resetSkill(raw: IAvatar, setAvatar: SetStoreFunction<IAvatar>) {
2727
}
2828
}
2929

30-
// @ts-ignore reset Credit Rating
31-
const credit_rating: ISkill = deepClone(SKILLS.get("Credit Rating"))
30+
// @ts-ignore reset CreditRating
31+
const credit_rating: ISkill = deepClone(SKILLS.get("CreditRating"))
3232
setSkill({
3333
name: credit_rating.name,
3434
initial: 0,

0 commit comments

Comments
 (0)
Please sign in to comment.