战斗技能修改为buff
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -91,18 +91,24 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
name : "纸片精灵大乱斗",
|
||||
game_over:false,
|
||||
game_pause:false,
|
||||
buff_num:[2,2,2,2,2],
|
||||
buff_num_max:10,
|
||||
buff_num_less:0,
|
||||
mission:{
|
||||
once:6, //每波刷新怪物数量
|
||||
total:1, //总怪物数
|
||||
exp:0,
|
||||
exp_max:100,
|
||||
mexp:0,
|
||||
mexp_max:100,
|
||||
mexp_max:100,
|
||||
|
||||
buff_num:0,
|
||||
hp:0,
|
||||
ap:0,
|
||||
def:0,
|
||||
crit:0,
|
||||
dodge:0,
|
||||
|
||||
dead:0,
|
||||
mhp:0,
|
||||
map:0,
|
||||
@@ -111,6 +117,17 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
mdodge:0,
|
||||
mdead:0,
|
||||
|
||||
hp_up:0,
|
||||
ap_up:0,
|
||||
def_up:0,
|
||||
crit_up:0,
|
||||
dodge_up:0,
|
||||
mhp_up:0,
|
||||
map_up:0,
|
||||
mdef_up:0,
|
||||
mcrit_up:0,
|
||||
mdodge_up:0,
|
||||
|
||||
reward_num:0, //怪物死亡数
|
||||
reward_gold:0,
|
||||
reward_exp:0,
|
||||
|
||||
@@ -30,5 +30,12 @@ export const MBSet = {
|
||||
hp_exp:100,
|
||||
ap_add:10,
|
||||
def_add:10,
|
||||
hp_add:10,
|
||||
hp_add:50,
|
||||
crit_add:1,
|
||||
dodge_add:1,
|
||||
ap_cost:1,
|
||||
def_cost:1,
|
||||
hp_cost:1,
|
||||
crit_cost:2,
|
||||
dodge_cost:2,
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import { CardControllerComp } from "./CardController";
|
||||
import { MissionComp } from "./MissionComp";
|
||||
import { MSCardComp } from "./MSCardComp";
|
||||
import { HeroSelectComp } from "../hero/HeroSelectComp";
|
||||
import { MBSet } from "../common/config/MissionSet";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -36,8 +37,9 @@ export class MissionHomeComp extends CCComp {
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
this.load_hero_card()
|
||||
this.load_ui_heros()
|
||||
this.load_skill_card()
|
||||
this.select_skill()
|
||||
// this.load_skill_card()
|
||||
// this.select_skill()
|
||||
this.init_buff()
|
||||
}
|
||||
start_mission() {
|
||||
console.log("mission_home : start_mission")
|
||||
@@ -63,6 +65,15 @@ export class MissionHomeComp extends CCComp {
|
||||
smc.mission.play = true;
|
||||
this.node.active=false;
|
||||
}
|
||||
init_buff(){
|
||||
smc.vmdata.mission.ap_up=MBSet.ap_add*smc.vmdata.buff_num[0]/MBSet.ap_cost
|
||||
smc.vmdata.mission.def_up=MBSet.def_add*smc.vmdata.buff_num[1]/MBSet.def_cost
|
||||
smc.vmdata.mission.hp_up=MBSet.hp_add*smc.vmdata.buff_num[2]/MBSet.hp_cost
|
||||
smc.vmdata.mission.crit_up=MBSet.crit_add*smc.vmdata.buff_num[3]/MBSet.crit_cost
|
||||
smc.vmdata.mission.dodge_up=MBSet.dodge_add*smc.vmdata.buff_num[4]/MBSet.dodge_cost
|
||||
smc.vmdata.buff_num_less=smc.vmdata.buff_num_max-smc.vmdata.buff_num[0]-smc.vmdata.buff_num[1]-smc.vmdata.buff_num[2]-smc.vmdata.buff_num[3]-smc.vmdata.buff_num[4]
|
||||
|
||||
}
|
||||
load_hero_card(){
|
||||
|
||||
let hc:number =HeroList.length
|
||||
@@ -156,6 +167,97 @@ export class MissionHomeComp extends CCComp {
|
||||
hide_heros(){
|
||||
this.node.getChildByName("heros").setPosition(0,-800)
|
||||
}
|
||||
show_buff_set(){
|
||||
this.node.getChildByName("buffset").setPosition(0,400)
|
||||
}
|
||||
hide_buff_set(){
|
||||
this.node.getChildByName("buffset").setPosition(0,-800)
|
||||
}
|
||||
add_ap(){
|
||||
if(smc.vmdata.buff_num_less < MBSet.ap_cost){
|
||||
oops.gui.toast("成长点数不足")
|
||||
return
|
||||
}
|
||||
smc.vmdata.buff_num_less -= MBSet.ap_cost
|
||||
smc.vmdata.buff_num[0] += MBSet.ap_cost
|
||||
smc.vmdata.mission.ap_up=MBSet.ap_add*smc.vmdata.buff_num[0]/MBSet.ap_cost
|
||||
}
|
||||
less_ap(){
|
||||
if(smc.vmdata.buff_num[0] <= 0){
|
||||
return
|
||||
}
|
||||
smc.vmdata.buff_num_less += MBSet.ap_cost
|
||||
smc.vmdata.buff_num[0] -= MBSet.ap_cost
|
||||
smc.vmdata.mission.ap_up=MBSet.ap_add*smc.vmdata.buff_num[0]/MBSet.ap_cost
|
||||
}
|
||||
add_def(){
|
||||
if(smc.vmdata.buff_num_less < MBSet.def_cost){
|
||||
oops.gui.toast("成长点数不足")
|
||||
return
|
||||
}
|
||||
smc.vmdata.buff_num_less -= MBSet.def_cost
|
||||
smc.vmdata.buff_num[1] += MBSet.def_cost
|
||||
smc.vmdata.mission.def_up=MBSet.def_add*smc.vmdata.buff_num[1]/MBSet.def_cost
|
||||
}
|
||||
less_def(){
|
||||
if(smc.vmdata.buff_num[1] <= 0){
|
||||
return
|
||||
}
|
||||
smc.vmdata.buff_num_less += MBSet.def_cost
|
||||
smc.vmdata.buff_num[1] -= MBSet.def_cost
|
||||
smc.vmdata.mission.def_up=MBSet.def_add*smc.vmdata.buff_num[1]/MBSet.def_cost
|
||||
}
|
||||
add_hp(){
|
||||
if(smc.vmdata.buff_num_less < MBSet.hp_cost){
|
||||
oops.gui.toast("成长点数不足")
|
||||
return
|
||||
}
|
||||
smc.vmdata.buff_num_less -= MBSet.hp_cost
|
||||
smc.vmdata.buff_num[2] += MBSet.hp_cost
|
||||
smc.vmdata.mission.hp_up=MBSet.hp_add*smc.vmdata.buff_num[2]/MBSet.hp_cost
|
||||
}
|
||||
less_hp(){
|
||||
if(smc.vmdata.buff_num[2] <= 0){
|
||||
return
|
||||
}
|
||||
smc.vmdata.buff_num_less += MBSet.hp_cost
|
||||
smc.vmdata.buff_num[2] -= MBSet.hp_cost
|
||||
smc.vmdata.mission.hp_up=MBSet.hp_add*smc.vmdata.buff_num[2]/MBSet.hp_cost
|
||||
}
|
||||
add_crit(){
|
||||
if(smc.vmdata.buff_num_less < MBSet.crit_cost){
|
||||
oops.gui.toast("成长点数不足")
|
||||
return
|
||||
}
|
||||
smc.vmdata.buff_num_less -= MBSet.crit_cost
|
||||
smc.vmdata.buff_num[3] += MBSet.crit_cost
|
||||
smc.vmdata.mission.crit_up=MBSet.crit_add*smc.vmdata.buff_num[3]/MBSet.crit_cost
|
||||
}
|
||||
less_crit(){
|
||||
if(smc.vmdata.buff_num[3] <= 0){
|
||||
return
|
||||
}
|
||||
smc.vmdata.buff_num_less += MBSet.crit_cost
|
||||
smc.vmdata.buff_num[3] -= MBSet.crit_cost
|
||||
smc.vmdata.mission.crit_up=MBSet.crit_add*smc.vmdata.buff_num[3]/MBSet.crit_cost
|
||||
}
|
||||
add_dodge(){
|
||||
if(smc.vmdata.buff_num_less < MBSet.dodge_cost){
|
||||
oops.gui.toast("成长点数不足")
|
||||
return
|
||||
}
|
||||
smc.vmdata.buff_num_less -= MBSet.dodge_cost
|
||||
smc.vmdata.buff_num[4] += MBSet.dodge_cost
|
||||
smc.vmdata.mission.dodge_up=MBSet.dodge_add*smc.vmdata.buff_num[4]/MBSet.dodge_cost
|
||||
}
|
||||
less_dodge(){
|
||||
if(smc.vmdata.buff_num[4] <= 0){
|
||||
return
|
||||
}
|
||||
smc.vmdata.buff_num_less += MBSet.dodge_cost
|
||||
smc.vmdata.buff_num[4] -= MBSet.dodge_cost
|
||||
smc.vmdata.mission.dodge_up=MBSet.dodge_add*smc.vmdata.buff_num[4]/MBSet.dodge_cost
|
||||
}
|
||||
show_skills(){
|
||||
this.node.getChildByName("skills").setPosition(0,400)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user