场景技能 环境设置完成,下步 技能执行

This commit is contained in:
2024-11-20 10:56:22 +08:00
parent d930cb1b81
commit 9e7cf05231
6 changed files with 2142 additions and 4655 deletions

View File

@@ -23,25 +23,28 @@
},
{
"__id__": 8
},
{
"__id__": 14
}
],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 18
},
{
"__id__": 20
},
{
"__id__": 22
},
{
"__id__": 24
},
{
"__id__": 26
}
],
"_prefab": {
"__id__": 22
"__id__": 28
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -74,7 +77,7 @@
},
{
"__type__": "cc.Node",
"_name": "icon",
"_name": "Button_SkillBtn_Orange",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
@@ -136,8 +139,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 72,
"height": 75
"width": 80,
"height": 80
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -148,7 +151,7 @@
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7aXcN081JI2alKGYRKpfpV"
"fileId": "bauY7hXINFZrhPl6edHIl2"
},
{
"__type__": "cc.Sprite",
@@ -172,13 +175,149 @@
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@f37b3",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "462hZnCkNO97yqyBF8vbaN"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "fdCiFhP+xGc5Zyr+DMxELc",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "icon",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 11
}
],
"_prefab": {
"__id__": 13
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"_contentSize": {
"__type__": "cc.Size",
"width": 65,
"height": 65
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7aXcN081JI2alKGYRKpfpV"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "56fae78e-4db4-4ef1-be24-d030fc909ed1@b3f5a",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
@@ -220,14 +359,14 @@
"_active": true,
"_components": [
{
"__id__": 9
"__id__": 15
},
{
"__id__": 11
"__id__": 17
}
],
"_prefab": {
"__id__": 13
"__id__": 19
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -264,16 +403,16 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
"__id__": 14
},
"_enabled": true,
"__prefab": {
"__id__": 10
"__id__": 16
},
"_contentSize": {
"__type__": "cc.Size",
"width": 89,
"height": 90
"width": 80,
"height": 80
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -292,11 +431,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
"__id__": 14
},
"_enabled": true,
"__prefab": {
"__id__": 12
"__id__": 18
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -354,7 +493,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 15
"__id__": 21
},
"_contentSize": {
"__type__": "cc.Size",
@@ -382,7 +521,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 17
"__id__": 23
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -424,10 +563,10 @@
},
"_enabled": true,
"__prefab": {
"__id__": 19
"__id__": 25
},
"_barSprite": {
"__id__": 11
"__id__": 17
},
"_mode": 2,
"_totalLength": 1,
@@ -449,7 +588,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 21
"__id__": 27
},
"_id": ""
},

File diff suppressed because it is too large Load Diff

View File

@@ -66,7 +66,16 @@ export const SkillSet={
}
export const CSkills={
1001:{uuid: 1001,path: "1001",type: 1,tg:3,angle:true,level: 1,name: "火球术",sp_name:"fire",info:"释放一个火球术攻击敌人",
dis:1,count:1,in:0,run:0,ap:10,hp:0,shield:0,sd:10,cd:3,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
export const MSkills={
1001:{uuid:1001,path:"1001",type:1,tg:3,up_exp:10,name: "火球术",info:"释放一个火球术攻击敌人",
ap:10,ap_up:1,},
}
export const MSkillset={
confirm_exp:10,
}
export const MSlist={
1:[1001],
2:[1001],
3:[1001],
4:[1001],
}

View File

@@ -4,7 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
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 { MSkills, MSkillset, MSlist, SkillSet } from "../common/config/SkillSet";
import { HeroModelComp } from "../hero/HeroModelComp";
import { RewardSet } from "../common/config/RewardSet";
import { BoxSet, GameSet } from "../common/config/BoxSet";
@@ -25,6 +25,7 @@ import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/
import { HCard } from "./HCard";
import { HCardComp } from "./HCardComp";
import { MSkill } from "../skills/MSkill";
import { MSkillComp } from "../skills/MSkillComp";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@@ -57,7 +58,18 @@ export class MissionComp extends CCComp {
game_over:boolean = false;
start_ys:any[] = [0,70,-70];
mon_index:number = 0
msk:any={
on :false,
uuid:1001,
type:1,
lv: 1
}
mmsk:any={
on :false,
uuid:1001,
type:1,
lv: 1
}
onLoad(){
}
@@ -91,7 +103,8 @@ export class MissionComp extends CCComp {
}
this.count_hero_pos()
this.count_mon_pos()
this.check_exp()
this.check_m_exp()
// if (this.game_timer.update(dt)) {
// smc.vm_data.game.g_time += 1;
// }
@@ -113,35 +126,163 @@ export class MissionComp extends CCComp {
smc.vm_data.mission.a_exp=0 //近战经验石
smc.vm_data.mission.b_exp=0 //远程经验石
smc.vm_data.mission.c_exp=0 //辅助经验石
smc.vm_data.mission.d_exp=0 //特殊经验石
smc.vm_data.mission.ma_exp=0 //敌方近战经验石
smc.vm_data.mission.mb_exp=0 //敌方远程经验石
smc.vm_data.mission.mc_exp=0 //敌方辅助经验石
smc.vm_data.mission.md_exp=0 //敌方特殊经验石
this.call_mskill()
this.msk={ on :false, uuid:1001,type:1,lv: 1}
this.mmsk={ on :false, uuid:1001,type:1,lv: 1}
this.node.getChildByName("exp").getChildByName("a_exp").active = true
this.node.getChildByName("exp").getChildByName("b_exp").active = true
this.node.getChildByName("exp").getChildByName("c_exp").active = true
this.node.getChildByName("mexp").getChildByName("a_exp").active = true
this.node.getChildByName("mexp").getChildByName("b_exp").active = true
this.node.getChildByName("mexp").getChildByName("c_exp").active = true
}
call_mskill(){
let msk=ecs.getEntity<MSkill>(MSkill)
let praent = this.node.getChildByName("exp").getChildByName("a_exp").getChildByName("skill")
msk.load(1001,1,praent)
check_exp(){
if(!this.msk.on){
if(smc.vm_data.mission.a_exp >= MSkillset.confirm_exp){
this.msk.type = 1
this.msk.on = true
this.select_msk(1)
this.node.getChildByName("exp").getChildByName("b_exp").active = false
this.node.getChildByName("exp").getChildByName("c_exp").active = false
}
if(smc.vm_data.mission.b_exp >= MSkillset.confirm_exp){
this.msk.type = 2
this.msk.on = true
this.select_msk(2)
this.node.getChildByName("exp").getChildByName("a_exp").active = false
this.node.getChildByName("exp").getChildByName("c_exp").active = false
}
if(smc.vm_data.mission.c_exp >= MSkillset.confirm_exp){
this.msk.type = 3
this.msk.on = true
this.select_msk(3)
this.node.getChildByName("exp").getChildByName("a_exp").active = false
this.node.getChildByName("exp").getChildByName("b_exp").active = false
}
}else{
switch (this.msk.type){
case 1:
if(smc.vm_data.mission.a_exp >= MSkills[this.msk.uuid].up_exp){
this.msk.lv += 1
smc.vm_data.mission.a_exp = 0
}
break;
case 2:
if(smc.vm_data.mission.b_exp >= MSkills[this.msk.uuid].up_exp){
this.msk.lv += 1
smc.vm_data.mission.b_exp = 0
}
break;
case 3:
if(smc.vm_data.mission.c_exp >= MSkills[this.msk.uuid].up_exp){
this.msk.lv += 1
smc.vm_data.mission.c_exp = 0
}
break;
}
}
}
check_m_exp(){
if(!this.mmsk.on){
if(smc.vm_data.mission.ma_exp >= MSkillset.confirm_exp){
this.mmsk.type = 1
this.mmsk.on = true
this.select_mmsk(1)
this.node.getChildByName("mexp").getChildByName("b_exp").active = false
this.node.getChildByName("mexp").getChildByName("c_exp").active = false
}
if(smc.vm_data.mission.mb_exp >= MSkillset.confirm_exp){
this.mmsk.type = 2
this.mmsk.on = true
this.select_mmsk(2)
this.node.getChildByName("mexp").getChildByName("a_exp").active = false
this.node.getChildByName("mexp").getChildByName("c_exp").active = false
}
if(smc.vm_data.mission.mc_exp >= MSkillset.confirm_exp){
this.mmsk.type = 3
this.mmsk.on = true
this.select_mmsk(3)
this.node.getChildByName("mexp").getChildByName("a_exp").active = false
this.node.getChildByName("mexp").getChildByName("b_exp").active = false
}
}else{
switch (this.mmsk.type){
case 1:
if(smc.vm_data.mission.ma_exp >= MSkills[this.mmsk.uuid].up_exp){
this.mmsk.lv += 1
smc.vm_data.mission.ma_exp = 0
}
break;
case 2:
if(smc.vm_data.mission.mb_exp >= MSkills[this.mmsk.uuid].up_exp){
this.mmsk.lv += 1
smc.vm_data.mission.mb_exp = 0
}
break;
case 3:
if(smc.vm_data.mission.mc_exp >= MSkills[this.mmsk.uuid].up_exp){
this.mmsk.lv += 1
smc.vm_data.mission.mc_exp = 0
}
break;
}
}
}
select_msk(type:number){
smc.vm_data.mission.a_exp=0
smc.vm_data.mission.b_exp=0
smc.vm_data.mission.c_exp=0
let sk:any=RandomManager.instance.getRandomByObjectList(MSlist[type],1)
this.msk.uuid=sk[0]
let skill=ecs.getEntity<MSkill>(MSkill)
let praent = this.node.getChildByName("msk")
skill.load(this.msk.uuid,1,praent)
}
select_mmsk(type:number){
smc.vm_data.mission.ma_exp=0
smc.vm_data.mission.mb_exp=0
smc.vm_data.mission.mc_exp=0
let sk:any=RandomManager.instance.getRandomByObjectList(MSlist[type],1)
this.mmsk.uuid=sk[0]
let mskill=ecs.getEntity<MSkill>(MSkill)
let praent = this.node.getChildByName("mmsk")
mskill.load(this.msk.uuid,1,praent)
}
call_msk(){
}
mission_end(){
smc.vm_data.mission.play=false
let heros:any= ecs.query(ecs.allOf(HeroModelComp));
let monsters:any= ecs.query(ecs.allOf(MonModelComp));
let hcards:any= ecs.query(ecs.allOf(HCardComp));
let hcns=this.node.getChildByName("hcards")
for(let i=0;i<hcns.children.length;i++){
hcns.children[i].destroy()
let mska:any= ecs.query(ecs.allOf(MSkillComp));
for(let i=0;i<mska.length;i++){
mska[i].MSkillComp.reset()
mska[i].MSkillComp.ent.destroy()
}
// let hcns=this.node.getChildByName("hcards")
// for(let i=0;i<hcns.children.length;i++){
// hcns.children[i].destroy()
// }
for(let i=0;i<heros.length;i++){
heros[i].HeroView.reset()
heros[i].HeroView.ent.destroy()
}
for(let i=0;i<hcards.length;i++){
hcards[i].HCardComp.reset()
hcards[i].HCardComp.ent.destroy()
}
for(let i=0;i<monsters.length;i++){
monsters[i].HeroView.reset()
monsters[i].HeroView.ent.destroy()
}
}

View File

@@ -10,8 +10,7 @@ const { ccclass, property } = _decorator;
export class MSkillComp extends CCComp {
/** 视图层逻辑代码分离演示 */
start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
// this.on(ModuleEvent.Cmd, this.onHandler, this);
console.log("MSkillComp start");
}

View File

@@ -83,7 +83,7 @@ export class TooltipCom extends CCComp {
// this.alive_time = 2
tween(this.node).to(
this.alive_time,
{position:v3(this.node.position.x-20,this.node.position.y), },
{position:v3(this.node.position.x,this.node.position.y), },
{
onComplete:()=>{ this.ent.destroy()},
easing:"linear"