Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
HoangTran0410 committed May 22, 2024
1 parent 435372b commit d7b7c5f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/game/gameObject/spells/Ahri_W.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ export default class Ahri_W extends Spell {
coolDown = 5000;

onSpellCast() {
for (let i = 0; i < 3; i++) {
let count = 3;
for (let i = 0; i < count; i++) {
let obj = new Ahri_W_Object(this.owner);
obj.angle = (i * 2 * PI) / 3;
obj.angle = (i * 2 * PI) / count;
this.game.objectManager.addObject(obj);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/game/gameObject/spells/Ashe_W.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ export default class Ashe_W extends Spell {
name = 'Tán Xạ Tiễn (Ashe_W)';
description =
'Bắn ra <span>10 mũi tên</span> theo hình nón. Mỗi mũi tên gây <span class="damage">5 sát thương</span> và <span class="buff">Làm Chậm 75%</span> kẻ địch trúng chiêu trong <span class="time">1.5 giây</span>';
coolDown = 5000;
coolDown = 1000;

onSpellCast() {
let mouse = this.game.worldMouse.copy();
let direction = mouse.sub(this.owner.position).normalize();

let arrowCount = 10;
let arrowCount = 15;
let arrowLength = 500;
let angle = direction.heading();
let angleStep = Math.PI / 20;
let angleStep = Math.PI / (arrowCount * 2);

for (let i = 0; i < arrowCount; i++) {
let _angle = angle - (angleStep * arrowCount) / 2 + angleStep * i;
Expand Down
7 changes: 4 additions & 3 deletions src/game/gameObject/spells/Shaco_R.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,14 @@ class Shaco_R_Clone extends Champion {
});

// create 3 shaco W objects, place around dead clone
for (let i = 0; i < 3; i++) {
let count = 3;
for (let i = 0; i < count; i++) {
let obj = new Shaco_W_Object(this.shacoR_championOwner);
obj.lifeTime = 3000;
obj.position = clonePos.copy();
obj.destination = clonePos.copy().add(
Math.cos((i * 2 * Math.PI) / 3) * 100, // 100 is the radius
Math.sin((i * 2 * Math.PI) / 3) * 100
Math.cos((i * 2 * Math.PI) / count) * 100, // 100 is the radius
Math.sin((i * 2 * Math.PI) / count) * 100
);
this.game.objectManager.addObject(obj);
}
Expand Down

0 comments on commit d7b7c5f

Please sign in to comment.