修改了挺多, 继续完善 战斗流程设计
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
|||||||
import { _decorator, Component, Node, view, UITransform, Vec3, math, EventHandler, Graphics, Color, TweenEasing, Enum } from 'cc';
|
import { _decorator, Component, Node, view, UITransform, Vec3, math, EventHandler, Graphics, Color, TweenEasing, Enum } from 'cc';
|
||||||
import { SkillCom } from '../skills/SkillCom';
|
import { SkillCom } from '../skills/SkillCom';
|
||||||
|
import { smc } from '../common/SingletonModuleComp';
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
// 定义缓动类型枚举
|
// 定义缓动类型枚举
|
||||||
@@ -139,7 +140,7 @@ export class BezierMove extends Component {
|
|||||||
|
|
||||||
|
|
||||||
update(deltaTime: number) {
|
update(deltaTime: number) {
|
||||||
if (!this._isMoving || this._totalTime <= 0) return; // 如果没有移动或路径生成失败,则返回
|
if (!this._isMoving || this._totalTime <= 0||smc.mission.pause||!smc.mission.play) return; // 如果没有移动或路径生成失败,则返回
|
||||||
|
|
||||||
// 更新进度
|
// 更新进度
|
||||||
this._t += deltaTime / this._totalTime;
|
this._t += deltaTime / this._totalTime;
|
||||||
@@ -152,7 +153,7 @@ export class BezierMove extends Component {
|
|||||||
this.node.setPosition(this._endPoint);
|
this.node.setPosition(this._endPoint);
|
||||||
this._isMoving = false;
|
this._isMoving = false;
|
||||||
// 触发移动完成事件
|
// 触发移动完成事件
|
||||||
console.log("onMoveComplete")
|
// console.log("onMoveComplete")
|
||||||
let skill=this.node.getComponent(SkillCom)
|
let skill=this.node.getComponent(SkillCom)
|
||||||
if(skill){
|
if(skill){
|
||||||
skill.doDestroy()
|
skill.doDestroy()
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export class SingletonModuleComp extends ecs.Comp {
|
|||||||
status:0, //0:未开始 1:进行中 2:胜利 3:失败
|
status:0, //0:未开始 1:进行中 2:胜利 3:失败
|
||||||
play:false,
|
play:false,
|
||||||
pause:false,
|
pause:false,
|
||||||
|
in_select:false,
|
||||||
score:888,
|
score:888,
|
||||||
};
|
};
|
||||||
fight_heros=[]
|
fight_heros=[]
|
||||||
|
|||||||
@@ -40,4 +40,5 @@ export enum GameEvent {
|
|||||||
EquipRemove = "EquipRemove",
|
EquipRemove = "EquipRemove",
|
||||||
EquipSelect = "EquipSelect",
|
EquipSelect = "EquipSelect",
|
||||||
EquipSelectEnd = "EquipSelectEnd",
|
EquipSelectEnd = "EquipSelectEnd",
|
||||||
|
WaveUpdate = "WaveUpdate",
|
||||||
}
|
}
|
||||||
@@ -52,32 +52,34 @@ export const MissionStatus = {
|
|||||||
end:4,
|
end:4,
|
||||||
}
|
}
|
||||||
export enum FightSet {
|
export enum FightSet {
|
||||||
ATK_TO_ATK_RATIO=0.1,
|
FRIND_WAVE_UP=2, //伙伴登场波次
|
||||||
ATK_TO_HP_RATIO=0.2,
|
// ATK_TO_ATK_RATIO=0.1,
|
||||||
ATK_TO_SHIELD_RATIO=2,
|
// ATK_TO_HP_RATIO=0.2,
|
||||||
ATK_LINES = 3, //英雄数
|
// ATK_TO_SHIELD_RATIO=2,
|
||||||
MON_GOLD_ADD =2,
|
// ATK_LINES = 3, //英雄数
|
||||||
MON_COIN_ADD=2,
|
// MON_GOLD_ADD =2,
|
||||||
COIN_ADD=1,
|
// MON_COIN_ADD=2,
|
||||||
DEF_RATE=0.7,
|
// COIN_ADD=1,
|
||||||
DODGE_MAX=70,
|
// DEF_RATE=0.7,
|
||||||
HERO_NUM=3,
|
// DODGE_MAX=70,
|
||||||
AP_UPDATE_RATE=100,
|
// HERO_NUM=3,
|
||||||
AP_CHANGE_RATE=0,
|
// AP_UPDATE_RATE=100,
|
||||||
|
// AP_CHANGE_RATE=0,
|
||||||
}
|
}
|
||||||
export const MissionData = {
|
export const MissionData = {
|
||||||
gold:10,//金币
|
gold:10,//金币
|
||||||
score:0,//分数
|
score:0,//分数
|
||||||
|
refrsh_time:5, //刷新时间
|
||||||
refresh_gold:3,//刷新金币
|
refresh_gold:3,//刷新金币
|
||||||
refrsh_time:1, //刷新时间
|
|
||||||
call_gold:0,//召唤金币
|
call_gold:0,//召唤金币
|
||||||
add_gold:1,//金币增加
|
add_gold:1,//金币增加
|
||||||
change_gold:0,//金币变化
|
change_gold:0,//金币变化
|
||||||
exp:0,//经验
|
back_gold:1,//返还金币
|
||||||
skp:0,//技能点
|
buff_back_gold:0,//额外返还金币
|
||||||
box:0,//宝箱
|
buff_add_gold:0,//额外增加金币
|
||||||
energy:0,//能量
|
buff_refrsh_time:0,//额外刷新时间
|
||||||
hp:0,//血量
|
buff_refresh_gold:0,//额外发现所需的金币
|
||||||
ap:0,//攻击
|
current_wave:0,
|
||||||
lv:0,
|
in_fight:false,
|
||||||
|
fight_time:0,//战斗时间
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export class CardComp extends CCComp {
|
|||||||
onLoad(){
|
onLoad(){
|
||||||
// this.on(GameEvent.HeroSelect,this.hero_select,this)
|
// this.on(GameEvent.HeroSelect,this.hero_select,this)
|
||||||
// this.on(GameEvent.HeroSkillSelect,this.hero_skill_select,this)
|
// this.on(GameEvent.HeroSkillSelect,this.hero_skill_select,this)
|
||||||
this.on(GameEvent.CardRefresh,this.onCardRefresh,this)
|
// this.on(GameEvent.CardRefresh,this.rad,this)
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
@@ -36,10 +36,10 @@ export class CardComp extends CCComp {
|
|||||||
this.node.getChildByName("Button").active=false
|
this.node.getChildByName("Button").active=false
|
||||||
this.node.getChildByName("show").active=false
|
this.node.getChildByName("show").active=false
|
||||||
}
|
}
|
||||||
hero_select(event: string, args: any){
|
hero_select(args: any){
|
||||||
this.c_type=0
|
this.c_type=0
|
||||||
this.c_uuid=args.uuid
|
this.c_uuid=args.uuid
|
||||||
console.log("onCardRefresh c_uuid:"+this.c_uuid)
|
console.log("card hero_select c_uuid:"+this.c_uuid)
|
||||||
this.show_hero(this.c_uuid)
|
this.show_hero(this.c_uuid)
|
||||||
this.node.getChildByName("show").active=false
|
this.node.getChildByName("show").active=false
|
||||||
this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup')
|
this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup')
|
||||||
@@ -48,7 +48,7 @@ export class CardComp extends CCComp {
|
|||||||
this.node.getChildByName("Button").active=true
|
this.node.getChildByName("Button").active=true
|
||||||
}, 0.1);
|
}, 0.1);
|
||||||
}
|
}
|
||||||
hero_skill_select(event: string, args: any){
|
hero_skill_select(args: any){
|
||||||
this.c_type=1
|
this.c_type=1
|
||||||
console.log("card hero_skill_select",args)
|
console.log("card hero_skill_select",args)
|
||||||
this.c_uuid=args.uuid
|
this.c_uuid=args.uuid
|
||||||
@@ -60,7 +60,7 @@ export class CardComp extends CCComp {
|
|||||||
this.node.getChildByName("Button").active=true
|
this.node.getChildByName("Button").active=true
|
||||||
}, 0.1);
|
}, 0.1);
|
||||||
}
|
}
|
||||||
equip_select(event: string, args: any){
|
equip_select(args: any){
|
||||||
this.c_type=2
|
this.c_type=2
|
||||||
this.c_uuid=args.uuid
|
this.c_uuid=args.uuid
|
||||||
this.node.getChildByName("show").active=false
|
this.node.getChildByName("show").active=false
|
||||||
@@ -71,19 +71,21 @@ export class CardComp extends CCComp {
|
|||||||
this.node.getChildByName("Button").active=true
|
this.node.getChildByName("Button").active=true
|
||||||
}, 0.1);
|
}, 0.1);
|
||||||
}
|
}
|
||||||
onCardRefresh(event: string, args: any){
|
func_select(args: any){
|
||||||
|
console.log("card func_select",args)
|
||||||
let card =getRandomCardUUID()
|
}
|
||||||
console.log("onCardRefresh 开始请求卡牌",card)
|
random_select(){
|
||||||
|
let card =getRandomCardUUID() //随机获取卡牌类型
|
||||||
|
console.log("rad 开始请求卡牌",card)
|
||||||
switch(card.type){
|
switch(card.type){
|
||||||
case cardType.HERO:
|
case cardType.HERO:
|
||||||
this.hero_select(GameEvent.HeroSelect,card)
|
this.hero_select(card)
|
||||||
break
|
break
|
||||||
case cardType.SKILL:
|
case cardType.SKILL:
|
||||||
this.hero_skill_select(GameEvent.HeroSkillSelect,card)
|
this.hero_skill_select(card)
|
||||||
break
|
break
|
||||||
case cardType.EQUIP:
|
case cardType.EQUIP:
|
||||||
this.equip_select(GameEvent.EquipSelect,card)
|
this.equip_select(card)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
|
|||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
import { CardComp } from "./CardComp";
|
import { CardComp } from "./CardComp";
|
||||||
import { cardType, getRandomCardsByType } from "../common/config/CardSet";
|
import { cardType, getRandomCardsByType } from "../common/config/CardSet";
|
||||||
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
@@ -20,16 +21,22 @@ export class CardsCompComp extends CCComp {
|
|||||||
card3c:CardComp=null
|
card3c:CardComp=null
|
||||||
card4c:CardComp=null
|
card4c:CardComp=null
|
||||||
|
|
||||||
|
/** 卡牌展示队列 */
|
||||||
|
private cardQueue: Array<{type: GameEvent, data?: any}> = [];
|
||||||
|
/** 是否正在展示卡牌 */
|
||||||
|
private isShowing: boolean = false;
|
||||||
|
|
||||||
/** 视图层逻辑代码分离演示 */
|
/** 视图层逻辑代码分离演示 */
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||||
this.on(GameEvent.HeroSkillSelect, this.onHeroSkillSelect, this);
|
this.on(GameEvent.HeroSkillSelect, this.addToQueue, this);
|
||||||
this.on(GameEvent.HeroSkillSelectEnd, this.hide, this);
|
this.on(GameEvent.HeroSelect, this.addToQueue, this);
|
||||||
this.on(GameEvent.HeroSelect, this.onHeroSelect, this);
|
this.on(GameEvent.CardRefresh, this.addToQueue, this);
|
||||||
this.on(GameEvent.HeroSelectEnd, this.hide, this);
|
|
||||||
this.on(GameEvent.CardRefresh, this.show, this);
|
this.on(GameEvent.HeroSkillSelectEnd, this.close_cards, this);
|
||||||
this.on(GameEvent.CardRefreshEnd, this.hide, this);
|
this.on(GameEvent.HeroSelectEnd, this.close_cards, this);
|
||||||
this.on(GameEvent.CardsClose, this.hide, this);
|
this.on(GameEvent.CardRefreshEnd, this.close_cards, this);
|
||||||
|
this.on(GameEvent.CardsClose, this.close_cards, this);
|
||||||
|
|
||||||
this.card1=this.node.getChildByName("card1")
|
this.card1=this.node.getChildByName("card1")
|
||||||
this.card2=this.node.getChildByName("card2")
|
this.card2=this.node.getChildByName("card2")
|
||||||
@@ -42,29 +49,99 @@ export class CardsCompComp extends CCComp {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
onHeroSelect(event: string, args: any){
|
hero_select(){
|
||||||
this.show(GameEvent.HeroSelect,args)
|
|
||||||
let list=getRandomCardsByType(cardType.HERO,4)
|
let list=getRandomCardsByType(cardType.HERO,4)
|
||||||
console.log("cards onHeroSelect",list)
|
console.log("英雄选择卡牌列表",list)
|
||||||
this.card1c.hero_select(GameEvent.HeroSelect,list[0])
|
this.card1c.hero_select(list[0])
|
||||||
this.card2c.hero_select(GameEvent.HeroSelect,list[1])
|
this.card2c.hero_select(list[1])
|
||||||
this.card3c.hero_select(GameEvent.HeroSelect,list[2])
|
this.card3c.hero_select(list[2])
|
||||||
this.card4c.hero_select(GameEvent.HeroSelect,list[3])
|
this.card4c.hero_select(list[3])
|
||||||
}
|
}
|
||||||
|
|
||||||
onHeroSkillSelect(event: string, args: any){
|
hero_skill_select(){
|
||||||
|
|
||||||
this.show(GameEvent.HeroSkillSelect,args)
|
|
||||||
let list=getRandomCardsByType(cardType.SKILL,4)
|
let list=getRandomCardsByType(cardType.SKILL,4)
|
||||||
console.log("cards onHeroSkillSelect",list)
|
console.log("技能选择卡牌列表",list)
|
||||||
this.card1c.hero_skill_select(GameEvent.HeroSkillSelect,list[0])
|
this.card1c.hero_skill_select(list[0])
|
||||||
this.card2c.hero_skill_select(GameEvent.HeroSkillSelect,list[1])
|
this.card2c.hero_skill_select(list[1])
|
||||||
this.card3c.hero_skill_select(GameEvent.HeroSkillSelect,list[2])
|
this.card3c.hero_skill_select(list[2])
|
||||||
this.card4c.hero_skill_select(GameEvent.HeroSkillSelect,list[3])
|
this.card4c.hero_skill_select(list[3])
|
||||||
|
}
|
||||||
|
equip_select(){
|
||||||
|
let list=getRandomCardsByType(cardType.EQUIP,4)
|
||||||
|
console.log("装备选择卡牌列表",list)
|
||||||
|
this.card1c.equip_select(list[0])
|
||||||
|
this.card2c.equip_select(list[1])
|
||||||
|
this.card3c.equip_select(list[2])
|
||||||
|
this.card4c.equip_select(list[3])
|
||||||
|
}
|
||||||
|
func_select(){
|
||||||
|
console.log("功能选择卡牌")
|
||||||
|
}
|
||||||
|
random_select(){
|
||||||
|
this.card1c.random_select()
|
||||||
|
this.card2c.random_select()
|
||||||
|
this.card3c.random_select()
|
||||||
|
this.card4c.random_select()
|
||||||
}
|
}
|
||||||
|
|
||||||
show(e:GameEvent,data:any){
|
/** 添加卡牌展示到队列 */
|
||||||
|
private addToQueue(e: GameEvent, data?: any) {
|
||||||
|
console.log("添加卡牌到队列", e);
|
||||||
|
this.cardQueue.push({type: e, data: data});
|
||||||
|
this.processQueue();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 处理卡牌队列 */
|
||||||
|
private processQueue() {
|
||||||
|
if (this.isShowing || this.cardQueue.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const nextCard = this.cardQueue.shift();
|
||||||
|
this.isShowing = true;
|
||||||
|
this.show_cards(nextCard.type, nextCard.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
show_cards(e:GameEvent,data:any){
|
||||||
|
this.node.getChildByName("Button").active=false
|
||||||
|
switch(e){
|
||||||
|
case GameEvent.HeroSelect:
|
||||||
|
console.log("显示英雄选择卡牌")
|
||||||
|
this.hero_select()
|
||||||
|
break
|
||||||
|
case GameEvent.HeroSkillSelect:
|
||||||
|
console.log("显示技能选择卡牌")
|
||||||
|
this.hero_skill_select()
|
||||||
|
break
|
||||||
|
case GameEvent.CardRefresh:
|
||||||
|
console.log("显示随机刷新卡牌")
|
||||||
|
this.node.getChildByName("Button").active=true
|
||||||
|
this.random_select()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
this.show()
|
||||||
|
}
|
||||||
|
close_cards(e:GameEvent,data:any){
|
||||||
|
switch(e){
|
||||||
|
case GameEvent.HeroSelect:
|
||||||
|
console.log("关闭英雄选择卡牌")
|
||||||
|
break
|
||||||
|
case GameEvent.HeroSkillSelect:
|
||||||
|
console.log("关闭技能选择卡牌")
|
||||||
|
break
|
||||||
|
case GameEvent.CardRefresh:
|
||||||
|
console.log("关闭随机刷新卡牌")
|
||||||
|
break
|
||||||
|
case GameEvent.CardsClose:
|
||||||
|
console.log("关闭所有卡牌")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
this.hide()
|
||||||
|
}
|
||||||
|
show(){
|
||||||
// 设置初始状态
|
// 设置初始状态
|
||||||
|
smc.mission.pause=true
|
||||||
this.node.setPosition(v3(0, 0, 0));
|
this.node.setPosition(v3(0, 0, 0));
|
||||||
this.node.setScale(v3(0, 0, 1));
|
this.node.setScale(v3(0, 0, 1));
|
||||||
|
|
||||||
@@ -77,7 +154,8 @@ export class CardsCompComp extends CCComp {
|
|||||||
.start();
|
.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
hide(e:GameEvent,data:any){
|
hide(){
|
||||||
|
smc.mission.pause=false
|
||||||
tween(this.node)
|
tween(this.node)
|
||||||
.parallel(
|
.parallel(
|
||||||
tween().to(0.3, { scale: v3(0, 0, 1) }, { easing: 'backIn' }),
|
tween().to(0.3, { scale: v3(0, 0, 1) }, { easing: 'backIn' }),
|
||||||
@@ -85,12 +163,23 @@ export class CardsCompComp extends CCComp {
|
|||||||
)
|
)
|
||||||
.call(()=>{
|
.call(()=>{
|
||||||
this.node.setPosition(v3(0, -1000, 0));
|
this.node.setPosition(v3(0, -1000, 0));
|
||||||
|
this.isShowing = false;
|
||||||
|
this.processQueue(); // 处理队列中的下一个卡牌
|
||||||
})
|
})
|
||||||
.start();
|
.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//放弃选择
|
||||||
|
give_up_select(){
|
||||||
|
this.hide()
|
||||||
|
let mission_data=smc.vmdata.mission_data
|
||||||
|
mission_data.gold+=(mission_data.back_gold+mission_data.buff_back_gold) //返还金币
|
||||||
|
}
|
||||||
|
|
||||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||||
reset() {
|
reset() {
|
||||||
|
this.cardQueue = [];
|
||||||
|
this.isShowing = false;
|
||||||
this.node.destroy();
|
this.node.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
|||||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||||
import { MissionData, Missions, MissionStatus} from "../common/config/Mission";
|
import { FightSet, MissionData, Missions, MissionStatus} from "../common/config/Mission";
|
||||||
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||||
@@ -21,23 +21,44 @@ export class MissionComp extends CCComp {
|
|||||||
reward:number = 0;
|
reward:number = 0;
|
||||||
reward_num:number = 0;
|
reward_num:number = 0;
|
||||||
GlodAddTimer:Timer = new Timer(1);
|
GlodAddTimer:Timer = new Timer(1);
|
||||||
|
waveTimer:Timer = new Timer(10);
|
||||||
|
normal_max_wave:number = 10;
|
||||||
|
is_fight:boolean = false;
|
||||||
onLoad(){
|
onLoad(){
|
||||||
this.on(GameEvent.MissionStart,this.mission_start,this)
|
this.on(GameEvent.MissionStart,this.mission_start,this)
|
||||||
this.on(GameEvent.FightEnd,this.fight_end,this)
|
this.on(GameEvent.FightEnd,this.fight_end,this)
|
||||||
this.on(GameEvent.MissionEnd,this.mission_end,this)
|
this.on(GameEvent.MissionEnd,this.mission_end,this)
|
||||||
this.on(GameEvent.CardsClose,this.after_used_skill_card,this)
|
this.on(GameEvent.CardsClose,this.after_used_skill_card,this)
|
||||||
|
this.on(GameEvent.WaveUpdate,this.on_mon_wave_update,this)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected update(dt: number): void {
|
protected update(dt: number): void {
|
||||||
if(!smc.mission.play||smc.mission.pause){
|
if(!smc.mission.play||smc.mission.pause){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if(smc.vmdata.mission_data.in_fight){
|
||||||
|
smc.vmdata.mission_data.fight_time+=dt
|
||||||
if(this.GlodAddTimer.update(dt)){
|
if(this.GlodAddTimer.update(dt)){
|
||||||
smc.vmdata.mission_data.gold+=smc.vmdata.mission_data.add_gold
|
smc.vmdata.mission_data.gold+=(smc.vmdata.mission_data.add_gold+smc.vmdata.mission_data.buff_add_gold)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private on_mon_wave_update(){
|
||||||
|
smc.vmdata.mission_data.current_wave++
|
||||||
|
console.log("[任务系统] 当前波次 :",smc.vmdata.mission_data.current_wave)
|
||||||
|
switch(smc.vmdata.mission_data.current_wave){
|
||||||
|
case FightSet.FRIND_WAVE_UP:
|
||||||
|
this.to_hero_select()
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async mission_start(){
|
async mission_start(){
|
||||||
smc.mission.status=MissionStatus.ready
|
smc.mission.status=MissionStatus.ready
|
||||||
oops.message.dispatchEvent(GameEvent.FightReady)
|
oops.message.dispatchEvent(GameEvent.FightReady)
|
||||||
@@ -60,15 +81,10 @@ export class MissionComp extends CCComp {
|
|||||||
after_used_skill_card(){
|
after_used_skill_card(){
|
||||||
switch(smc.mission.status){
|
switch(smc.mission.status){
|
||||||
case MissionStatus.ready_skill_select:
|
case MissionStatus.ready_skill_select:
|
||||||
console.log("next to_hero_select")
|
console.log("next => to_fight")
|
||||||
this.scheduleOnce(()=>{
|
this.scheduleOnce(()=>{
|
||||||
this.to_hero_select()
|
|
||||||
},0.3)
|
|
||||||
|
|
||||||
break
|
|
||||||
case MissionStatus.ready_hero_select:
|
|
||||||
console.log("netx to_fight")
|
|
||||||
this.to_fight()
|
this.to_fight()
|
||||||
|
},0.3)
|
||||||
break
|
break
|
||||||
case MissionStatus.playing:
|
case MissionStatus.playing:
|
||||||
break
|
break
|
||||||
@@ -82,6 +98,7 @@ export class MissionComp extends CCComp {
|
|||||||
|
|
||||||
to_fight(){
|
to_fight(){
|
||||||
smc.mission.status=MissionStatus.playing
|
smc.mission.status=MissionStatus.playing
|
||||||
|
smc.vmdata.mission_data.in_fight=true
|
||||||
oops.message.dispatchEvent(GameEvent.FightStart)
|
oops.message.dispatchEvent(GameEvent.FightStart)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,9 +116,11 @@ export class MissionComp extends CCComp {
|
|||||||
this.cleanComponents()
|
this.cleanComponents()
|
||||||
}, 0.5)
|
}, 0.5)
|
||||||
}
|
}
|
||||||
|
|
||||||
mission_end(){
|
mission_end(){
|
||||||
this.node.active=false
|
this.node.active=false
|
||||||
}
|
}
|
||||||
|
|
||||||
data_init(){
|
data_init(){
|
||||||
//局内数据初始化
|
//局内数据初始化
|
||||||
console.log("局内数据初始化")
|
console.log("局内数据初始化")
|
||||||
@@ -121,12 +140,13 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
card_refresh(){
|
card_refresh(){
|
||||||
if(smc.vmdata.mission_data.gold< smc.vmdata.mission_data.refresh_gold){
|
let mission_data=smc.vmdata.mission_data
|
||||||
|
if(mission_data.gold < (mission_data.refresh_gold+mission_data.buff_refresh_gold)){
|
||||||
oops.gui.toast("金币不足", false);
|
oops.gui.toast("金币不足", false);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
oops.message.dispatchEvent(GameEvent.CardRefresh)
|
oops.message.dispatchEvent(GameEvent.CardRefresh)
|
||||||
smc.vmdata.mission_data.gold-=smc.vmdata.mission_data.refresh_gold
|
mission_data.gold-=(mission_data.refresh_gold+mission_data.buff_refresh_gold)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { RandomManager } from "db://oops-framework/core/common/random/RandomMana
|
|||||||
import { Timer } from "db://oops-framework/core/common/timer/Timer";
|
import { Timer } from "db://oops-framework/core/common/timer/Timer";
|
||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
@@ -52,7 +53,8 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
|
|
||||||
|
|
||||||
mon_refresh(){
|
mon_refresh(){
|
||||||
console.log("mon_refresh:start load monster lv :",smc.mission.lv)
|
oops.message.dispatchEvent(GameEvent.WaveUpdate)
|
||||||
|
console.log("怪物登场,当前波次 :",smc.vmdata.mission_data.current_wave)
|
||||||
let positions = [0, 1, 2];
|
let positions = [0, 1, 2];
|
||||||
positions.forEach(pos => {
|
positions.forEach(pos => {
|
||||||
let x = RandomManager.instance.getRandomInt(0, Missions[0].length, 1);
|
let x = RandomManager.instance.getRandomInt(0, Missions[0].length, 1);
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ export class SkillCom extends CCComp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
doDestroy(){
|
doDestroy(){
|
||||||
console.log("doDestroy")
|
// console.log("doDestroy")
|
||||||
this.is_destroy=true
|
this.is_destroy=true
|
||||||
}
|
}
|
||||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
#整个对战流程制作
|
- [ ] 整个对战流程制作
|
||||||
##技能 ,伙伴,装备的出现波次
|
- [ ] 技能 ,伙伴,装备的出现波次
|
||||||
|
- [x] cards 展示逻辑修改,修改为 cards载入后再通知card更新特定卡牌
|
||||||
|
- [x] cards 通过队列进行展示,新展示要求,先加入队列
|
||||||
|
- [x] cards 添加放弃操作, 特定选择不能放弃
|
||||||
11
assets/script/todo.md.meta
Normal file
11
assets/script/todo.md.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.2",
|
||||||
|
"importer": "text",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "fb132ece-b235-4872-92f6-7f5f43d793d8",
|
||||||
|
"files": [
|
||||||
|
".json"
|
||||||
|
],
|
||||||
|
"subMetas": {},
|
||||||
|
"userData": {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user