怪物 改为3条直线 进入, 攻击动画 直线的已改, 抛物线和群攻的 也需要修改
This commit is contained in:
@@ -50,8 +50,8 @@
|
|||||||
"height": 372,
|
"height": 372,
|
||||||
"rawWidth": 556,
|
"rawWidth": 556,
|
||||||
"rawHeight": 372,
|
"rawHeight": 372,
|
||||||
"borderTop": 0,
|
"borderTop": 305,
|
||||||
"borderBottom": 0,
|
"borderBottom": 63,
|
||||||
"borderLeft": 0,
|
"borderLeft": 0,
|
||||||
"borderRight": 0,
|
"borderRight": 0,
|
||||||
"packable": true,
|
"packable": true,
|
||||||
|
|||||||
@@ -1271,7 +1271,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": -255.496,
|
"y": -314.65,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@@ -1283,8 +1283,8 @@
|
|||||||
},
|
},
|
||||||
"_lscale": {
|
"_lscale": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 4,
|
"x": 3.5,
|
||||||
"y": 4,
|
"y": 3.5,
|
||||||
"z": 1
|
"z": 1
|
||||||
},
|
},
|
||||||
"_mobility": 0,
|
"_mobility": 0,
|
||||||
@@ -1312,7 +1312,7 @@
|
|||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 556,
|
"width": 556,
|
||||||
"height": 372
|
"height": 432
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
@@ -1351,9 +1351,9 @@
|
|||||||
"__uuid__": "52d2441e-f68d-4006-a7cc-aaa447815132@f9941",
|
"__uuid__": "52d2441e-f68d-4006-a7cc-aaa447815132@f9941",
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
"__expectedType__": "cc.SpriteFrame"
|
||||||
},
|
},
|
||||||
"_type": 0,
|
"_type": 1,
|
||||||
"_fillType": 0,
|
"_fillType": 0,
|
||||||
"_sizeMode": 1,
|
"_sizeMode": 0,
|
||||||
"_fillCenter": {
|
"_fillCenter": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
@@ -1379,8 +1379,6 @@
|
|||||||
"__id__": 0
|
"__id__": 0
|
||||||
},
|
},
|
||||||
"fileId": "3fAYpeIJJHJZjCyzC0S8Eq",
|
"fileId": "3fAYpeIJJHJZjCyzC0S8Eq",
|
||||||
"instance": null,
|
|
||||||
"targetOverrides": null,
|
|
||||||
"nestedPrefabInstanceRoots": null
|
"nestedPrefabInstanceRoots": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
"__type__": "cc.Quat",
|
"__type__": "cc.Quat",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": -0.3826834323650898,
|
"z": 0.3826834323650898,
|
||||||
"w": 0.9238795325112867
|
"w": 0.9238795325112867
|
||||||
},
|
},
|
||||||
"_lscale": {
|
"_lscale": {
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": -45
|
"z": 45
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
"__type__": "cc.Quat",
|
"__type__": "cc.Quat",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": -0.3826834323650898,
|
"z": 0.3826834323650898,
|
||||||
"w": 0.9238795325112867
|
"w": 0.9238795325112867
|
||||||
},
|
},
|
||||||
"_lscale": {
|
"_lscale": {
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": -45
|
"z": 45
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
"__type__": "cc.Quat",
|
"__type__": "cc.Quat",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": -0.3826834323650898,
|
"z": 0.3826834323650898,
|
||||||
"w": 0.9238795325112867
|
"w": 0.9238795325112867
|
||||||
},
|
},
|
||||||
"_lscale": {
|
"_lscale": {
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": -45
|
"z": 45
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
"__type__": "cc.Quat",
|
"__type__": "cc.Quat",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": -0.3826834323650898,
|
"z": 0.3826834323650898,
|
||||||
"w": 0.9238795325112867
|
"w": 0.9238795325112867
|
||||||
},
|
},
|
||||||
"_lscale": {
|
"_lscale": {
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"z": -45
|
"z": 45
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ export const VmInfo = {
|
|||||||
exp:0,
|
exp:0,
|
||||||
next_exp:100,
|
next_exp:100,
|
||||||
cd:3,
|
cd:3,
|
||||||
|
skill_cd_buff:0,//技能cd修正
|
||||||
damage:0,
|
damage:0,
|
||||||
ap:0,
|
ap:0,
|
||||||
equip_ap:0,
|
equip_ap:0,
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ export const HQuality = {
|
|||||||
ORANGE:5,
|
ORANGE:5,
|
||||||
}
|
}
|
||||||
export const MonSet = {
|
export const MonSet = {
|
||||||
0:{pos:v3(340,0,0)},
|
0:{pos:v3(370,0,0)},
|
||||||
1:{pos:v3(360,0,0)},
|
1:{pos:v3(370,+80,0)},
|
||||||
2:{pos:v3(380,0,0)},
|
2:{pos:v3(370,-80,0)},
|
||||||
3:{pos:v3(400,0,0)},
|
3:{pos:v3(400,0,0)},
|
||||||
4:{pos:v3(420,0,0)},
|
4:{pos:v3(420,0,0)},
|
||||||
5:{pos:v3(440,0,0)},
|
5:{pos:v3(440,0,0)},
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ export class BuffComp extends Component {
|
|||||||
info.dod=this.HeroView.dod+buff.DODGE
|
info.dod=this.HeroView.dod+buff.DODGE
|
||||||
info.def=this.HeroView.def+buff.DEF
|
info.def=this.HeroView.def+buff.DEF
|
||||||
info.wind=buff.WFUNY
|
info.wind=buff.WFUNY
|
||||||
|
info.skill_cd_buff=buff.SKILL_CD
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ export class SkillConComp extends CCComp {
|
|||||||
this.HeroView.node.position.y + BoxSet.ATK_Y, 0),
|
this.HeroView.node.position.y + BoxSet.ATK_Y, 0),
|
||||||
this.node.parent,
|
this.node.parent,
|
||||||
config.uuid,
|
config.uuid,
|
||||||
new Vec3(target.x, target.y, 0),
|
new Vec3(target.x, target.y+BoxSet.ATK_Y, 0),
|
||||||
this.HeroView,
|
this.HeroView,
|
||||||
0,
|
0,
|
||||||
dmg
|
dmg
|
||||||
@@ -196,7 +196,8 @@ export class SkillConComp extends CCComp {
|
|||||||
let keyPos = this.HeroView.fac==FacSet.HERO ?
|
let keyPos = this.HeroView.fac==FacSet.HERO ?
|
||||||
Math.min(...entities.map(e => e.get(HeroViewComp).node.position.x)) :
|
Math.min(...entities.map(e => e.get(HeroViewComp).node.position.x)) :
|
||||||
Math.max(...entities.map(e => e.get(HeroViewComp).node.position.x));
|
Math.max(...entities.map(e => e.get(HeroViewComp).node.position.x));
|
||||||
return keyPos
|
let keyEntity = entities.find(e => e.get(HeroViewComp).node.position.x === keyPos);
|
||||||
|
return keyEntity.get(HeroViewComp).node.position;
|
||||||
}
|
}
|
||||||
/** 筛选最前排单位 */
|
/** 筛选最前排单位 */
|
||||||
private filterFrontRow(): Vec3{
|
private filterFrontRow(): Vec3{
|
||||||
@@ -211,7 +212,7 @@ export class SkillConComp extends CCComp {
|
|||||||
return v3(-400,0)
|
return v3(-400,0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pos=v3(this.get_front(entities),0)
|
pos=v3(this.get_front(entities))
|
||||||
return pos
|
return pos
|
||||||
}
|
}
|
||||||
private selectTeamFront(){
|
private selectTeamFront(){
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ export class EquipSkillComp extends CCComp {
|
|||||||
update(dt: number): void {
|
update(dt: number): void {
|
||||||
if(!smc.mission.play||smc.mission.pause) return
|
if(!smc.mission.play||smc.mission.pause) return
|
||||||
if(this.skill1.uuid!=0){
|
if(this.skill1.uuid!=0){
|
||||||
let cd=this.skill1.cd
|
let cd_bar=this.boxs.getChildByName("skill1").getChildByName("icon").getChildByName("cd")
|
||||||
|
let cd=this.skill1.cd*(100-smc.vmdata.hero.skill_cd_buff)/100
|
||||||
if(this.skill1.cd_time < cd){
|
if(this.skill1.cd_time < cd){
|
||||||
this.skill1.cd_time+=dt
|
this.skill1.cd_time+=dt
|
||||||
}else{
|
}else{
|
||||||
@@ -87,10 +88,11 @@ export class EquipSkillComp extends CCComp {
|
|||||||
this.do_skill1()
|
this.do_skill1()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.boxs.getChildByName("skill1").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar).progress=(1-this.skill1.cd_time/cd)
|
cd_bar.getComponent(ProgressBar).progress=(1-this.skill1.cd_time/cd)
|
||||||
}
|
}
|
||||||
if(this.skill2.uuid!=0){
|
if(this.skill2.uuid!=0){
|
||||||
let cd=this.skill2.cd
|
let cd_bar=this.boxs.getChildByName("skill2").getChildByName("icon").getChildByName("cd")
|
||||||
|
let cd=this.skill2.cd*(100-smc.vmdata.hero.skill_cd_buff)/100
|
||||||
if(this.skill2.cd_time < cd){
|
if(this.skill2.cd_time < cd){
|
||||||
this.skill2.cd_time+=dt
|
this.skill2.cd_time+=dt
|
||||||
}else{
|
}else{
|
||||||
@@ -98,10 +100,11 @@ export class EquipSkillComp extends CCComp {
|
|||||||
this.do_skill2()
|
this.do_skill2()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.boxs.getChildByName("skill2").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar).progress=(1-this.skill2.cd_time/cd)
|
cd_bar.getComponent(ProgressBar).progress=(1-this.skill2.cd_time/cd)
|
||||||
}
|
}
|
||||||
if(this.skill3.uuid!=0){
|
if(this.skill3.uuid!=0){
|
||||||
let cd=this.skill3.cd
|
let cd_bar=this.boxs.getChildByName("skill3").getChildByName("icon").getChildByName("cd")
|
||||||
|
let cd=this.skill3.cd*(100-smc.vmdata.hero.skill_cd_buff)/100
|
||||||
if(this.skill3.cd_time < cd){
|
if(this.skill3.cd_time < cd){
|
||||||
this.skill3.cd_time+=dt
|
this.skill3.cd_time+=dt
|
||||||
}else{
|
}else{
|
||||||
@@ -109,7 +112,7 @@ export class EquipSkillComp extends CCComp {
|
|||||||
// this.do_skill3()
|
// this.do_skill3()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.boxs.getChildByName("skill3").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar).progress=(1-this.skill3.cd_time/cd)
|
cd_bar.getComponent(ProgressBar).progress=(1-this.skill3.cd_time/cd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
do_skill1(){
|
do_skill1(){
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
buffData?: any[] // 使用BuffAttr格式的buff数据
|
buffData?: any[] // 使用BuffAttr格式的buff数据
|
||||||
}> = [];
|
}> = [];
|
||||||
private isSpawning: boolean = false;// 是否正在生成怪物
|
private isSpawning: boolean = false;// 是否正在生成怪物
|
||||||
private spawnInterval: number = 0.5; // 每个怪物生成间隔时间
|
private spawnInterval: number = 1; // 每个怪物生成间隔时间
|
||||||
private spawnTimer: number = 0; // 生成计时器
|
private spawnTimer: number = 0; // 生成计时器
|
||||||
private is_fight:boolean = false;
|
private is_fight:boolean = false;
|
||||||
|
|
||||||
@@ -78,7 +78,6 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
const rogueWaveConfig = getRogueWaveConfig(currentWave);
|
const rogueWaveConfig = getRogueWaveConfig(currentWave);
|
||||||
console.log(`[MissionMonComp]:肉鸽模式第${currentWave}波配置:`, rogueWaveConfig.description);
|
console.log(`[MissionMonComp]:肉鸽模式第${currentWave}波配置:`, rogueWaveConfig.description);
|
||||||
this.generateRogueMonstersFromConfig(rogueWaveConfig);
|
this.generateRogueMonstersFromConfig(rogueWaveConfig);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -106,9 +105,10 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
// 为每个怪物组生成指定数量的怪物
|
// 为每个怪物组生成指定数量的怪物
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
// 随机选择位置 (0-9)
|
// 随机选择位置 (0-9)
|
||||||
|
let x=i%3 //0 1 2
|
||||||
this.addToSpawnQueueWithAffixes(
|
this.addToSpawnQueueWithAffixes(
|
||||||
uuid,
|
uuid,
|
||||||
i,
|
x,
|
||||||
isBoss || false,
|
isBoss || false,
|
||||||
monsterLevel,
|
monsterLevel,
|
||||||
affixes,
|
affixes,
|
||||||
@@ -189,9 +189,10 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
lv: number = 1,
|
lv: number = 1,
|
||||||
buffData?: any[]
|
buffData?: any[]
|
||||||
) {
|
) {
|
||||||
|
let x=RandomManager.instance.getRandomInt(0,2)
|
||||||
let mon = ecs.getEntity<Monster>(Monster);
|
let mon = ecs.getEntity<Monster>(Monster);
|
||||||
let scale = -1;
|
let scale = -1;
|
||||||
let pos: Vec3 = v3(MonSet[i].pos);
|
let pos: Vec3 = v3(MonSet[x].pos);
|
||||||
|
|
||||||
// 生成怪物,传递词条buff数据
|
// 生成怪物,传递词条buff数据
|
||||||
mon.load(pos, scale, uuid, is_boss, is_call, lv, buffData);
|
mon.load(pos, scale, uuid, is_boss, is_call, lv, buffData);
|
||||||
|
|||||||
@@ -87,15 +87,35 @@ export class SkillCom extends CCComp {
|
|||||||
collider.group = this.group;
|
collider.group = this.group;
|
||||||
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
|
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
|
||||||
}
|
}
|
||||||
|
let bm=this.node.getComponent(BezierMove)
|
||||||
// console.log(this.group +"技能 collider ",collider);
|
// console.log(this.group +"技能 collider ",collider);
|
||||||
switch(SkillSet[this.s_uuid].AType){
|
switch(SkillSet[this.s_uuid].AType){
|
||||||
case AType.parabolic:
|
case AType.parabolic:
|
||||||
this.node.angle +=10
|
this.node.angle +=10
|
||||||
let bm=this.node.getComponent(BezierMove)
|
|
||||||
// bm.speed=700
|
// bm.speed=700
|
||||||
if(this.group==BoxSet.MONSTER) bm.controlPointSide=-1
|
if(this.group==BoxSet.MONSTER) {bm.controlPointSide=-1 }
|
||||||
|
bm.rotationSmoothness=0.6
|
||||||
bm.moveTo(this.targetPos)
|
bm.moveTo(this.targetPos)
|
||||||
break;
|
break;
|
||||||
|
case AType.linear:
|
||||||
|
let s_x=this.startPos.x
|
||||||
|
let s_y=this.startPos.y
|
||||||
|
let t_x=this.targetPos.x
|
||||||
|
let t_y=this.targetPos.y
|
||||||
|
// 设定目标x
|
||||||
|
this.targetPos.x = 400;
|
||||||
|
if(this.group == BoxSet.MONSTER) {
|
||||||
|
bm.controlPointSide = -1;
|
||||||
|
this.targetPos.x = -400;
|
||||||
|
}
|
||||||
|
// 计算斜率
|
||||||
|
const k = (t_y - s_y) / (t_x - s_x);
|
||||||
|
// 按直线公式计算新的y
|
||||||
|
this.targetPos.y = k * (this.targetPos.x - s_x) + s_y;
|
||||||
|
bm.controlPointOffset=0
|
||||||
|
bm.rotationSmoothness=0.6
|
||||||
|
bm.moveTo(this.targetPos);
|
||||||
|
break;
|
||||||
case AType.StartEnd:
|
case AType.StartEnd:
|
||||||
// 2段位移:先升高,然后移到目的地
|
// 2段位移:先升高,然后移到目的地
|
||||||
this.executeTwoStageMovement();
|
this.executeTwoStageMovement();
|
||||||
@@ -280,7 +300,7 @@ export class SkillCom extends CCComp {
|
|||||||
this.range_damage()
|
this.range_damage()
|
||||||
}
|
}
|
||||||
//直线移动
|
//直线移动
|
||||||
if(this.AType == AType.linear) this.startLinearMove(deltaTime);
|
// if(this.AType == AType.linear) this.startLinearMove(deltaTime);
|
||||||
this.toDestroy();
|
this.toDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user