去除久设计

This commit is contained in:
2024-11-21 23:08:08 +08:00
parent 15ae8f7f01
commit c863bbaae6
6 changed files with 1139 additions and 5816 deletions

View File

@@ -62,8 +62,6 @@ export class SingletonModuleComp extends ecs.Comp {
name : "纸片精灵大乱斗",
game_over:false,
game_pause:false,
gems: 4,
unlock:5,
mission:{
play:false,
pause:false,
@@ -84,95 +82,21 @@ export class SingletonModuleComp extends ecs.Comp {
reward_num:0, //怪物死亡数
reward_gold:0,
reward_exp:0,
hero:{
ap:1,
atk_cd:1,
hp:1,
},
role:{
atk:1,
atk_cd:1,
hp:1,
}
},
role:{
fight_heros:[9001,9001],
gold:9999999,
gems:0,
energy:0,
mission:1,
mission_finish:false,
mission_num:0,
mission_num_max:5,
hero_num:12,
hp:300,
hp_max:300,
speed:0,
atk:10,
atk_dis:700,
buff_atk:0,
mission_atk:0,
atk_time:0,
atk_cd:1,
atk_base_cd:1,
atk_cd_up:0,
mission_atk_cd_up:0,
atk_range:400,
lv:1,
exp:0,
next_exp:100,
power:300,
skill:1004,
skill1:{uuid:1004,cd:3,cd_max:3,alive:true},
skill2:{uuid:1002,cd:3,cd_max:3,alive:true},
skill3:{uuid:1001,cd:3,cd_max:3,alive:false},
skill4:{uuid:1001,cd:3,cd_max:3,alive:false},
skill5:{uuid:1001,cd:3,cd_max:3,alive:false},
items:{
1001:{uuid: 1001,num:0},
1002:{uuid: 1002,num:0},
1003:{uuid: 1003,num:0},
1004:{uuid: 1004,num:0},
1005:{uuid: 1005,num:0},
1006:{uuid: 1006,num:0},
1007:{uuid: 1007,num:0},
1008:{uuid: 1008,num:0},
1009:{uuid: 1009,num:0},
1010:{uuid: 1010,num:0},
}
},
fight_heros:[9001,9001],
items:{
1001:{uuid: 1001,num:0},
},
heros:{
9001:{uuid:9001,lv:1,exp:0},
},
talent:{
1001:{uuid:1001,lv:0,},
1002:{uuid:1002,lv:0,},
1003:{uuid:1003,lv:0,},
1004:{uuid:1004,lv:0,},
1005:{uuid:1005,lv:0,},
1006:{uuid:1006,lv:0,},
1007:{uuid:1007,lv:0,},
1008:{uuid:1008,lv:0,},
1009:{uuid:1009,lv:0,},
1010:{uuid:1010,lv:0,},
1011:{uuid:1011,lv:0,},
1012:{uuid:1012,lv:0,},
1013:{uuid:1013,lv:0,},
1014:{uuid:1014,lv:0,},
1015:{uuid:1015,lv:0,},
1016:{uuid:1016,lv:0,},
},
monster:{
gold_add:1,
},
gold: {
min: 200,
max: 200,
max_limit:200,
time:0,
cd:1,
},
shuaxin: {
min: 0,
max: 5,
speed:1,
},
item_box:{
hp:0,
@@ -185,7 +109,6 @@ export class SingletonModuleComp extends ecs.Comp {
shield:0,
info:"",
}
};
vmAdd() {
VM.add(this.vm_data, "data");

View File

@@ -476,8 +476,7 @@ export class HeroViewComp extends CCComp {
shoot_enemy(sk:number,y:number=0,x:number=0){
// console.log("mon shoot_enemy");
let skill = ecs.getEntity<Skill>(Skill);
let increase_ap=Math.floor(this.ap*smc.vm_data.mission.hero.ap)
let ap = smc.skills[sk].ap+this.ap_buff+increase_ap;
let ap = this.ap;
let {pos,t_pos}=this.get_enemy_pos()
pos.y=pos.y + y
pos.x=pos.x + x

View File

@@ -17,48 +17,23 @@ export class CsuoComp extends CCComp {
}
onTouch() {
if(smc.vm_data.gems < smc.vm_data.unlock){
oops.gui.toast("钻石不足")
return
}
smc.vm_data.gems=smc.vm_data.gems-smc.vm_data.unlock;
this.node.active=false;
}
onOk(){
this.node.active=false;
}
oncancel(){
smc.vm_data.power.min=smc.vm_data.power.min+1;
}
/**
*
*
* @param params 参数
* {
* title: 标题
* content: 内容
* okWord: ok按钮上的文字
* okFunc: 确认时执行的方法
* cancelWord: 取消按钮的文字
* cancelFunc: 取消时执行的方法
* needCancel: 是否需要取消按钮
* }
*/
/** 视图层逻辑代码分离演示 */
start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
// this.on(ModuleEvent.Cmd, this.onHandler, this);
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {
// switch (event) {
// case ModuleEvent.Cmd:
// break;
// }
// }
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {

View File

@@ -314,7 +314,7 @@ export class MissionComp extends CCComp {
}
}
heros_call(){
let heros=smc.vm_data.role.fight_heros
let heros=smc.vm_data.fight_heros
for(let i=0;i<heros.length;i++){
this.addHero(heros[i],i)
}