Skip to content

Commit 8ff0c99

Browse files
committed
feat: begin "add soldier"
update Model tab;
1 parent e4023f6 commit 8ff0c99

39 files changed

Lines changed: 442 additions & 65 deletions

File tree

contributes/meta3d-action-mod-unit-init/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meta3d-action-mod-unit-init",
3-
"version": "1.3.87",
3+
"version": "1.3.91",
44
"publisher": "meta3d",
55
"protocol": {
66
"name": "meta3d-action-mod-unit-init-protocol"

contributes/meta3d-action-mod-unit-init/src/Main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ export let getContribute: getContributeMeta3D<actionContribute<uiData, state>> =
103103
Array.from(api.immutable.createMapOfData(getActions()).entries()),
104104
(result, [category, actions]) => {
105105
return reducePromise(
106-
Array.from(api.immutable.createMapOfData(actions).entries()),
107-
(result, [action, actionData]) => {
106+
Array.from(api.immutable.createMapOfData(actions as any).entries()),
107+
(result, [action, actionData]: any) => {
108108
return new Promise((resolve, reject) => {
109109
imageSrcToBase64(
110110
resolve,

contributes/meta3d-action-mod-unit-init/src/asset-lib/unit-action/Main.ts

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,77 @@ export let getActions = () => {
7777
skillType: skillType.Ranged,
7878
skillObject: skillObject.All,
7979
},
80+
},
81+
[category.Soldier]: {
82+
[action.Slash1]: {
83+
skillType: skillType.Melee,
84+
skillObject: skillObject.All,
85+
},
86+
[action.Slash2]: {
87+
skillType: skillType.Melee,
88+
skillObject: skillObject.All,
89+
},
90+
[action.Slash3]: {
91+
skillType: skillType.Melee,
92+
skillObject: skillObject.All,
93+
},
94+
[action.Slash4]: {
95+
skillType: skillType.Melee,
96+
skillObject: skillObject.All,
97+
},
98+
[action.SlashCombo1]: {
99+
skillType: skillType.Melee,
100+
skillObject: skillObject.All,
101+
},
102+
[action.SlashCombo2]: {
103+
skillType: skillType.Melee,
104+
skillObject: skillObject.All,
105+
},
106+
[action.SlashCombo3]: {
107+
skillType: skillType.Melee,
108+
skillObject: skillObject.All,
109+
},
110+
[action.Swipe1]: {
111+
skillType: skillType.Melee,
112+
skillObject: skillObject.All,
113+
},
114+
[action.MeleeKick1]: {
115+
skillType: skillType.Melee,
116+
skillObject: skillObject.All,
117+
},
118+
[action.Shoot1]: {
119+
skillType: skillType.Ranged,
120+
skillObject: skillObject.All,
121+
122+
},
123+
[action.Shoot2]: {
124+
skillType: skillType.Ranged,
125+
skillObject: skillObject.All,
126+
},
127+
[action.Shoot3]: {
128+
skillType: skillType.Ranged,
129+
skillObject: skillObject.All,
130+
},
131+
[action.Shoot4]: {
132+
skillType: skillType.Ranged,
133+
skillObject: skillObject.All,
134+
},
135+
[action.Cast1]: {
136+
skillType: skillType.Ranged,
137+
skillObject: skillObject.All,
138+
},
139+
[action.Cast2]: {
140+
skillType: skillType.Assistant,
141+
skillObject: skillObject.All,
142+
},
143+
[action.Cast3]: {
144+
skillType: skillType.Assistant,
145+
skillObject: skillObject.All,
146+
},
147+
[action.Charge]: {
148+
skillType: skillType.Assistant,
149+
skillObject: skillObject.All,
150+
},
80151
}
81152
}
82153
}
@@ -102,6 +173,8 @@ export let getMeleeSubEffects = () => {
102173
export let getRangedSubEffects = () => {
103174
return [
104175
rangedSubEffect.FireballHit,
176+
rangedSubEffect.BasicBulletHit,
177+
rangedSubEffect.LaserBulletHit,
105178
rangedSubEffect.ShellExplode,
106179
]
107180
}
@@ -141,6 +214,10 @@ export let getEmitterParticleImages = () => {
141214
particleImage.I17,
142215
particleImage.I18,
143216
particleImage.I19,
217+
particleImage.I20,
218+
particleImage.I21,
219+
particleImage.I22,
220+
particleImage.I23,
144221
]
145222
}
146223

@@ -173,7 +250,7 @@ export let getEmitterInstanceSnapshotPath = (pathPrefix, name) => {
173250
return `${pathPrefix}/icon_instance/${name}.png`
174251
}
175252

176-
export let getActionSnapshotPath = (pathPrefix, category: category, action: action) => {
253+
export let getActionSnapshotPath = (pathPrefix, category: category, action) => {
177254
// return `${pathPrefix}/${category.toLowerCase()}/icon_action/${action}.png`
178255
return `${pathPrefix}/icon_action/${action}.png`
179256
}

contributes/meta3d-action-mod-unit-init/src/asset-lib/unit-model/Main.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,23 @@ export let getAllModelData = () => {
3636
// {
3737
// model: model.EliteGiantess11,
3838
// },
39+
],
40+
[category.Soldier]: [
41+
{
42+
model: model.Soldier1,
43+
},
44+
{
45+
model: model.Soldier2,
46+
},
47+
{
48+
model: model.Soldier3,
49+
},
50+
{
51+
model: model.Soldier4,
52+
},
53+
{
54+
model: model.Soldier5,
55+
},
3956
]
4057
}
4158
}

contributes/meta3d-action-mod-unit-set-category/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meta3d-action-mod-unit-set-category",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"publisher": "meta3d",
55
"repoLink": "",
66
"protocol": {

contributes/meta3d-action-mod-unit-set-category/src/Main.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { actionContribute, service as editorWholeService } from "meta3d-editor-w
33
import { actionName, state, uiData } from "meta3d-action-mod-unit-set-category-protocol"
44
import { eventName, inputData } from "meta3d-action-mod-unit-set-category-protocol/src/EventType"
55
// import { actionName as publishToGameActionName, state as publishToGameState } from "meta3d-action-mod-unit-publish-to-game-protocol"
6-
import { category } from "meta3d-action-mod-unit-publish-to-game-protocol/src/UnitType"
6+
import { armyScale, category, scale } from "meta3d-action-mod-unit-publish-to-game-protocol/src/UnitType"
77
import { actionName as initActionName, state as initState } from "meta3d-action-mod-unit-init-protocol"
88

99
export let getContribute: getContributeMeta3D<actionContribute<uiData, state>> = (api) => {
@@ -13,11 +13,28 @@ export let getContribute: getContributeMeta3D<actionContribute<uiData, state>> =
1313
let eventSourcingService = api.nullable.getExn(api.getPackageService<editorWholeService>(meta3dState, "meta3d-editor-whole-protocol")).event(meta3dState).eventSourcing(meta3dState)
1414

1515
return new Promise((resolve, reject) => {
16-
resolve(eventSourcingService.on<inputData>(meta3dState, eventName, 0, (meta3dState, index:number) => {
16+
resolve(eventSourcingService.on<inputData>(meta3dState, eventName, 0, (meta3dState, index: number) => {
1717
let allModelData = api.nullable.getExn(api.action.getActionState<initState>(meta3dState, initActionName)).allModelData
1818

19+
let category_ = Array.from(allModelData.keys())[index]
20+
1921
meta3dState = api.action.setActionState<state>(meta3dState, actionName, {
20-
category: Array.from(allModelData.keys())[index]
22+
category: category_
23+
})
24+
25+
26+
let defaultScale
27+
switch (category_) {
28+
case category.EliteGiantess:
29+
defaultScale = scale.Level5
30+
break
31+
default:
32+
defaultScale = armyScale.Level0
33+
break
34+
}
35+
meta3dState = api.action.setActionState<initState>(meta3dState, initActionName, {
36+
...api.nullable.getExn(api.action.getActionState<initState>(meta3dState, initActionName)),
37+
scale: defaultScale
2138
})
2239

2340
return Promise.resolve(meta3dState)

contributes/meta3d-action-mod-unit-set-height/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meta3d-action-mod-unit-set-height",
3-
"version": "1.3.4",
3+
"version": "1.3.6",
44
"publisher": "meta3d",
55
"protocol": {
66
"name": "meta3d-action-mod-set-value-protocol"

contributes/meta3d-action-mod-unit-set-height/src/Main.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { actionContribute, service as editorWholeService } from "meta3d-editor-w
33
import { state, uiData } from "meta3d-action-mod-set-value-protocol"
44
import { inputData } from "meta3d-action-mod-set-value-protocol/src/EventType"
55
import { actionName as initActionName, state as initState } from "meta3d-action-mod-unit-init-protocol"
6+
import { actionName as setCategoryActionName, state as setCategoryState } from "meta3d-action-mod-unit-set-category-protocol"
7+
import { armyScale, category } from "meta3d-action-mod-unit-publish-to-game-protocol/src/UnitType"
68

79
let eventName = "UnitModSetHeightEvent"
810

@@ -14,6 +16,19 @@ export let getContribute: getContributeMeta3D<actionContribute<uiData, state>> =
1416

1517
return new Promise((resolve, reject) => {
1618
resolve(eventSourcingService.on<inputData>(meta3dState, eventName, 0, (meta3dState, value) => {
19+
let setCategoryState = api.nullable.getExn(api.action.getActionState<setCategoryState>(meta3dState, setCategoryActionName))
20+
21+
switch (setCategoryState.category) {
22+
case category.EliteGiantess:
23+
value = Math.max(value, 6)
24+
break
25+
default:
26+
value = Math.max(Math.min(value, armyScale.Level10 * 2), armyScale.Level0 * 2)
27+
break
28+
}
29+
30+
31+
1732
meta3dState = api.action.setActionState<any>(meta3dState, initActionName, {
1833
...api.nullable.getExn(api.action.getActionState<any>(meta3dState, initActionName)),
1934
scale: value / 2

doc/1.3.1.org

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3102,17 +3102,26 @@ add get/set multi layers' value
31023102
# limit scale to [1,3]
31033103
# limit scale to [0.5,1.5]?([1M, 3M])
31043104

3105-
** TODO update model
3105+
3106+
** DONE update type, asset lib, language
3107+
3108+
3109+
3110+
** DONE update model
31063111

31073112

31083113
TODO can select
31093114

31103115

31113116

31123117
TODO can upload
3118+
# fix: remove 正在发布中
31133119

31143120

31153121

3122+
TODO limit scale range for soldier
3123+
3124+
31163125

31173126
** TODO update skill
31183127
add skillObject.All:
@@ -3144,8 +3153,24 @@ TODO action: 注明动作类型(如:踢1(近战)、冲锋(辅助))
31443153

31453154

31463155

3156+
3157+
TODO update particle images
3158+
TODO update particle hit effects
3159+
3160+
3161+
TODO update emitterSize value range
3162+
TODO update emitterCollisionSize value range
3163+
3164+
TODO rename emitterCollisionSize text to 增加的弹药碰撞体积
3165+
3166+
3167+
3168+
3169+
31473170
** TODO elitegiantess, soldier can replace animations
31483171

3172+
*** TODO add Animation tab
3173+
31493174
*** TODO elitegiantess, soldier can replace default animations for non-behaviour actions
31503175

31513176

@@ -3164,20 +3189,8 @@ TODO can replace
31643189
TODO feature has category field
31653190

31663191

3167-
TODO update particle images
3168-
TODO update particle hit effects
3169-
3170-
3171-
TODO update emitterSize value range
3172-
TODO update emitterCollisionSize value range
3173-
3174-
TODO rename emitterCollisionSize text to 增加的弹药碰撞体积
3175-
3176-
31773192
* TODO update doc
31783193

3179-
** TODO write generate soldier model doc
3180-
31813194
mixamo:
31823195
# has weapon unit all use 25 skeletons?
31833196
# no weapon unit keep use 65 skeletons?
@@ -3204,6 +3217,7 @@ no select "Use Symmetry"
32043217
给出参考的图片:
32053218
# use mixamo->great sword snapshot
32063219
use 剑客参考图片.png
3220+
use Soldier1(melee) snapshot
32073221
# use tripo soldier snapshot
32083222
use 士兵参考图片.png
32093223
explain: 枪应该要垂直向下旋转90度,不过暂时没有合适的图片
@@ -3216,7 +3230,6 @@ use 士兵参考图片.png
32163230

32173231
如果生成的模型不正确(如武器没拿好、头朝向错误等),可点击“免费重试”
32183232

3219-
** TODO update doc
32203233

32213234

32223235

55.8 KB
Loading

0 commit comments

Comments
 (0)