woso_javan 2 mesiacov pred
rodič
commit
02f935cc04

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 248 - 115
assets/module_storm_sunder/Prefabs/Map1.prefab


+ 2 - 2
assets/module_storm_sunder/Prefabs/Storm.prefab

@@ -49,7 +49,7 @@
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
-      "z": 9.747
+      "z": 0
     },
     "_lrot": {
       "__type__": "cc.Quat",
@@ -3213,7 +3213,7 @@
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
-      "z": -2.5939941394881316e-7
+      "z": -2.593994281596679e-7
     },
     "_lrot": {
       "__type__": "cc.Quat",

+ 8 - 0
assets/module_storm_sunder/Script/Component/PropComponent.ts

@@ -15,6 +15,13 @@ export class PropComponent extends Component {
 
     @property({ type: CCFloat })
     currentExp: number = 10;
+    get getExp() {
+        return this.currentExp;
+    }
+
+    set setExp(value: number) {
+        this.currentExp = value;
+    }
 
     @property({ type: CCBoolean, displayName: "是否可移动" })
     isMove: boolean = false;
@@ -28,6 +35,7 @@ export class PropComponent extends Component {
     start() {
         this.status = PropStatus.LIFE;
         this.currentHp = this.hp;
+        this.setExp = 500;
 
         this.tigger = this.node.getComponent(Collider)!;
         this.tigger.on('onTriggerEnter', this.onTriggerEnter, this);

+ 51 - 27
assets/module_storm_sunder/Script/Component/TornadoComponent.ts

@@ -1,4 +1,4 @@
-import { BoxCollider, Button, Collider, Component, ConeCollider, CylinderCollider, ITriggerEvent, Label, Node, NodeEventType, RigidBody, SphereCollider, Vec3, _decorator, find, game } from 'cc';
+import { BoxCollider, Button, Collider, Component, ConeCollider, CylinderCollider, ITriggerEvent, Label, Node, NodeEventType, RigidBody, SphereCollider, Vec3, _decorator, director, find, game } from 'cc';
 import { StormSunderAudioMgr } from '../Manager/StormSunderAudioMgr';
 import { EventDispatcher } from 'db://assets/core_tgx/easy_ui_framework/EventDispatcher';
 import { GameEvent } from '../Enum/GameEvent';
@@ -9,6 +9,7 @@ import { PlayerInfo } from './PlayerInfoComponent';
 import { Effect2DUIMgr } from '../Manager/Effect2DUIMgr';
 import { AttributeBonusMgr } from '../Manager/AttributeBonusMgr';
 import { TornadoAIComponent } from './TornadoAIComponent';
+import { EasyControllerEvent } from 'db://assets/core_tgx/easy_controller/EasyController';
 const { ccclass, property } = _decorator;
 
 const rotateSpeed = 500;
@@ -41,13 +42,10 @@ export class TornadoComponent extends Component {
     isColliding: boolean = false;
     //当前攻击的道具或玩家
     curHitObj: Node = null;
-
     _attackInterval: number = 0.5; // 攻击间隔
     _lastAttackTime: Map<string, number> = new Map(); // 记录上次攻击时间
-
     attributeBonusMgr: AttributeBonusMgr = null;
 
-
     protected start(): void {
         this.initPlayer();
         this.initilizeUI();
@@ -63,9 +61,6 @@ export class TornadoComponent extends Component {
         this.tigger = this.tornado.getComponent(Collider)!;
         this.radiusTigger = this.node.getChildByName('radiusTigger').getComponent(Collider)!;
 
-        const points = this.node.getChildByName('points')!;
-        this.points = points.children.map((child) => child);
-
         this.tigger.on('onTriggerEnter', this.onTriggerEnter, this);
         this.tigger.on('onTriggerStay', this.onTriggerStay, this);
         this.tigger.on('onTriggerExit', this.onTriggerExit, this);
@@ -90,6 +85,9 @@ export class TornadoComponent extends Component {
             nickName: this.nickName,
             level: this.currentLv,
         }
+
+        this.node.setScale(1, 1, 1);
+        this.updateCameraView();
     }
 
     protected registerEvent() {
@@ -178,27 +176,35 @@ export class TornadoComponent extends Component {
 
                 // 检查道具是否被摧毁
                 if (propComponent.currentHp <= 0) {
-                    // 随机选择一个吸收点
-                    const randomPoint = this.points[Math.floor(Math.random() * this.points.length)];
-                    if (randomPoint) {
-                        otherCollider.node.parent = randomPoint;
-                        otherCollider.node.setPosition(Vec3.ZERO);
-                        propComponent.swallow(this.node);
-                        this.addExpByKill();
-                    }
+                    // 在龙卷风附近随机位置创建吸收点
+                    const randomOffset = new Vec3(
+                        (Math.random() - 0.5) * 1, // -1 到 1 之间的随机值
+                        0,
+                        (Math.random() - 0.5) * 1
+                    );
+
+                    // 保存道具原始缩放
+                    const originalScale = otherCollider.node.scale.clone();
+
+                    // 将道具添加到龙卷风节点下
+                    otherCollider.node.parent = this.node;
+                    otherCollider.node.setPosition(randomOffset);
+
+                    // 计算抵消父节点scale的缩放值
+                    const parentScale = this.node.scale;
+                    const compensateScale = new Vec3(
+                        originalScale.x / parentScale.x,
+                        originalScale.y / parentScale.y,
+                        originalScale.z / parentScale.z
+                    );
+                    otherCollider.node.setScale(compensateScale);
+
+                    propComponent.swallow(this.node);
+                    this.addExpByKill();
                 }
             }
         }
-        // else if (otherCollider.getGroup() == 1 << 3) {
-        //     const targetTornado = otherCollider.node.parent.getComponent(TornadoComponent);
-        //     if (!targetTornado) return;
-
-        //     if (this.currentLv > targetTornado.currentLv) {
-        //         this.curHitObj = targetTornado.node;
-        //         this.addExpByKill();
-        //         this.killed(targetTornado.node);
-        //     }
-        // }
+
     }
 
     //被击杀
@@ -252,9 +258,8 @@ export class TornadoComponent extends Component {
         if (!this.curHitObj) return;
 
         const propComp = this.curHitObj.getComponent(PropComponent);
-
         let objExp = 0;
-        if (this.curHitObj.getComponent(PropComponent)) {
+        if (propComp) {
             objExp = propComp.currentExp;
         } else {
             const lv = this.curHitObj.getComponent(TornadoComponent).currentLv;
@@ -271,6 +276,7 @@ export class TornadoComponent extends Component {
             this.currentLv++;
             this.playerInfo.level = this.currentLv;
             this.stormLevelUp();
+            this.grow();
             Effect2DUIMgr.inst.updatePlayerInfo(this.node, this.playerInfo);
         }
 
@@ -290,6 +296,24 @@ export class TornadoComponent extends Component {
         this.currentExp = 0;
     }
 
+    //变大体积
+    private grow() {
+        //体积=基础体积×(1+等级×百分比)
+        const baseSize = 1;
+        const growMultiple = AttributeBonusMgr.inst.userModel.game_lv_modleVolume_up; //升级体积 百分比系数
+        const percentage = growMultiple / 100;
+        const growSize = baseSize + (1 + this.currentLv * percentage);
+        this.node.setScale(growSize, growSize, growSize);
+        // console.log('growSize:', growSize);
+        this.updateCameraView();
+    }
+
+    private updateCameraView() {
+        const sence = director.getScene();
+        const view = 50 + this.currentLv * 2;
+        sence.emit(EasyControllerEvent.CAMERA_ZOOM, view);
+    }
+
     private changeStatus(status: PlayerStatus) {
         this.playerStatus = status;
     }

+ 2 - 2
assets/module_storm_sunder/Script/Manager/TimerMgr.ts

@@ -19,7 +19,7 @@ export class TimerMgr {
         return this.Instance;
     }
 
-    public countDownTime: number = 10;
+    public countDownTime: number = 100;
     private timerId: number = 0;
     private propMgr: PropMgr;
 
@@ -71,6 +71,6 @@ export class TimerMgr {
         this.stopCountdown();
         Scheduler.enableForTarget(this);
 
-        this.countDownTime = 10;
+        this.countDownTime = 30;
     }
 }

+ 1 - 1
assets/module_storm_sunder/rooster_stormsunder.scene

@@ -279,7 +279,7 @@
     "zoomSensitivity": 1,
     "lenMin": 10,
     "lenMax": 500,
-    "len": 80,
+    "len": 50,
     "rotateVHSeparately": false,
     "tweenTime": 0.2,
     "_id": "8dJEbHLhFHmoEmMUYwfkm/"

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov