This commit is contained in:
DESKTOP-5RP3AKU\Jisol 2023-12-25 02:06:56 +08:00
parent 516d520c5e
commit 5366e3413c
18 changed files with 1054 additions and 441 deletions

View File

@ -28,10 +28,13 @@
}, },
{ {
"__id__": 6 "__id__": 6
},
{
"__id__": 8
} }
], ],
"_prefab": { "_prefab": {
"__id__": 8 "__id__": 10
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@ -157,6 +160,24 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "a1GrhIZWJFDo/VFCx6xwRM" "fileId": "a1GrhIZWJFDo/VFCx6xwRM"
}, },
{
"__type__": "c18bb2MbONOoYTjK7e9No0x",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 9
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6d5RTIbZNEtbgp8BZSZY+A"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
@ -166,7 +187,6 @@
"__id__": 0 "__id__": 0
}, },
"fileId": "64PJYFWgBDZrEsaiYwZxmh", "fileId": "64PJYFWgBDZrEsaiYwZxmh",
"instance": null,
"targetOverrides": null "targetOverrides": null
} }
] ]

View File

@ -0,0 +1,379 @@
[
{
"__type__": "cc.Prefab",
"_name": "难度",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "难度",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 12
},
{
"__id__": 14
},
{
"__id__": 16
}
],
"_prefab": {
"__id__": 18
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 14.153,
"y": 479.694,
"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": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
}
],
"_prefab": {
"__id__": 9
},
"_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": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 17.34765625,
"height": 54.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ffX2k0j6JECpkMJpRh7fxb"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "0",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 24,
"_fontSize": 24,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": true,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2ew9hCIIJGX4QZjD8myKye"
},
{
"__type__": "cc.LabelOutline",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_width": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2fpLPtd21E3IK9D8TQ6ax+"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "774a7Ku/VNEKD20hCqNpA/",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 11
},
"_contentSize": {
"__type__": "cc.Size",
"width": 200,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5b1ztjg0FI7YvHJaHCU2ms"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 13
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 235,
"g": 235,
"b": 235,
"a": 255
},
"_spriteFrame": {
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_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": "85sGtNcRFEZ6uas0veM0GO"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 15
},
"_alignFlags": 1,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 130.30599999999998,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "58+NYe5CFKzLz2VGok5XlR"
},
{
"__type__": "b2374yvVElBk4il/xfjEdKc",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 17
},
"title": {
"__id__": 5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e7476w/jVEHoS8lf8uIyvT"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "9eultbNU5HCLypkPXqoRGA",
"instance": null,
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "c9df301b-3532-4bbd-8d7e-d0620db322a0",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "难度"
}
}

View File

@ -32,10 +32,10 @@ import { Component } from "cc";
// let WsPath = `ws://localhost:8080/websocket` // let WsPath = `ws://localhost:8080/websocket`
// let APIPath = `http://192.168.1.23:8080` // let APIPath = `http://192.168.1.23:8080`
// let WsPath = `ws://192.168.1.23:8080/websocket` // let WsPath = `ws://192.168.1.23:8080/websocket`
let APIPath = `http://192.168.0.116:8080` // let APIPath = `http://192.168.0.116:8080`
let WsPath = `ws://192.168.0.116:8080/websocket` // let WsPath = `ws://192.168.0.116:8080/websocket`
// let APIPath = `https://api.pet.jisol.cn` let APIPath = `https://api.pet.jisol.cn`
// let WsPath = `wss://api.pet.jisol.cn/websocket` let WsPath = `wss://api.pet.jisol.cn/websocket`
//重写UI //重写UI
class JNGLayer extends JNLayer{ class JNGLayer extends JNLayer{

View File

@ -10,6 +10,8 @@ import { CCObject } from "cc";
import { Env, EnvCurrent } from "../Env"; import { Env, EnvCurrent } from "../Env";
import { TB } from "../config/data/schema"; import { TB } from "../config/data/schema";
import BattleResource from "../tools/BattleResource"; import BattleResource from "../tools/BattleResource";
import { director } from "cc";
import { game } from "cc";
export enum BattleMode{ export enum BattleMode{
//无尽模式 //无尽模式
@ -127,6 +129,7 @@ export default class GBattleModeManager extends Singleton {
//资源加载完成则显示世界 //资源加载完成则显示世界
app.sync.onReset(); app.sync.onReset();
game.step();
app.sync.onStart(); app.sync.onStart();
} }

View File

@ -67,14 +67,15 @@ export default class GAttackParabolicBangRemote implements GAttackBase{
)) ))
}) })
.onComplete(() => { .onComplete(() => {
//销毁
bullet.node.destroy();
if(!role.get()) return;
//生成爆炸特效 //生成爆炸特效
let effect = GEffectUtil.createOne(bang.ske); let effect = GEffectUtil.createOne(bang.ske);
role.mode.addGNode(effect.node,bullet.node.worldPosition); role.mode.addGNode(effect.node,bullet.node.worldPosition);
//获取默认动画 //获取默认动画
effect.setAnimation(0,"animation",false); effect.setAnimation(0,"animation",false);
//销毁
bullet.node.destroy();
GDetection.testAABBCenterRole(rect(effect.node.worldPosition.x,effect.node.worldPosition.y,aw,ah)).forEach(enemy =>{ GDetection.testAABBCenterRole(rect(effect.node.worldPosition.x,effect.node.worldPosition.y,aw,ah)).forEach(enemy =>{
GRoleAttack.onNormalAttack(role,enemy); //普通攻击 GRoleAttack.onNormalAttack(role,enemy); //普通攻击

View File

@ -117,7 +117,7 @@ export default class GOnHookMode extends GDefaultMode<{},{}>{
//调整相机 //调整相机
this.camera.enabled = true; this.camera.enabled = true;
let camreaPos = this.camera.node.worldPosition; let camreaPos = this.camera.node.worldPosition;
this.camera.node.worldPosition = v3(0,800,camreaPos.z) this.camera.node.worldPosition = v3(0,750,camreaPos.z)
//初始化状态机 //初始化状态机
this.fsm = new GFSMOnHookMode(this); this.fsm = new GFSMOnHookMode(this);
@ -354,14 +354,13 @@ export default class GOnHookMode extends GDefaultMode<{},{}>{
//生成敌人 //生成敌人
onResetGenerateEnemy(){ onResetGenerateEnemy(){
this.enemyRoles = []; this.enemyRoles = [];
//获取敌人
let creeps = GOnHookManager.getIns().getNextCreeps();
if(!creeps) return; //没有获取到野怪则返回
let sign = TD.TbGOnHookMaps.get(GOnHookData.getIns().info.onHookMap).sign; let sign = TD.TbGOnHookMaps.get(GOnHookData.getIns().info.onHookMap).sign;
let table:{data:TbGEntity.TOnHookLevel} = TD[sign].get(GOnHookData.getIns().info.levelId); let table:{data:TbGEntity.TOnHookLevel} = TD[sign].get(GOnHookData.getIns().info.levelId);
for (let index = 0; index < table.data.petSize; index++) { for (let index = 0; index < table.data.petSize; index++) {
//获取敌人
let creeps = GOnHookManager.getIns().getNextCreeps();
if(!creeps) return; //没有获取到野怪则返回
this.onGenCreeps(index + 1,creeps); this.onGenCreeps(index + 1,creeps);
} }
// this.enemyInfo.roles.forEach((info,index) => this.onGenRole(GOnHookModePlayerEnum.ENEMY,index + 1,info)); // this.enemyInfo.roles.forEach((info,index) => this.onGenRole(GOnHookModePlayerEnum.ENEMY,index + 1,info));

View File

@ -10,10 +10,15 @@ export default class GOnHookData extends BaseData{
info:ModeOnHookOV; info:ModeOnHookOV;
async onInit() { async onInit() {
this.info = await GAPI.GOnHookInfo(); await this.onUpdateInfo();
console.log("GOnHookData Info",this.info); console.log("GOnHookData Info",this.info);
} }
//刷新数据
async onUpdateInfo(){
this.info = await GAPI.GOnHookInfo();
}
//切换地图 //切换地图
async setMap(mapId:number){ async setMap(mapId:number){
@ -22,5 +27,11 @@ export default class GOnHookData extends BaseData{
} }
//下一关
async onNextLevel(){
await GAPI.GOnHookNextLevel();
await this.onUpdateInfo();
}
} }

View File

@ -53,7 +53,8 @@ export default class GOnHookManager extends Singleton{
//获取下一只野怪 //获取下一只野怪
getNextCreeps(){ getNextCreeps(){
if(!this.sreeps) return; if(!this.sreeps) return;
let creeps = this.sreeps.get(this.sreeps.keys().next()?.value) let creeps = this.sreeps.get(this.sreeps.keys().next()?.value);
this.sreeps.delete(creeps.key);
return creeps; return creeps;
} }
@ -129,18 +130,29 @@ export default class GOnHookManager extends Singleton{
app.event.emit(GOnHookManagerEvent.RESET_DATA); app.event.emit(GOnHookManagerEvent.RESET_DATA);
} }
//下一关
async onNextLevel(){
GOnHookData.getIns().onNextLevel();
app.layer.Open(GUI.Tips,{text:"下一关"});
this.onResetMap();
}
//切换场景 //切换场景
async setMap(mapId:number){ async setMap(mapId:number){
await GOnHookData.getIns().setMap(mapId); await GOnHookData.getIns().setMap(mapId);
this.onResetMap();
}
//重置场景
onResetMap(){
//通知地图已切换 //通知地图已切换
app.event.emit(GOnHookManagerEvent.UPDATE_MAP); app.event.emit(GOnHookManagerEvent.UPDATE_MAP);
//重置数据 //重置数据
this.onResetData(); this.onResetData();
//重置场景 //重置场景
GBattleModeManager.getIns().Open(BattleMode.OnHook,true); GBattleModeManager.getIns().Open(BattleMode.OnHook,true);
} }

View File

@ -0,0 +1,33 @@
import { _decorator, Component, Node } from 'cc';
import GOnHookData from '../../../data/GOnHookData';
import { TD } from '../../../App';
import { Label } from 'cc';
import { TbGEntity } from '../../../config/data/schema';
const { ccclass, property } = _decorator;
@ccclass('GameDifficultyTitle')
export class GameDifficultyTitle extends Component {
@property(Label)
title:Label;
protected update(dt: number): void {
let info = GOnHookData.getIns().info;
let sign = null;
let levelId = info.levelId;
if(info && levelId){
sign = TD.TbGOnHookMaps.get(info.onHookMap)?.sign;
if(!sign) return;
}else return;
let table:{data:TbGEntity.TOnHookLevel} = TD[sign].get(GOnHookData.getIns().info.levelId);
//显示难度
this.title.string = `难度 : ${table.data.level}-${table.data.childLevel}`;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "b2374caf-5449-4193-88a5-ff17e311d29c",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,43 @@
import { _decorator, Component, Node } from 'cc';
import { app } from '../../../App';
import { GModeEvent } from '../../../battle/modes/GMode';
import { tween } from 'cc';
import { Vec3 } from 'cc';
import RandomUtil from '../../../../../extensions/ngame/assets/ngame/util/RandomUtil';
import { v3 } from 'cc';
const { ccclass, property } = _decorator;
//游戏震屏
@ccclass('ModeShakeScreen')
export class ModeShakeScreen extends Component {
local:Vec3;
onLoad(){
this.local = this.node.position.clone();
app.event.on(GModeEvent.HIT,this.onShakeScreen,this);
}
protected onDestroy(): void {
app.event.off(GModeEvent.HIT,this.onShakeScreen,this);
}
onShakeScreen(){
tween(this.node).
to(0.1, { position: this.local.clone().add(v3(RandomUtil.RandomInt(-5, 5), RandomUtil.RandomInt(-5, 0), 0)) })
.call(() => {
tween(this.node).to(0.1 / 2, { position: this.local.clone() }).start();
})
.start();
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "c18bbd8c-6ce3-4ea1-84e3-2bb7bd368d31",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -7,6 +7,7 @@ import { JNGLayerBase } from '../../components/JNComponent';
import { app } from '../../App'; import { app } from '../../App';
import { GAction } from '../../consts/GAction'; import { GAction } from '../../consts/GAction';
import { GAPI } from '../../consts/GAPI'; import { GAPI } from '../../consts/GAPI';
import GOnHookManager from '../../manager/battle/mode/GOnHookManager';
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@ccclass('MainView') @ccclass('MainView')
@ -63,8 +64,7 @@ export class MainView extends JNGLayerBase {
//点击下一关 //点击下一关
async onClickNextLevel(){ async onClickNextLevel(){
await GAPI.GOnHookNextLevel(); GOnHookManager.getIns().onNextLevel();
app.layer.Open(GUI.Tips,{text:"下一关"});
} }
} }

@ -1 +1 @@
Subproject commit 01f3e1248ac4e0d1469e087ab84d8b04315273ff Subproject commit 34f12bac5650f7782074cd6b369f77fa3e814641

View File

@ -108,6 +108,8 @@ public class GOnHookController {
//保存地图 //保存地图
modeOnHookService.saveOrUpdate(data); modeOnHookService.saveOrUpdate(data);
//下一关 清理历史野怪
CREEPS.put(player.getPlayerId(),new HashMap<>());
return NewsContext.onSuccess("下一关"); return NewsContext.onSuccess("下一关");
} }

View File

@ -4,7 +4,8 @@ spring:
datasource: datasource:
username: pet_jisol_cn username: pet_jisol_cn
password: sThsBwjfDcaw2wJR password: sThsBwjfDcaw2wJR
url: jdbc:mysql://kyu.jisol.cn:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 # url: jdbc:mysql://kyu.jisol.cn:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
jackson: jackson:
serialization: serialization: