局内设置
This commit is contained in:
@@ -4,7 +4,7 @@ export const HeroInfo = {
|
||||
uuid: 9001, path: "k1", type: 1, lv: 1,name: "白骑士", wp:1001,arm:2001,ring:3001,shoes:4001,
|
||||
exp_type:0,lv2:5,lv3:10,lv4:20,lv5:30,a_exp:1,ua_exp:1,d_exp:10,ed_exp:1,a_buff:8101,ua_buff:8201,d_buff:8301,ed_buff:8401,
|
||||
ap: 20, ap_rate:0.1, hp: 100, hp_rate:0.1, def:10,def_rate:0.1,dis: 100, a_cd: 1, power: 0, power_max: 15, speed: 100,vun:0,crit:20,crit_add:0,dodge:0,
|
||||
sk1: 9001, sk2: 2002, sk3: 9003, sk4: 9004, sk5: 9005, sk6: 9006, atktype: 1,skr:[0,10,20,30,40,50],uar:[0,10,20,30,40,50],
|
||||
sk1: 9001, sk2: 2002, sk3: 9003, sk4: 9004, sk5: 9005, sk6: 9006, atktype: 1,skr:[0,10,20,30,40,50],uar:[0,10,20,30,40,50],dr:[0,10,20,30,40,50],
|
||||
},
|
||||
|
||||
|
||||
|
||||
@@ -396,6 +396,8 @@ export class HeroViewComp extends CCComp {
|
||||
//使用max_skill
|
||||
handle_skill(skill:number){
|
||||
this.as.atk()
|
||||
this.tooltip(3,smc.skills[skill].name,skill);
|
||||
|
||||
switch (smc.skills[skill].tg) {
|
||||
case 0: //自己
|
||||
this.to_add_buff(this.node.getComponent(HeroViewComp),skill)
|
||||
@@ -416,37 +418,36 @@ export class HeroViewComp extends CCComp {
|
||||
break;
|
||||
}
|
||||
}
|
||||
shoot_enemy(sk1:number,y:number=0,x:number=0){
|
||||
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[sk1].ap+this.ap_buff+increase_ap;
|
||||
let ap = smc.skills[sk].ap+this.ap_buff+increase_ap;
|
||||
let {pos,t_pos}=this.get_enemy_pos()
|
||||
pos.y=pos.y + y
|
||||
pos.x=pos.x + x
|
||||
let is_crit=this.check_crit()
|
||||
skill.load(pos,this.box_group,this.node,sk1,ap,t_pos,is_crit,this.crit_add);
|
||||
console.log(this.scale+this.hero_name+"使用技能:"+sk1);
|
||||
// this.tooltip(3,smc.skills[sk1].name,this.sk1);
|
||||
skill.load(pos,this.box_group,this.node,sk,ap,t_pos,is_crit,this.crit_add);
|
||||
console.log(this.scale+this.hero_name+"使用技能:"+sk);
|
||||
}
|
||||
to_add_buff(hero:any,s_uuid:number){
|
||||
to_add_buff(hero:any,sk:number){
|
||||
let skill = ecs.getEntity<Skill>(Skill);
|
||||
let ap = smc.skills[s_uuid].ap+this.ap;
|
||||
let ap = smc.skills[sk].ap+this.ap;
|
||||
let {pos,t_pos}=this.get_hero_pos(hero)
|
||||
console.log("to_add_buff:"+hero.hero_name+" "+s_uuid);
|
||||
console.log("to_add_buff:"+hero.hero_name+" "+sk);
|
||||
let is_crit=this.check_crit()
|
||||
skill.load(pos,this.box_group,this.node,this.sk2,ap,t_pos,is_crit,this.crit_add);
|
||||
if(smc.skills[s_uuid].hp > 0){ //buff加血
|
||||
let increase_hp=Math.floor(smc.skills[s_uuid].hp*this.ap)
|
||||
skill.load(pos,this.box_group,this.node,sk,ap,t_pos,is_crit,this.crit_add);
|
||||
if(smc.skills[sk].hp > 0){ //buff加血
|
||||
let increase_hp=Math.floor(smc.skills[sk].hp*this.ap)
|
||||
hero.add_hp(increase_hp)
|
||||
}
|
||||
if(smc.skills[s_uuid].ap > 0){ //buff加攻击
|
||||
let increase_atk=Math.floor(smc.skills[s_uuid].ap*this.ap)
|
||||
hero.add_ap(increase_atk,smc.skills[s_uuid].bsd)
|
||||
if(smc.skills[sk].ap > 0){ //buff加攻击
|
||||
let increase_atk=Math.floor(smc.skills[sk].ap*this.ap)
|
||||
hero.add_ap(increase_atk,smc.skills[sk].bsd)
|
||||
}
|
||||
|
||||
if(smc.skills[s_uuid].shield > 0){ //buff护盾
|
||||
hero.add_shield(smc.skills[s_uuid].shield)
|
||||
if(smc.skills[sk].shield > 0){ //buff护盾
|
||||
hero.add_shield(smc.skills[sk].shield)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
38
assets/script/game/map/MIssionController.ts
Normal file
38
assets/script/game/map/MIssionController.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,resources,Sprite,SpriteAtlas,UITransform,v3 } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { HeroModelComp } from "../hero/HeroModelComp";
|
||||
import { RewardSet } from "../common/config/RewardSet";
|
||||
import { GameSet } from "../common/config/BoxSet";
|
||||
import { GameMap } from "./GameMap";
|
||||
import { MapModelComp } from "./model/MapModelComp";
|
||||
import { Talent } from "../Role/Talent";
|
||||
import { Talents } from "../common/config/TalentSet";
|
||||
import { MonViewComp } from "../mon/MonViewComp";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { RoleViewComp } from "../Role/RoleViewComp";
|
||||
import { BossViewComp } from "../Boss/BossViewComp";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('MissionComp')
|
||||
@ecs.register('Mission', false)
|
||||
export class MissionComp extends CCComp {
|
||||
|
||||
protected onLoad(): void {
|
||||
|
||||
|
||||
}
|
||||
start() {
|
||||
|
||||
}
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
1
assets/script/game/map/MIssionController.ts.meta
Normal file
1
assets/script/game/map/MIssionController.ts.meta
Normal file
@@ -0,0 +1 @@
|
||||
{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"9cbe48f9-8c14-41b7-b699-2ae076311a17","files":[],"subMetas":{},"userData":{}}
|
||||
@@ -51,13 +51,13 @@ export class TooltipCom extends CCComp {
|
||||
).start()
|
||||
break
|
||||
case 3:
|
||||
this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = smc.skills[this.s_uuid].name;
|
||||
this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = "<"+smc.skills[this.s_uuid].name+">";
|
||||
this.node.getChildByName("skill").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y+60))
|
||||
// this.alive_time = 2
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x,this.node.position.y+30), },
|
||||
{position:v3(this.node.position.x,this.node.position.y), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
@@ -77,13 +77,13 @@ export class TooltipCom extends CCComp {
|
||||
).start()
|
||||
break
|
||||
case 5:
|
||||
this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("skill").active=true;
|
||||
this.node.getChildByName("uskill").getChildByName("name").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("uskill").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y+60))
|
||||
// this.alive_time = 2
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x-20,this.node.position.y+30), },
|
||||
{position:v3(this.node.position.x-20,this.node.position.y), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
|
||||
Reference in New Issue
Block a user