Skip to content

Commit

Permalink
feat: add Disruptive Blow
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaffomdz committed Aug 6, 2024
1 parent aee9679 commit 2c31409
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion scene/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
"fp-future": "^1.0.1",
"typescript": "^5.3.2"
}
}
}
5 changes: 3 additions & 2 deletions scene/src/controllers/main-hud/inventory.controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import ProfessionsPage from '../../ui/inventory/professionsPage'
import SkillsPage from '../../ui/inventory/skillsPage'
import { type Sprite } from '../../utils/ui-utils'
import { LEVEL_TYPES } from '../../player/LevelManager'
import { ThiefMainSkill } from '../../player/skills/classes-main-skill'
// import { ThiefMainSkill } from '../../player/skills/classes-main-skill'
import { CharacterClasses } from '../../ui/creation-player/creationPlayerData'
import {
companionPageSprite,
Expand All @@ -37,6 +37,7 @@ import {
type CompanionType
} from '../../ui/inventory/companionsData'
import { type ProfessionType } from '../../ui/inventory/professionsData'
import { GeneralDisruptiveBlow } from '../../player/skills/definitions'
// import { WearablesConfig } from '../../player/wearables-config'
// import {type GetPlayerDataRes, getPlayer } from '@dcl/sdk/src/players'

Expand Down Expand Up @@ -377,7 +378,7 @@ export class InventoryController {
console.log('Equiped skill')
Player.getInstance().setSkill(
this.getLowerSkillIndex(),
new ThiefMainSkill()
new GeneralDisruptiveBlow()
)
} else {
console.error('You should choise a skill to equip')
Expand Down
6 changes: 3 additions & 3 deletions scene/src/effects/allEffects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const applyFullRedSkillEffectToLocation = (
rotation: Quaternion.create(0, 0, 0, 1),
scale: Vector3.create(1, 1, 1)
})
GltfContainer.create(area, { src: 'assets/models/Skill_FX/test.glb' })
GltfContainer.create(area, { src: 'assets/models/Skill_FX/redCircle.glb' })
Animator.createOrReplace(area, {
states: [
{
Expand All @@ -88,13 +88,13 @@ export const applyFullRedSkillEffectToLocation = (
loop: true
},
{
clip: 'action',
clip: 'heal',
playing: false,
loop: true
}
]
})
Animator.playSingleAnimation(area, 'action')
Animator.playSingleAnimation(area, 'heal')
AudioSource.playSound(area, 'assets/sounds/attack.mp3')
utils.timers.setTimeout(() => {
entityController.removeEntity(area)
Expand Down
15 changes: 10 additions & 5 deletions scene/src/player/skills/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { engine, Transform } from '@dcl/sdk/ecs'
import { Color4 } from '@dcl/sdk/math'
import { Color4, Vector3 } from '@dcl/sdk/math'
import { SkillController } from '.'
import {
applyAttackedEnemyEffectToLocation,
applyDefSkillEffectToLocation,
applyFullRedSkillEffectToLocation,
applyFullWhiteSkillEffectToLocation,
applyGeneralSkillEffectToLocation,
applyHealToLocation,
Expand All @@ -19,6 +20,8 @@ import { CharacterClasses } from '../../ui/creation-player/creationPlayerData'
import { setTimeout } from '../../utils/lib'
import { Player } from '../player'

export let activeSkillsCount = 0

export class BerserkerBloodDance extends SkillController {
constructor() {
super(SKILL_DATA.BERSERKER_BLOOD_DANCE)
Expand Down Expand Up @@ -1221,20 +1224,22 @@ export class GeneralDisruptiveBlow extends SkillController {
}

async effect(): Promise<void> {
console.log('skill running')
// TODO:
// const isWearableFound = checkWearableInUserData(
// //HATCHETS
// "0xa5d8a8c3454aa003ad72c3f814e52ad6bea69e57:0"
// )
const player = Player.getInstance()
// activeSkillsCount++
// console.log("activeSkillsCount ", activeSkillsCount)
activeSkillsCount++
console.log('activeSkillsCount ', activeSkillsCount)
// const damageOverTime = 60 // Adjust bleeding damage per tick as needed
// const tickInterval = 2000 // Adjust interval between ticks as needed
const ATTACK_BUFF = 50
player.updateAtkBuff(ATTACK_BUFF)
// TODO:
// applyRedSwirlToLocation(Transform.get(engine.CameraEntity).position)
const playerPos =
Transform.getOrNull(engine.PlayerEntity)?.position ?? Vector3.Zero()
applyFullRedSkillEffectToLocation(playerPos, 8000)
setTimeout(() => {
// activeSkillsCount--
// console.log("activeSkillsCount ", activeSkillsCount)
Expand Down

0 comments on commit 2c31409

Please sign in to comment.