mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 03:14:47 +00:00
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { SpriteFrame } from "cc";
|
|
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
|
|
import { app } from "../../../App";
|
|
import GRoleBase from "../role/GRoleBase";
|
|
import { GAttackBase, GAttackBullet } from "./GAttack";
|
|
import GButtleDefault from "../bullet/GButtleDefault";
|
|
import { size } from "cc";
|
|
import { Size } from "cc";
|
|
import { Vec2 } from "cc";
|
|
import { v2 } from "cc";
|
|
import { v3 } from "cc";
|
|
/**
|
|
* 抛物线普攻
|
|
*/
|
|
export default class GAttackParabolicRemote implements GAttackBase{
|
|
|
|
attack(role: GRoleBase<{}>, info: TableGRoleAttack): void {
|
|
//[子弹图片]
|
|
let image:SpriteFrame = app.role.bullets[info.attackArgs[0]];
|
|
let scale:number = info.attackArgs[1] as unknown as number;
|
|
let bone = role.spine.findBone("timo5 007");
|
|
console.log(role.spine,bone);
|
|
let bullet = GAttackBullet.create(GButtleDefault,{
|
|
image:image,
|
|
scale:scale,
|
|
});
|
|
role.mode.addGObject(bullet);
|
|
let world2 = role.node.worldPosition.clone().add(v3(bone.worldX,bone.worldY,0))
|
|
bullet.node.setWorldPosition(v3(world2.x,world2.y,world2.z))
|
|
}
|
|
|
|
}
|
|
|
|
|