mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-26 18:26:23 +00:00
Merge branch 'master' of https://gitee.com/jisol/jisol-game
This commit is contained in:
@@ -30,10 +30,10 @@ import { Component } from "cc";
|
||||
|
||||
// let APIPath = `http://localhost:8080`
|
||||
// let WsPath = `ws://localhost:8080/websocket`
|
||||
// let APIPath = `http://192.168.1.23:8080`
|
||||
// let WsPath = `ws://192.168.1.23:8080/websocket`
|
||||
let APIPath = `http://192.168.0.122:8080`
|
||||
let WsPath = `ws://192.168.0.122:8080/websocket`
|
||||
let APIPath = `http://192.168.1.23:8080`
|
||||
let WsPath = `ws://192.168.1.23:8080/websocket`
|
||||
// let APIPath = `http://192.168.0.122:8080`
|
||||
// let WsPath = `ws://192.168.0.122:8080/websocket`
|
||||
// let APIPath = `https://api.pet.jisol.cn`
|
||||
// let WsPath = `wss://api.pet.jisol.cn/websocket`
|
||||
|
||||
|
@@ -5,6 +5,7 @@ import GButtleBase from "../bullet/GButtleBase";
|
||||
import GRoleDefault from "../role/GRoleDefault";
|
||||
import GNode from "../common/GNode";
|
||||
import { TB } from "../../../config/data/schema";
|
||||
import GAttackParabolicSingleRemote from "./GAttackParabolicSingleRemote";
|
||||
|
||||
//攻击子弹类
|
||||
export class GAttackBullet{
|
||||
@@ -29,5 +30,6 @@ export interface GAttackBase{
|
||||
export const GAttack:{[key:string]:(new () => GAttackBase)} = {
|
||||
["Normal"]:GAttackNormal,
|
||||
["ParabolicBangRemote"]:GAttackParabolicBangRemote,
|
||||
["ParabolicSingleRemote"]:GAttackParabolicSingleRemote,
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import { sp } from "cc";
|
||||
* 抛物线 爆炸普攻
|
||||
* 攻击子弹,爆炸特效,龙骨-初始位置,子弹大小,爆炸宽度,爆炸高度
|
||||
*/
|
||||
export default class GAttackParabolicRemote implements GAttackBase{
|
||||
export default class GAttackParabolicBangRemote implements GAttackBase{
|
||||
|
||||
attack(role: GRoleDefault, info: TB.TbGRoleAttack): void {
|
||||
|
||||
@@ -36,7 +36,7 @@ export default class GAttackParabolicRemote implements GAttackBase{
|
||||
let ah = parseFloat(info.attackArgs[5]);
|
||||
|
||||
if(!image || !bone || !scale || !bang|| !aw|| !ah) {
|
||||
console.warn("GAttackParabolicRemote ERROR",image,bone,scale,bang);
|
||||
console.warn("GAttackParabolicBangRemote ERROR",image,bone,scale,bang);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,82 @@
|
||||
import { SpriteFrame } from "cc";
|
||||
import { TD, app } from "../../../App";
|
||||
import GRoleBase from "../role/GRoleBase";
|
||||
import { GAttackBase, GAttackBullet } from "./GAttack";
|
||||
import GButtleDefault from "../bullet/GButtleDefault";
|
||||
import { v3 } from "cc";
|
||||
import { bezier } from "cc";
|
||||
import { v2 } from "cc";
|
||||
import { Vec2 } from "cc";
|
||||
import GEffectUtil from "../common/GEffectUtil";
|
||||
import GDetection from "../common/GDetection";
|
||||
import { rect } from "cc";
|
||||
import GRoleDefault from "../role/GRoleDefault";
|
||||
import { TB } from "../../../config/data/schema";
|
||||
import GRoleAttack from "../common/GRoleAttack";
|
||||
import { sp } from "cc";
|
||||
|
||||
/**
|
||||
* 抛物线 单体普攻
|
||||
* 攻击子弹,龙骨-初始位置,子弹大小
|
||||
*/
|
||||
export default class GAttackParabolicSingleRemote implements GAttackBase{
|
||||
|
||||
attack(role: GRoleDefault, info: TB.TbGRoleAttack): void {
|
||||
|
||||
let enemy = role.fsm.enemy;
|
||||
if(!enemy) return;
|
||||
|
||||
let image:SpriteFrame = app.battleRes.getData<SpriteFrame>(info.attackArgs[0]);
|
||||
let bone = role.spine.findBone(info.attackArgs[1]);
|
||||
let scale:number = parseFloat(info.attackArgs[2]);
|
||||
|
||||
if(!image || !bone || !scale) {
|
||||
console.warn("GAttackParabolicBangRemote ERROR",image,bone,scale);
|
||||
return;
|
||||
}
|
||||
|
||||
let bullet = GAttackBullet.create(GButtleDefault,{
|
||||
image:image,
|
||||
scale:scale,
|
||||
});
|
||||
role.mode.addGObject(bullet);
|
||||
let world2 = role.node.worldPosition.clone().add(v3(role.getMirrorValue(bone.worldX),bone.worldY,0))
|
||||
|
||||
//设置子弹位置
|
||||
bullet.node.setWorldPosition(v3(world2.x,world2.y,world2.z))
|
||||
|
||||
//子弹移动
|
||||
let start = bullet.v2World;
|
||||
let end = enemy.v2World;
|
||||
let center = v2(((start.x + end.x) / 2),((start.y + end.y) / 2) + (Math.abs((start.x - end.x)) / 2));
|
||||
|
||||
bullet.JTween({})
|
||||
.to({},Vec2.distance(start,end)*3)
|
||||
.onUpdate((data,elapsed) => {
|
||||
if(enemy.get()){
|
||||
end = enemy.v2World;
|
||||
center = v2(((start.x + end.x) / 2),((start.y + end.y) / 2) + (Math.abs((start.x - end.x)) / 2));
|
||||
}
|
||||
|
||||
bullet.node.setWorldPosition(v3(
|
||||
bezier(start.x,center.x,center.x,end.x,elapsed),
|
||||
bezier(start.y,center.y,center.y,end.y,elapsed),
|
||||
0
|
||||
))
|
||||
})
|
||||
.onComplete(() => {
|
||||
|
||||
//销毁
|
||||
bullet.node.destroy();
|
||||
//普攻
|
||||
GRoleAttack.onNormalAttack(role,enemy);
|
||||
|
||||
})
|
||||
.start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "579198ed-da4c-4524-a4ae-8ddad83f3680",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -7,7 +7,8 @@ export default class GRoleAttack{
|
||||
|
||||
//普通攻击
|
||||
static onNormalAttack(attack:GRoleBase<{}>,hit:GRoleBase<{}>){
|
||||
hit.onHit(GRoleAttackType.NormalAttack,attack.values.onAttack(GRoleAttackType.NormalAttack),attack);
|
||||
if(attack.get() && hit.get())
|
||||
hit.onHit(GRoleAttackType.NormalAttack,attack.values.onAttack(GRoleAttackType.NormalAttack),attack);
|
||||
}
|
||||
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
import { _decorator } from "cc";
|
||||
import { _decorator,Node } from "cc";
|
||||
import GRoleBase, { GRoleAnimEvent } from "./GRoleBase";
|
||||
import { ProgressBar } from "cc";
|
||||
import { JNFrameInfo } from "../../../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame";
|
||||
@@ -14,12 +14,16 @@ import { TB } from "../../../config/data/schema";
|
||||
import { TD } from "../../../App";
|
||||
import { GPetAminEnum } from "../anim/GPetAnim";
|
||||
import { UIOpacity } from "cc";
|
||||
import { v3 } from "cc";
|
||||
const { property,ccclass } = _decorator;
|
||||
|
||||
//默认角色类
|
||||
@ccclass('GRoleDefault')
|
||||
export default class GRoleDefault extends GRoleBase<{}>{
|
||||
|
||||
@property(Node)
|
||||
headInfo:Node;
|
||||
|
||||
@property(ProgressBar)
|
||||
bloodVolume:ProgressBar;
|
||||
|
||||
@@ -98,6 +102,13 @@ export default class GRoleDefault extends GRoleBase<{}>{
|
||||
let info = TD.TbGRoleSkill.get(skillId);
|
||||
return (new GSkill[info.skillController]()).bind(this,info);
|
||||
})
|
||||
|
||||
//设置血条位置
|
||||
if(this.spine){
|
||||
let runtimeData = this.spine.skeletonData.getRuntimeData();
|
||||
let headY = (runtimeData.height + runtimeData.y + 20) * this.spine.node.scale.x;
|
||||
this.headInfo.setPosition(v3(this.headInfo.position.x,headY,this.headInfo.position.z))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -93,9 +93,11 @@ export default class GCampGuardianMode extends GBaseMode<{},{}>{
|
||||
|
||||
switch(type){
|
||||
case GCampGuardianEnum.PLAYER:
|
||||
tactical.setOffset(this.playerPos);
|
||||
pos = tactical.getPosXYPosition(1,1,this.playerPos);
|
||||
break;
|
||||
case GCampGuardianEnum.ENEMY:
|
||||
tactical.setOffset(this.enemyPos);
|
||||
pos = tactical.getPosXYPosition(1,1,this.enemyPos);
|
||||
break;
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ import GSkillCrazySquirrel from "./RoleSkill/疯狂松鼠/GSkillCrazySquirrel";
|
||||
import GSkillBulbasaurDoubleHit from "./RoleSkill/妙蛙种子/GSkillBulbasaurDoubleHit";
|
||||
import GRoleDefault from "../base/role/GRoleDefault";
|
||||
import { TB } from "../../config/data/schema";
|
||||
import GSkillCDNormal from "./RoleSkill/通用技能/GSkillCDNormal";
|
||||
|
||||
//技能状态
|
||||
export enum GSkillState{
|
||||
@@ -38,5 +39,6 @@ export interface GSkillBase {
|
||||
export const GSkill:{[key:string]:(new () => GSkillBase)} = {
|
||||
["GSkillCrazySquirrel"]:GSkillCrazySquirrel,
|
||||
["GSkillBulbasaurDoubleHit"]:GSkillBulbasaurDoubleHit,
|
||||
["GSkillCDNormal"]:GSkillCDNormal,
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "351d1081-04e5-4f12-9ce8-60416096a377",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
import { TB } from "../../../../config/data/schema";
|
||||
import GRoleAttack from "../../../base/common/GRoleAttack";
|
||||
import GRoleBase from "../../../base/role/GRoleBase";
|
||||
import GRoleDefault from "../../../base/role/GRoleDefault";
|
||||
import GSkillAngerBase from "../../GSkillAngerBase";
|
||||
import GSkillCDBase from "../../GSkillCDBase";
|
||||
|
||||
export default class GSkillCDNormal extends GSkillCDBase{
|
||||
|
||||
role:GRoleDefault;
|
||||
info: TB.TbGRoleSkill;
|
||||
|
||||
bind(role:GRoleDefault,info: TB.TbGRoleSkill):GSkillCDNormal {
|
||||
//技能冷却
|
||||
this.cdTatal = parseInt(info.skillArgs[0]);
|
||||
this.role = role;
|
||||
this.info = info;
|
||||
return this;
|
||||
|
||||
}
|
||||
|
||||
onRelease(): boolean {
|
||||
|
||||
let enemy = this.role.fsm.enemy;
|
||||
//关闭动画管理器
|
||||
this.role.fsmAnim.close();
|
||||
|
||||
let attack = () => {
|
||||
if(!enemy.isDie){
|
||||
GRoleAttack.onNormalAttack(this.role,enemy);
|
||||
}
|
||||
};
|
||||
let end = () => {
|
||||
this.role.fsmAnim.open();
|
||||
this.role.fsmAnim.delEventListener("skillAttack",attack)
|
||||
this.role.fsmAnim.delEndListener("skillAttack",end)
|
||||
}
|
||||
//监听伤害
|
||||
this.role.fsmAnim.addEventListener("skillAttack",attack)
|
||||
//播放妙蛙种子技能
|
||||
this.role.spine.setAnimation(0,"skill",false);
|
||||
this.role.fsmAnim.addEndListener("skillAttack",end)
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "48700cdf-9095-426b-b9a1-894f14e47fb4",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user