Skip to content

Commit

Permalink
Merge pull request #201 from UQcsse3200/Team-1--Mobs-Enhancement
Browse files Browse the repository at this point in the history
Team 1 Mobs Enhancement 2nd merge to Main
  • Loading branch information
MiniSoda17 authored Oct 1, 2023
2 parents 1a37f77 + 2ee41d3 commit d1cbb5a
Show file tree
Hide file tree
Showing 81 changed files with 9,616 additions and 459 deletions.
768 changes: 768 additions & 0 deletions hs_err_pid14780.log

Large diffs are not rendered by default.

786 changes: 786 additions & 0 deletions hs_err_pid19432.log

Large diffs are not rendered by default.

929 changes: 929 additions & 0 deletions hs_err_pid22188.log

Large diffs are not rendered by default.

765 changes: 765 additions & 0 deletions hs_err_pid22716.log

Large diffs are not rendered by default.

860 changes: 860 additions & 0 deletions hs_err_pid26164.log

Large diffs are not rendered by default.

840 changes: 840 additions & 0 deletions hs_err_pid28328.log

Large diffs are not rendered by default.

808 changes: 808 additions & 0 deletions hs_err_pid29160.log

Large diffs are not rendered by default.

756 changes: 756 additions & 0 deletions source/core/assets/images/mobboss/iceBaby.atlas

Large diffs are not rendered by default.

Binary file added source/core/assets/images/mobboss/iceBaby.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/core/assets/sounds/mobBoss/demonAttack.wav
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/demonCleave.mp3
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/demonDeath.mp3
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/demonHeal.mp3
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/demonJump.mp3
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/demonLand.mp3
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/demonSpawn.wav
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/iceBabyAOE.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/patrickCast.mp3
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/patrickHit.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/slimeJump.mp3
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/slimePop.mp3
Binary file not shown.
Binary file added source/core/assets/sounds/mobBoss/slimeySplat.mp3
Binary file not shown.
Binary file added source/core/assets/sounds/mobs/boneBreak.mp3
Binary file not shown.
Binary file added source/core/assets/sounds/mobs/fireWormRoar.mp3
Binary file not shown.
Binary file added source/core/assets/sounds/mobs/fireWormRoar.wav
Binary file not shown.
Binary file not shown.
Binary file added source/core/assets/sounds/mobs/wizardSpell.mp3
Binary file not shown.
260 changes: 196 additions & 64 deletions source/core/src/main/com/csse3200/game/areas/ForestGameArea.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import com.csse3200.game.entities.configs.ProjectileConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Currency;
import java.util.Random;

/**
* Component used to store information related to combat such as health, attack, etc. Any entities
Expand Down Expand Up @@ -39,7 +39,7 @@ public class CombatStatsComponent extends Component {
private ArrayList<Currency> drops;
private ArrayList<Melee> closeRangeAbilities;
private ArrayList<ProjectileConfig> longRangeAbilities; //TODO change String to Projectiles
private Random rand = new Random();
private SecureRandom rand = new SecureRandom();

public CombatStatsComponent(int health, int baseAttack) {
setHealth(health);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private void onCollisionEnd(Fixture me, Fixture other) {
// * RIGHT NOW TARGET IS NPC, SUBJECT TO CHANGE
// Speed is a bit faster than normal but can change.
Entity newProjectile = ProjectileFactory.createFireworks(PhysicsLayer.NPC,
new Vector2(100, (float) (projectile.getPosition().y + (newDirection - (TOTAL_RANGE/2)))), new Vector2(3f, 3f));
new Vector2(100, (float) (projectile.getPosition().y + (newDirection - (double) (TOTAL_RANGE/2)))), new Vector2(3f, 3f));

newProjectile.setPosition(newXPosition, (float) projectile.getPosition().y);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
package com.csse3200.game.components.bosses;

import com.badlogic.gdx.audio.Sound;
import com.csse3200.game.components.Component;
import com.csse3200.game.rendering.AnimationRenderComponent;
import com.csse3200.game.services.ServiceLocator;

public class DemonAnimationController extends Component {
AnimationRenderComponent animator;
// private static final String DEMON_JUMP = "sounds/mobBoss/demonBreath.mp3";
Sound demonBreath = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/demonBreath.mp3", Sound.class);
Sound demonSpawn = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/demonSpawn.wav", Sound.class);
Sound demonAttack = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/demonAttack.wav", Sound.class);
Sound demonBreathIn = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/demonBreathIn.mp3", Sound.class);
Sound demonLand = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/demonLand.mp3", Sound.class);
Sound demonRoar = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/demonJump.mp3", Sound.class);
Sound demonHeal = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/demonHeal.mp3", Sound.class);
Sound demonCleave = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/demonCleave.mp3", Sound.class);
Sound demonDeath = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/demonDeath.mp3", Sound.class);
Sound slimeySplat = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/slimeySplat.mp3", Sound.class);
Sound slimeJump = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/slimeJump.mp3", Sound.class);
Sound slimePop = ServiceLocator.getResourceService().getAsset(
"sounds/mobBoss/slimePop.mp3", Sound.class);

/**
* Creation call for a DemonAnimationController, fetches the animationRenderComponent that this controller will
Expand All @@ -14,31 +41,119 @@ public class DemonAnimationController extends Component {
public void create() {
super.create();
animator = entity.getComponent(AnimationRenderComponent.class);
registerAnimationListener("demon_walk");
registerAnimationListener("demon_cleave");
registerAnimationListener("demon_take_hit");
registerAnimationListener("demon_idle");
registerAnimationListener("demon_death");
registerAnimationListener("demon_cast_spell");
registerAnimationListener("demon_fire_breath");
registerAnimationListener("demon_smash");
registerAnimationListener("demon_take_hit");
registerAnimationListener("idle");
registerAnimationListener("move");
registerAnimationListener("projectile_explosion");
registerAnimationListener("projectile_idle");
registerAnimationListener("take_hit");
registerAnimationListener("transform");
registerAnimationListener("transform_reverse");
entity.getEvents().addListener("demon_walk", this::demonWalk);
entity.getEvents().addListener("demon_cleave", this::demonCleave);
entity.getEvents().addListener("demon_idle", this::demonIdle);
entity.getEvents().addListener("demon_death", this::demonDeath);
entity.getEvents().addListener("demon_cast_spell", this::demonCastSpell);
entity.getEvents().addListener("demon_fire_breath", this::demonFireBreath);
entity.getEvents().addListener("demon_smash", this::demonSmash);
entity.getEvents().addListener("demon_take_hit", this::demonTakeHit);
entity.getEvents().addListener("idle", this::idle);
entity.getEvents().addListener("move", this::move);
entity.getEvents().addListener("projectile_explosion", this::projectileExplosion);
entity.getEvents().addListener("projectile_idle", this::projectileIdle);
entity.getEvents().addListener("take_hit", this::takeHit);
entity.getEvents().addListener("transform", this::transform);
entity.getEvents().addListener("demon_spawn_sound", this::demonSpawnSound);
entity.getEvents().addListener("demon_attack_sound", this::demonAttackSound);
entity.getEvents().addListener("demon_breath_in_sound", this::demonBreathInSound);
entity.getEvents().addListener("demon_landing_sound", this::demonLandSound);
entity.getEvents().addListener("demon_roar_sound", this::demonRoarSound);
entity.getEvents().addListener("demon_heal_sound", this::demonHealSound);
entity.getEvents().addListener("demon_cleave_sound", this::demonCleaveSound);
entity.getEvents().addListener("demon_death_sound", this::demonDeathSound);
entity.getEvents().addListener("slimey_splat_sound", this::slimeySplatSound);
entity.getEvents().addListener("slime_jump_sound", this::slimeJumpSound);
entity.getEvents().addListener("slime_pop_sound", this::slimePopSound);
}

private void registerAnimationListener(String animationName) {
if (animationName.equals("transform_reverse")) {
entity.getEvents().addListener(animationName, () ->
animator.startAnimation("transform"));
} else {
entity.getEvents().addListener(animationName, () ->
animator.startAnimation(animationName));
}
private void demonWalk() {
animator.startAnimation("demon_walk");
}
private void demonCleave() {
animator.startAnimation("demon_cleave");
}
private void demonIdle() {
animator.startAnimation("demon_idle");
}
private void demonDeath() {
animator.startAnimation("demon_death");
}
private void demonCastSpell() {
animator.startAnimation("demon_cast_spell");
}
private void demonFireBreath() {
animator.startAnimation("demon_fire_breath");
demonBreath.setVolume(1000,5.5f);
demonBreath.play();
}
private void demonSmash() {
animator.startAnimation("demon_smash");
}
private void demonTakeHit() {
animator.startAnimation("demon_take_hit");
}
private void idle() {
animator.startAnimation("idle");
}
private void move() {
animator.startAnimation("move");
}
private void projectileExplosion() {
animator.startAnimation("projectile_explosion");
}
private void projectileIdle() {
animator.startAnimation("projectile_idle");
}
private void takeHit() {
animator.startAnimation("take_hit");
}
private void transform() {
animator.startAnimation("transform");
}
private void demonSpawnSound() {
demonSpawn.setVolume(1000,5.5f);
demonSpawn.play();
}
private void demonAttackSound() {
demonAttack.setVolume(1000,5.5f);
demonAttack.play();
}
private void demonBreathInSound() {
demonBreathIn.setVolume(1000,5.5f);
demonBreathIn.play();
}
private void demonLandSound() {
demonLand.setVolume(1000,5.5f);
demonLand.play();
}
private void demonRoarSound() {
demonRoar.setVolume(1000,5.5f);
demonRoar.play();
}
private void demonHealSound() {
demonHeal.setVolume(1000,5.5f);
demonHeal.play();
}
private void demonCleaveSound() {
demonCleave.setVolume(1000,5.5f);
demonCleave.play();
}
private void demonDeathSound() {
demonDeath.setVolume(1000,5.5f);
demonDeath.play();
}
private void slimeySplatSound() {
slimeySplat.setVolume(1000,5.5f);
slimeySplat.play();
}
private void slimeJumpSound() {
slimeJump.setVolume(1000,5.5f);
slimeJump.play();
}
private void slimePopSound() {
slimePop.setVolume(1000,5.5f);
slimePop.play();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package com.csse3200.game.components.bosses;

import com.csse3200.game.components.Component;
import com.csse3200.game.rendering.AnimationRenderComponent;
import com.badlogic.gdx.audio.Sound;
import com.csse3200.game.services.ServiceLocator;

public class IceBabyAnimationController extends Component {
AnimationRenderComponent animator;

/** Animation constants*/
private static final String IDLE_ANIM = "idle";
private static final String ATK1_ANIM = "1_atk";
private static final String ATK2_ANIM = "2_atk";
private static final String ATK3_ANIM = "3_atk";
private static final String DEATH_ANIM = "death";
private static final String INTRO_ANIM = "intro_or_revive";
private static final String STAGGER_ANIM = "stagger";
private static final String TAKEHIT_ANIM = "take_hit";
private static final String WALK_ANIM = "walk";

/** Event name constants*/
private static final String IDLE = "startIdle";
private static final String ATK1 = "start1_atk";
private static final String ATK2 = "start2_atk";
private static final String ATK3 = "start3_atk";
private static final String DEATH = "startDeath";
private static final String INTRO = "startIntro_or_revive";
private static final String STAGGER = "startStagger";
private static final String TAKEHIT = "startTake_hit";
private static final String WALK = "startWalk";

/** Sound variables */
private static final String SPAWN_SOUND = "sounds/mobBoss/iceBabySound.mp3";
Sound spawnSound = ServiceLocator.getResourceService().getAsset(
SPAWN_SOUND, Sound.class);
private static final String MOB_SPAWN_SOUND = "sounds/mobBoss/mobSpawnStomp.mp3";
Sound mobSpawnSound = ServiceLocator.getResourceService().getAsset(
MOB_SPAWN_SOUND, Sound.class);
private static final String AOE_SOUND = "sounds/mobBoss/iceBabyAOE.mp3";
Sound AOESound = ServiceLocator.getResourceService().getAsset(
AOE_SOUND, Sound.class);

@Override
public void create() {
super.create();
animator = this.entity.getComponent(AnimationRenderComponent.class);
entity.getEvents().addListener(IDLE, this::animateIdle);
entity.getEvents().addListener(ATK1, this::animateATK1);
entity.getEvents().addListener(ATK2, this::animateATK2);
entity.getEvents().addListener(ATK3, this::animateATK3);
entity.getEvents().addListener(DEATH, this::animateDeath);
entity.getEvents().addListener(INTRO, this::animateIntro);
entity.getEvents().addListener(STAGGER, this::animateStagger);
entity.getEvents().addListener(TAKEHIT, this::animateTakeHit);
entity.getEvents().addListener(WALK, this::animateWalk);
}

void animateIdle() {
animator.startAnimation(IDLE_ANIM);
}
void animateATK1() {
animator.startAnimation(ATK1_ANIM);
}
void animateATK2() {
animator.startAnimation(ATK2_ANIM);
//volume does not work
mobSpawnSound.setVolume(1000, 5.5f);
mobSpawnSound.play();
}
void animateATK3() {
animator.startAnimation(ATK3_ANIM);
AOESound.setVolume(1000, 5.5f);
AOESound.play();
}
void animateDeath() {
animator.startAnimation(DEATH_ANIM);
}
void animateIntro() {
animator.startAnimation(INTRO_ANIM);
spawnSound.setVolume(1000, 5.5f);
spawnSound.play();
}
void animateTakeHit() {
animator.startAnimation(TAKEHIT_ANIM);
}
void animateStagger() {
animator.startAnimation(STAGGER_ANIM);
}
void animateWalk() {
animator.startAnimation(WALK_ANIM);
}

}
Loading

0 comments on commit d1cbb5a

Please sign in to comment.