fix(hero): 统一调整英雄预制体尺寸与属性配置
1. 修正多个英雄prefab的碰撞盒、显示尺寸参数,对齐统一规格 2. 调整mb1/3/4/5/6的本地位置参数适配新尺寸 3. 翻倍英雄基础血量属性适配平衡调整 4. 优化HeroAnmComp代码格式与动画播放逻辑
This commit is contained in:
@@ -250,7 +250,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": -85.933,
|
"y": -86.962,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -981,8 +981,8 @@
|
|||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 80,
|
"width": 150,
|
||||||
"height": 100
|
"height": 150
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
@@ -1090,12 +1090,12 @@
|
|||||||
"_offset": {
|
"_offset": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 50
|
"y": 75
|
||||||
},
|
},
|
||||||
"_size": {
|
"_size": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 30,
|
"width": 150,
|
||||||
"height": 100
|
"height": 150
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -981,8 +981,8 @@
|
|||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 80,
|
"width": 150,
|
||||||
"height": 100
|
"height": 150
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
@@ -1090,12 +1090,12 @@
|
|||||||
"_offset": {
|
"_offset": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 50
|
"y": 75
|
||||||
},
|
},
|
||||||
"_size": {
|
"_size": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 30,
|
"width": 150,
|
||||||
"height": 100
|
"height": 150
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -250,7 +250,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": -84.866,
|
"y": -84.432,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -978,8 +978,8 @@
|
|||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 80,
|
"width": 150,
|
||||||
"height": 100
|
"height": 150
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
@@ -1087,12 +1087,12 @@
|
|||||||
"_offset": {
|
"_offset": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 50
|
"y": 75
|
||||||
},
|
},
|
||||||
"_size": {
|
"_size": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 30,
|
"width": 150,
|
||||||
"height": 100
|
"height": 150
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -250,7 +250,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": -84.192,
|
"y": -57.035,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -290,8 +290,8 @@
|
|||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 384,
|
"width": 256,
|
||||||
"height": 384
|
"height": 256
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
@@ -981,8 +981,8 @@
|
|||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 80,
|
"width": 150,
|
||||||
"height": 100
|
"height": 150
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
@@ -1090,12 +1090,12 @@
|
|||||||
"_offset": {
|
"_offset": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 50
|
"y": 75
|
||||||
},
|
},
|
||||||
"_size": {
|
"_size": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 30,
|
"width": 150,
|
||||||
"height": 100
|
"height": 150
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": -0.041,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
@@ -250,7 +250,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": -87.202,
|
"y": -57.266,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -290,8 +290,8 @@
|
|||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 384,
|
"width": 256,
|
||||||
"height": 384
|
"height": 256
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
@@ -978,8 +978,8 @@
|
|||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 80,
|
"width": 150,
|
||||||
"height": 100
|
"height": 150
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
@@ -1087,12 +1087,12 @@
|
|||||||
"_offset": {
|
"_offset": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 50
|
"y": 75
|
||||||
},
|
},
|
||||||
"_size": {
|
"_size": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 30,
|
"width": 150,
|
||||||
"height": 100
|
"height": 150
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -250,7 +250,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": -81.733,
|
"y": -53.96,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -290,8 +290,8 @@
|
|||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 384,
|
"width": 256,
|
||||||
"height": 384
|
"height": 256
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
@@ -978,8 +978,8 @@
|
|||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 200,
|
"width": 150,
|
||||||
"height": 220
|
"height": 150
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
@@ -1087,12 +1087,12 @@
|
|||||||
"_offset": {
|
"_offset": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 110
|
"y": 75
|
||||||
},
|
},
|
||||||
"_size": {
|
"_size": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 150,
|
"width": 150,
|
||||||
"height": 220
|
"height": 150
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { v3 } from "cc"
|
import { v3 } from "cc"
|
||||||
import { BoxSet, FacSet, FightSet } from "./GameSet"
|
import { BoxSet, FacSet, FightSet } from "./GameSet"
|
||||||
import { SkillOverrides, TGroup, SkillSet, FieldSkillSet, SkillConfig, SkillKind, FieldSkillConfig, FieldSkillType, mergeSkillParams } from "./SkillSet"
|
import { SkillOverrides, TGroup, SkillSet, FieldSkillSet, SkillConfig, SkillKind, FieldSkillConfig, FieldSkillType, mergeSkillParams } from "./SkillSet"
|
||||||
import { BuffList, BuffConfig, ModOp } from "./BuffSet"
|
import { BuffList, BuffConfig, ModOp } from "./BuffSet"
|
||||||
@@ -145,12 +145,12 @@ export const HRoleName: Record<HRole, string> = {
|
|||||||
* Why: 局外升级机制将在加载时(Hero.ts / Mon.ts)统一重算属性,配置表只承担"基准+增量"的静态表达。
|
* Why: 局外升级机制将在加载时(Hero.ts / Mon.ts)统一重算属性,配置表只承担"基准+增量"的静态表达。
|
||||||
*/
|
*/
|
||||||
export const HERO_ROLE_BASE: Record<HRole, { hp: number; ap: number; def: number }> = {
|
export const HERO_ROLE_BASE: Record<HRole, { hp: number; ap: number; def: number }> = {
|
||||||
[HRole.Tank]: { hp: 300, ap: 20, def: 50 }, // 坦克:高防高血,前排承伤
|
[HRole.Tank]: { hp: 600, ap: 20, def: 50 }, // 坦克:高防高血,前排承伤
|
||||||
[HRole.Warrior]: { hp: 280, ap: 22, def: 30 }, // 战士:均衡
|
[HRole.Warrior]: { hp: 560, ap: 22, def: 30 }, // 战士:均衡
|
||||||
[HRole.Assassin]: { hp: 280, ap: 22, def: 10 }, // 刺客:低防,近战爆发
|
[HRole.Assassin]: { hp: 560, ap: 22, def: 10 }, // 刺客:低防,近战爆发
|
||||||
[HRole.Archer]: { hp: 140, ap: 32, def: 10 }, // 射手:低防,远程物理主C
|
[HRole.Archer]: { hp: 280, ap: 32, def: 10 }, // 射手:低防,远程物理主C
|
||||||
[HRole.Mage]: { hp: 140, ap: 32, def: 10 }, // 法师:低防,远程增益
|
[HRole.Mage]: { hp: 280, ap: 32, def: 10 }, // 法师:低防,远程增益
|
||||||
[HRole.Support]: { hp: 140, ap: 32, def: 15 }, // 辅助:低防,光环/治疗
|
[HRole.Support]: { hp: 280, ap: 32, def: 15 }, // 辅助:低防,光环/治疗
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ import { FlashSprite } from "./hit-flash-white/scripts/FlashSprite";
|
|||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
@ccclass('HeroAnmComp')
|
@ccclass('HeroAnmComp')
|
||||||
export default class HeroAnmComp extends Component{
|
export default class HeroAnmComp extends Component {
|
||||||
fsSprite:FlashSprite = null!;
|
fsSprite: FlashSprite = null!;
|
||||||
private anmcon:any=null
|
private anmcon: any = null
|
||||||
private _hasStop = true;
|
private _hasStop = true;
|
||||||
private _atkIndex = 0;
|
private _atkIndex = 0;
|
||||||
private default_anim:string='idle'
|
private default_anim: string = 'idle'
|
||||||
anms:any[]=["idle","move","atk0","max0","max1"]
|
anms: any[] = ["idle", "move", "atk0", "max0", "max1"]
|
||||||
onLoad () {
|
onLoad() {
|
||||||
this.anmcon=this.node.getComponent(Animation)
|
this.anmcon = this.node.getComponent(Animation)
|
||||||
this.fsSprite = this.node.getComponent(FlashSprite);
|
this.fsSprite = this.node.getComponent(FlashSprite);
|
||||||
this.anmcon.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
this.anmcon.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
||||||
}
|
}
|
||||||
@@ -24,46 +24,61 @@ export default class HeroAnmComp extends Component{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stop () {
|
/** 大招是否播放中(最高优先级,期间禁止一切动画切换) */
|
||||||
|
private get maxPlaying(): boolean {
|
||||||
|
return !!(this.anmcon.getState("max0")?.isPlaying || this.anmcon.getState("max1")?.isPlaying);
|
||||||
|
}
|
||||||
|
/** 普攻是否播放中(次优先级,仅可被大招打断) */
|
||||||
|
private get atkPlaying(): boolean {
|
||||||
|
return !!this.anmcon.getState("atk0")?.isPlaying;
|
||||||
|
}
|
||||||
|
/** buff 是否播放中(可被大招/普攻打断,但拦截 idle/move) */
|
||||||
|
private get buffPlaying(): boolean {
|
||||||
|
return !!this.anmcon.getState("buff")?.isPlaying;
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
this._hasStop = true;
|
this._hasStop = true;
|
||||||
}
|
}
|
||||||
onAnimationFinished(type:Animation.EventType, state:AnimationState){
|
onAnimationFinished(type: Animation.EventType, state: AnimationState) {
|
||||||
if(state.name!="idle"&&state.name!="move"){
|
if (state.name != "idle" && state.name != "move") {
|
||||||
this.anmcon.play(this.default_anim)
|
this.anmcon.play(this.default_anim)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
atked(){
|
atked() {
|
||||||
this.fsSprite.clickFlash();
|
this.fsSprite.clickFlash();
|
||||||
}
|
}
|
||||||
move () {
|
move() {
|
||||||
if(this.anmcon.getState("move").isPlaying) return
|
if (this.maxPlaying || this.atkPlaying || this.buffPlaying) return
|
||||||
this.anmcon.play("move")
|
if (this.anmcon.getState("move").isPlaying) return
|
||||||
this.default_anim='move'
|
this.anmcon.play("move")
|
||||||
|
this.default_anim = 'move'
|
||||||
}
|
}
|
||||||
atk () {
|
atk() {
|
||||||
if(this.anmcon.getState("max0").isPlaying||this.anmcon.getState("max1").isPlaying) return
|
if (this.maxPlaying) return
|
||||||
this.anmcon.play(`atk0`)
|
this.anmcon.play(`atk0`)
|
||||||
}
|
}
|
||||||
max () {
|
max() {
|
||||||
if(this.anmcon.getState("max0").isPlaying||this.anmcon.getState("max1").isPlaying) return
|
if (this.maxPlaying) return
|
||||||
this.anmcon.play("max0")
|
this.anmcon.play("max0")
|
||||||
}
|
}
|
||||||
play(anm:string=""){
|
play(anm: string = "") {
|
||||||
if(anm==="") return
|
if (anm === "") return
|
||||||
if(this.anmcon.getState("max0").isPlaying||this.anmcon.getState("max1").isPlaying) return
|
if (this.maxPlaying) return
|
||||||
this.anmcon.play(anm)
|
this.anmcon.play(anm)
|
||||||
}
|
}
|
||||||
|
|
||||||
idle () {
|
idle() {
|
||||||
if(this.anmcon.getState("idle").isPlaying) return
|
if (this.maxPlaying || this.atkPlaying || this.buffPlaying) return
|
||||||
|
if (this.anmcon.getState("idle").isPlaying) return
|
||||||
this.anmcon.play("idle")
|
this.anmcon.play("idle")
|
||||||
this.default_anim='idle'
|
this.default_anim = 'idle'
|
||||||
}
|
}
|
||||||
buff(){
|
buff() {
|
||||||
if(this.anmcon.getState("max0").isPlaying||this.anmcon.getState("max1").isPlaying) return
|
if (this.maxPlaying) return
|
||||||
this.anmcon.play("buff")
|
this.anmcon.play("buff")
|
||||||
}
|
}
|
||||||
dead(){
|
dead() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user