diff --git a/.DS_Store b/.DS_Store index 1cce11720..da2f93df0 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/source/core/assets/flat-earth/skin/flat-earth-ui.json b/source/core/assets/flat-earth/skin/flat-earth-ui.json index cf7ab9753..7dfec4fb4 100644 --- a/source/core/assets/flat-earth/skin/flat-earth-ui.json +++ b/source/core/assets/flat-earth/skin/flat-earth-ui.json @@ -1,465 +1,595 @@ { -com.badlogic.gdx.graphics.g2d.BitmapFont: { - button: { - file: fonts/pixel_18.fnt + com.badlogic.gdx.graphics.g2d.BitmapFont: { + button: { + file: fonts/pixel_18.fnt + } + font: { + file: fonts/pixel_18.fnt + } + title: { + file: fonts/pixel_32.fnt + } + font_small: { + file: fonts/pixel_16.fnt + } + font_large: { + file: fonts/pixel_26.fnt + } + } + com.badlogic.gdx.graphics.Color: { + black: { + r: 0 + g: 0 + b: 0 + a: 1 + } + color: { + r: 0.3372549 + g: 0.8 + b: 0.44705883 + a: 1 + } + gray: { + r: 0.5 + g: 0.5 + b: 0.5 + a: 1 + } + highlight: { + r: 0.42156863 + g: 1 + b: 0.5552286 + a: 1 + } + pressed: { + r: 0.2529412 + g: 0.6 + b: 0.33313715 + a: 1 + } + selection: { + r: 0.22745098 + g: 0.59607846 + b: 0.85882354 + a: 1 + } + white: { + r: 1 + g: 1 + b: 1 + a: 1 + } + nothing: { + r: 1 + g: 1 + b: 1 + a: 0 + } + window: { + r: 0.76862746 + g: 0.4509804 + b: 0 + a: 1 + } + + male: { + r: 0.86275 + g: 0.96471 + b: 0.98431 + a: 1 + } + female: { + r: 0.66275 + g: 0.53333 + b: 0.66275 + a: 1 + } + guard: { + r: 0.08235 + g: 0.45490 + b: 0.52941 + a: 1 + } + child: { + r: 0.33333 + g: 0.20784 + b: 0.33333 + a: 1 + } + plumberfriend: { + r: 0.01569 + g: 0.58039 + b: 0.54902 + a: 1 + } + friendlycreature: { + r: 0.67843 + g: 0.74118 + b: 0.20784 + a: 1 + } + humanguard: { + r: 0.95686 + g: 0.67451 + b: 0.48627 + a: 1 + } + + } + com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: { + button-c: { + name: button + color: color + } + button-close-c: { + name: button-close + color: color + } + button-pressed-c: { + name: button-pressed + color: color + } + button-h: { + name: button + color: highlight + } + checkbox-c: { + name: checkbox + color: color + } + checkbox-pressed-c: { + name: checkbox-pressed + color: color + } + list-c: { + name: list + color: color + } + radio-pressed-c: { + name: radio-pressed + color: color + } + scrollbar-c: { + name: scrollbar + color: color + } + scrollbar-android-c: { + name: scrollbar-android + color: color + } + select-box-c: { + name: select-box + color: color + } + select-box-pressed-c: { + name: select-box-pressed + color: color + } + slider-horizontal-c: { + name: slider-horizontal + color: color + } + slider-knob-c: { + name: slider-knob + color: color + } + slider-vertical-c: { + name: slider-vertical + color: color + } + splitpane-horizontal-c: { + name: splitpane-horizontal + color: color + } + splitpane-vertical-c: { + name: splitpane-vertical + color: color + } + textfield-c: { + name: textfield + color: color + } + textfield-male: { + name: textfield + color: male + } + textfield-female: { + name: textfield + color: female + } + textfield-child: { + name: textfield + color: child + } + textfield-guard: { + name: textfield + color: guard + } + textfield-plumberfriend: { + name: textfield, + color: plumberfriend + } + textfield-friendlycreature: { + name: textfield, + color: friendlycreature + } + textfield-humanguard: { + name: textfield, + color: humanguard + } + tooltip-c: { + name: tooltip + color: color + } + touchpad-c: { + name: touchpad + color: color + } + touchpad-knob-c: { + name: touchpad-knob + color: color + } + tree-minus-c: { + name: tree-minus + color: color + } + tree-plus-c: { + name: tree-plus + color: color + } + color: { + name: white + color: color + } + color-nothing: { + name: color + color: nothing + } + window-c: { + name: window + color: color + } + selection: { + name: white + color: selection + } + slider-horizontal-s: { + name: slider-horizontal + color: selection + } + slider-vertical-s: { + name: slider-vertical + color: selection + } + select-box-pressed-h: { + name: select-box-pressed + color: highlight + } + select-box-h: { + name: select-box + color: highlight + } + slider-knob-h: { + name: slider-knob + color: highlight + } + slider-horizontal-p: { + name: slider-horizontal + color: pressed + } + slider-vertical-p: { + name: slider-vertical + color: pressed + } + black: { + name: white + color: black + } + button-close-p: { + name: button-close + color: pressed + } + button-close-h: { + name: button-close + color: highlight + } + button-close-s: { + name: button-close + color: selection + } + window-w: { + name: window + color: window + } + button-p: { + name: button + color: pressed + } + slider-fancy-p: { + name: slider-fancy + color: pressed + } + checkbox-h: { + name: checkbox + color: highlight + } + checkbox-pressed-h: { + name: checkbox-pressed + color: highlight + } + checkbox-p: { + name: checkbox + color: pressed + } + checkbox-pressed-p: { + name: checkbox-pressed + color: pressed + } + radio-pressed-h: { + name: radio-pressed + color: highlight + } + radio-pressed-p: { + name: radio-pressed + color: pressed + } + } + com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: { + default: { + up: button-c + down: button-p + over: button-h + } + close: { + up: button-close-c + down: button-close-p + over: button-close-h + } + } + com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: { + default: { + checkboxOn: checkbox-pressed-c + checkboxOff: checkbox-c + font: button + fontColor: color + downFontColor: pressed + overFontColor: highlight + } + radio: { + checkboxOn: radio-pressed-c + checkboxOff: checkbox-c + font: button + fontColor: color + } + } + com.badlogic.gdx.scenes.scene2d.ui.ImageButton$ImageButtonStyle: { + default: { + up: button-c + down: button-p + over: button-h + } + } + com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton$ImageTextButtonStyle: { + default: { + font: button + fontColor: white + downFontColor: white + overFontColor: gray + up: button-c + down: button-p + over: button-h + } + check: { + imageUp: checkbox-c + imageDown: checkbox-pressed-p + imageOver: checkbox-h + imageChecked: checkbox-pressed-c + imageCheckedOver: checkbox-pressed-h + font: button + fontColor: color + downFontColor: pressed + overFontColor: highlight + } + radio: { + imageUp: checkbox-c + imageDown: radio-pressed-p + imageOver: checkbox-h + imageChecked: radio-pressed-c + imageCheckedOver: radio-pressed-h + font: button + fontColor: color + downFontColor: pressed + overFontColor: highlight + } + } + com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: { + default: { + font: font + fontColor: black + } + button: { + font: button + fontColor: color + } + title: { + font: title + fontColor: color + } + small: { + font: font_small, + fontColor: black + } + large: { + font: font_large, + fontColor: black + } + } + com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: { + default: { + font: font + fontColorSelected: white + fontColorUnselected: white + selection: selection + background: list-c + } + } + com.badlogic.gdx.scenes.scene2d.ui.ProgressBar$ProgressBarStyle: { + default-horizontal: { + background: slider-horizontal-c + knobBefore: slider-horizontal-s + } + default-vertical: { + background: slider-vertical-c + knobBefore: slider-vertical-s + } + fancy: { + background: slider-fancy-p + knobBefore: slider-fancy-knob + } + } + com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: { + default: { + hScrollKnob: scrollbar-c + vScrollKnob: scrollbar-c + } + android: { + hScrollKnob: scrollbar-android-c + vScrollKnob: scrollbar-android-c + } + } + com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: { + default: { + font: font + fontColor: white + background: select-box-c + scrollStyle: default + listStyle: default + backgroundOver: select-box-h + backgroundOpen: select-box-pressed-c + } + } + com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: { + default-horizontal: { + knobOver: slider-knob-h + knobDown: slider-knob-h + background: slider-horizontal-p + knob: slider-knob-c + knobBefore: slider-horizontal-s + } + default-vertical: { + knobOver: slider-knob-h + knobDown: slider-knob-h + background: slider-vertical-p + knob: slider-knob-c + knobBefore: slider-vertical-s + } + fancy: { + knobOver: slider-knob-h + knobDown: slider-knob-h + background: slider-fancy-p + knob: slider-knob-c + knobBefore: slider-fancy-knob + } + } + com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: { + default-horizontal: { + handle: splitpane-horizontal-c + } + default-vertical: { + handle: splitpane-vertical-c + } + } + com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: { + default: { + font: button + fontColor: white + downFontColor: white + overFontColor: gray + up: button-c + down: button-p + over: button-h + } + } + com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: { + default: { + font: font + fontColor: white + background: textfield-c + cursor: white + selection: selection + } + male: { + font: font + fontColor: black + background: textfield-male + cursor: white + selection: selection + } + female: { + font: font + fontColor: white + background: textfield-female + + } + guard: { + font: font + fontColor: white + background: textfield-guard + cursor: white + selection: selection + } + child: { + font: font + fontColor: white, + background: textfield-child + cursor: white + selection: selection + } + plumberfriend: { + font: font + fontColor: white + background: textfield-plumberfriend + cursor: white + selection: selection + } + friendlycreature: { + font: font + fontColor: white + background: textfield-friendlycreature + cursor: white + selection: selection + } + humanguard: { + font: font + fontColor: white + background: textfield-humanguard + cursor: white + selection: selection + } + } + com.badlogic.gdx.scenes.scene2d.ui.TextTooltip$TextTooltipStyle: { + default: { + label: default + background: tooltip-c + } + } + com.badlogic.gdx.scenes.scene2d.ui.Touchpad$TouchpadStyle: { + default: { + background: touchpad-c + knob: touchpad-knob-c + } + } + com.badlogic.gdx.scenes.scene2d.ui.Tree$TreeStyle: { + default: { + plus: tree-plus-c + minus: tree-minus-c + } + } + com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: { + default: { + background: window-w + titleFont: font + titleFontColor: white + } } - font: { - file: fonts/pixel_18.fnt - } - title: { - file: fonts/pixel_32.fnt - } - font_small: { - file: fonts/pixel_16.fnt - } - font_large: { - file: fonts/pixel_26.fnt - } -} -com.badlogic.gdx.graphics.Color: { - black: { - r: 0 - g: 0 - b: 0 - a: 1 - } - color: { - r: 0.3372549 - g: 0.8 - b: 0.44705883 - a: 1 - } - gray: { - r: 0.5 - g: 0.5 - b: 0.5 - a: 1 - } - highlight: { - r: 0.42156863 - g: 1 - b: 0.5552286 - a: 1 - } - pressed: { - r: 0.2529412 - g: 0.6 - b: 0.33313715 - a: 1 - } - selection: { - r: 0.22745098 - g: 0.59607846 - b: 0.85882354 - a: 1 - } - white: { - r: 1 - g: 1 - b: 1 - a: 1 - } - window: { - r: 0.76862746 - g: 0.4509804 - b: 0 - a: 1 - } -} -com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: { - button-c: { - name: button - color: color - } - button-close-c: { - name: button-close - color: color - } - button-pressed-c: { - name: button-pressed - color: color - } - button-h: { - name: button - color: highlight - } - checkbox-c: { - name: checkbox - color: color - } - checkbox-pressed-c: { - name: checkbox-pressed - color: color - } - list-c: { - name: list - color: color - } - radio-pressed-c: { - name: radio-pressed - color: color - } - scrollbar-c: { - name: scrollbar - color: color - } - scrollbar-android-c: { - name: scrollbar-android - color: color - } - select-box-c: { - name: select-box - color: color - } - select-box-pressed-c: { - name: select-box-pressed - color: color - } - slider-horizontal-c: { - name: slider-horizontal - color: color - } - slider-knob-c: { - name: slider-knob - color: color - } - slider-vertical-c: { - name: slider-vertical - color: color - } - splitpane-horizontal-c: { - name: splitpane-horizontal - color: color - } - splitpane-vertical-c: { - name: splitpane-vertical - color: color - } - textfield-c: { - name: textfield - color: color - } - tooltip-c: { - name: tooltip - color: color - } - touchpad-c: { - name: touchpad - color: color - } - touchpad-knob-c: { - name: touchpad-knob - color: color - } - tree-minus-c: { - name: tree-minus - color: color - } - tree-plus-c: { - name: tree-plus - color: color - } - color: { - name: white - color: color - } - window-c: { - name: window - color: color - } - selection: { - name: white - color: selection - } - slider-horizontal-s: { - name: slider-horizontal - color: selection - } - slider-vertical-s: { - name: slider-vertical - color: selection - } - select-box-pressed-h: { - name: select-box-pressed - color: highlight - } - select-box-h: { - name: select-box - color: highlight - } - slider-knob-h: { - name: slider-knob - color: highlight - } - slider-horizontal-p: { - name: slider-horizontal - color: pressed - } - slider-vertical-p: { - name: slider-vertical - color: pressed - } - black: { - name: white - color: black - } - button-close-p: { - name: button-close - color: pressed - } - button-close-h: { - name: button-close - color: highlight - } - button-close-s: { - name: button-close - color: selection - } - window-w: { - name: window - color: window - } - button-p: { - name: button - color: pressed - } - slider-fancy-p: { - name: slider-fancy - color: pressed - } - checkbox-h: { - name: checkbox - color: highlight - } - checkbox-pressed-h: { - name: checkbox-pressed - color: highlight - } - checkbox-p: { - name: checkbox - color: pressed - } - checkbox-pressed-p: { - name: checkbox-pressed - color: pressed - } - radio-pressed-h: { - name: radio-pressed - color: highlight - } - radio-pressed-p: { - name: radio-pressed - color: pressed - } -} -com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: { - default: { - up: button-c - down: button-p - over: button-h - } - close: { - up: button-close-c - down: button-close-p - over: button-close-h - } -} -com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: { - default: { - checkboxOn: checkbox-pressed-c - checkboxOff: checkbox-c - font: button - fontColor: color - downFontColor: pressed - overFontColor: highlight - } - radio: { - checkboxOn: radio-pressed-c - checkboxOff: checkbox-c - font: button - fontColor: color - } -} -com.badlogic.gdx.scenes.scene2d.ui.ImageButton$ImageButtonStyle: { - default: { - up: button-c - down: button-p - over: button-h - } -} -com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton$ImageTextButtonStyle: { - default: { - font: button - fontColor: white - downFontColor: white - overFontColor: gray - up: button-c - down: button-p - over: button-h - } - check: { - imageUp: checkbox-c - imageDown: checkbox-pressed-p - imageOver: checkbox-h - imageChecked: checkbox-pressed-c - imageCheckedOver: checkbox-pressed-h - font: button - fontColor: color - downFontColor: pressed - overFontColor: highlight - } - radio: { - imageUp: checkbox-c - imageDown: radio-pressed-p - imageOver: checkbox-h - imageChecked: radio-pressed-c - imageCheckedOver: radio-pressed-h - font: button - fontColor: color - downFontColor: pressed - overFontColor: highlight - } -} -com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: { - default: { - font: font - fontColor: black - } - button: { - font: button - fontColor: color - } - title: { - font: title - fontColor: color - } - small: { - font: font_small, - fontColor: black - } - large: { - font: font_large, - fontColor: black - } -} -com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: { - default: { - font: font - fontColorSelected: white - fontColorUnselected: white - selection: selection - background: list-c - } -} -com.badlogic.gdx.scenes.scene2d.ui.ProgressBar$ProgressBarStyle: { - default-horizontal: { - background: slider-horizontal-c - knobBefore: slider-horizontal-s - } - default-vertical: { - background: slider-vertical-c - knobBefore: slider-vertical-s - } - fancy: { - background: slider-fancy-p - knobBefore: slider-fancy-knob - } -} -com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: { - default: { - hScrollKnob: scrollbar-c - vScrollKnob: scrollbar-c - } - android: { - hScrollKnob: scrollbar-android-c - vScrollKnob: scrollbar-android-c - } -} -com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: { - default: { - font: font - fontColor: white - background: select-box-c - scrollStyle: default - listStyle: default - backgroundOver: select-box-h - backgroundOpen: select-box-pressed-c - } -} -com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: { - default-horizontal: { - knobOver: slider-knob-h - knobDown: slider-knob-h - background: slider-horizontal-p - knob: slider-knob-c - knobBefore: slider-horizontal-s - } - default-vertical: { - knobOver: slider-knob-h - knobDown: slider-knob-h - background: slider-vertical-p - knob: slider-knob-c - knobBefore: slider-vertical-s - } - fancy: { - knobOver: slider-knob-h - knobDown: slider-knob-h - background: slider-fancy-p - knob: slider-knob-c - knobBefore: slider-fancy-knob - } -} -com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: { - default-horizontal: { - handle: splitpane-horizontal-c - } - default-vertical: { - handle: splitpane-vertical-c - } -} -com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: { - default: { - font: button - fontColor: white - downFontColor: white - overFontColor: gray - up: button-c - down: button-p - over: button-h - } -} -com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: { - default: { - font: font - fontColor: white - background: textfield-c - cursor: white - selection: selection - } -} -com.badlogic.gdx.scenes.scene2d.ui.TextTooltip$TextTooltipStyle: { - default: { - label: default - background: tooltip-c - } -} -com.badlogic.gdx.scenes.scene2d.ui.Touchpad$TouchpadStyle: { - default: { - background: touchpad-c - knob: touchpad-knob-c - } -} -com.badlogic.gdx.scenes.scene2d.ui.Tree$TreeStyle: { - default: { - plus: tree-plus-c - minus: tree-minus-c - } -} -com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: { - default: { - background: window-w - titleFont: font - titleFontColor: white - } -} } \ No newline at end of file diff --git a/source/core/assets/images/Armour-assets-sprint2/Dark_Armour.png b/source/core/assets/images/Armour-assets-sprint2/Dark_Armour.png new file mode 100644 index 000000000..0faf9fb51 Binary files /dev/null and b/source/core/assets/images/Armour-assets-sprint2/Dark_Armour.png differ diff --git a/source/core/assets/images/CombatItems/animations/combatItemsAnimation.atlas b/source/core/assets/images/CombatItems/animations/combatItemsAnimation.atlas index 2689ad2e2..6fc17bf63 100644 --- a/source/core/assets/images/CombatItems/animations/combatItemsAnimation.atlas +++ b/source/core/assets/images/CombatItems/animations/combatItemsAnimation.atlas @@ -59,7 +59,7 @@ athenaDamage orig: 64, 64 offset: 0, 0 index: -1 -athenaDamage +athenaDamage rotate: false xy: 512, 0 size: 64, 64 @@ -136,7 +136,7 @@ athenaDamageStatic orig: 64, 64 offset: 0, 0 index: -1 -athenaDamageStatic +athenaDamageStatic rotate: false xy: 1216, 0 size: 64, 64 @@ -164,7 +164,7 @@ athenaFire orig: 64, 64 offset: 0, 0 index: -1 -athenaFire +athenaFire rotate: false xy: 1472, 0 size: 64, 64 @@ -241,7 +241,7 @@ athenaFireStatic orig: 64, 64 offset: 0, 0 index: -1 -athenaFireStatic +athenaFireStatic rotate: false xy: 128, 64 size: 64, 64 @@ -269,7 +269,7 @@ athenaPoison orig: 64, 64 offset: 0, 0 index: -1 -athenaPoison +athenaPoison rotate: false xy: 384, 64 size: 64, 64 @@ -311,7 +311,7 @@ athenaPoisonStatic orig: 64, 64 offset: 0, 0 index: -1 -athenaPoisonStatic +athenaPoisonStatic rotate: false xy: 768, 64 size: 64, 64 @@ -353,7 +353,7 @@ athenaSpeed orig: 64, 64 offset: 0, 0 index: -1 -athenaSpeed +athenaSpeed rotate: false xy: 1152, 64 size: 64, 64 @@ -402,7 +402,7 @@ athenaSpeedStatic orig: 64, 64 offset: 0, 0 index: -1 -athenaSpeedStatic +athenaSpeedStatic rotate: false xy: 1600, 64 size: 64, 64 @@ -430,49 +430,49 @@ default orig: 64, 64 offset: 0, 0 index: -1 -hera +goldenPlungerBow rotate: false xy: 1856, 64 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -hera +goldenPlungerBow rotate: false xy: 1920, 64 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -hera +goldenPlungerBow rotate: false xy: 1984, 64 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -hera +goldenPlungerBow rotate: false xy: 0, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -hera +goldenPlungerBow rotate: false xy: 64, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -hera +goldenPlungerBow rotate: false xy: 128, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -hera +goldenPlungerBow rotate: false xy: 192, 128 size: 64, 64 @@ -500,49 +500,49 @@ hera orig: 64, 64 offset: 0, 0 index: -1 -heraAthena +hera rotate: false xy: 448, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthena +hera rotate: false xy: 512, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthena +hera rotate: false xy: 576, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthena +hera rotate: false xy: 640, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthena +hera rotate: false xy: 704, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthena +hera rotate: false xy: 768, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthena +hera rotate: false xy: 832, 128 size: 64, 64 @@ -563,49 +563,49 @@ heraAthena orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamage +heraAthena rotate: false xy: 1024, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamage +heraAthena rotate: false xy: 1088, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamage +heraAthena rotate: false xy: 1152, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamage +heraAthena rotate: false xy: 1216, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamage +heraAthena rotate: false xy: 1280, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamage +heraAthena rotate: false xy: 1344, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamage +heraAthena rotate: false xy: 1408, 128 size: 64, 64 @@ -626,189 +626,189 @@ heraAthenaDamage orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamageStatic +heraAthenaDamage rotate: false xy: 1600, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamageStatic +heraAthenaDamage rotate: false xy: 1664, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamageStatic +heraAthenaDamage rotate: false xy: 1728, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamageStatic +heraAthenaDamage rotate: false xy: 1792, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaDamageStatic +heraAthenaDamage rotate: false xy: 1856, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaFireStatic +heraAthenaDamage rotate: false xy: 1920, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaFireStatic +heraAthenaDamage rotate: false xy: 1984, 128 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaFireStatic +heraAthenaDamageStatic rotate: false xy: 0, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaFireStatic +heraAthenaDamageStatic rotate: false xy: 64, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoisonStatic +heraAthenaDamageStatic rotate: false xy: 128, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoisonStatic +heraAthenaDamageStatic rotate: false xy: 192, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoisonStatic +heraAthenaDamageStatic rotate: false xy: 256, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoisonStatic +heraAthenaFireStatic rotate: false xy: 320, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoisonStatic +heraAthenaFireStatic rotate: false xy: 384, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoisonStatic +heraAthenaFireStatic rotate: false xy: 448, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaSpeedStatic +heraAthenaFireStatic rotate: false xy: 512, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaSpeedStatic +heraAthenaPoisonStatic rotate: false xy: 576, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaSpeedStatic +heraAthenaPoisonStatic rotate: false xy: 640, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaSpeedStatic +heraAthenaPoisonStatic rotate: false xy: 704, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaStatic +heraAthenaPoisonStatic rotate: false xy: 768, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaFire +heraAthenaPoisonStatic rotate: false xy: 832, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaFire +heraAthenaPoisonStatic rotate: false xy: 896, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaFire +heraAthenaSpeedStatic rotate: false xy: 960, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaFire +heraAthenaSpeedStatic rotate: false xy: 1024, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaFire +heraAthenaSpeedStatic rotate: false xy: 1088, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaFire +heraAthenaSpeedStatic rotate: false xy: 1152, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaFire +heraAthenaStatic rotate: false xy: 1216, 192 size: 64, 64 @@ -829,49 +829,49 @@ heraAthenaFire orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoison +heraAthenaFire rotate: false xy: 1408, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoison +heraAthenaFire rotate: false xy: 1472, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoison +heraAthenaFire rotate: false xy: 1536, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoison +heraAthenaFire rotate: false xy: 1600, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoison +heraAthenaFire rotate: false xy: 1664, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoison +heraAthenaFire rotate: false xy: 1728, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaPoison +heraAthenaFire rotate: false xy: 1792, 192 size: 64, 64 @@ -892,49 +892,49 @@ heraAthenaPoison orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaSpeed +heraAthenaPoison rotate: false xy: 1984, 192 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaSpeed +heraAthenaPoison rotate: false xy: 0, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaSpeed +heraAthenaPoison rotate: false xy: 64, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaSpeed +heraAthenaPoison rotate: false xy: 128, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaSpeed +heraAthenaPoison rotate: false xy: 192, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaSpeed +heraAthenaPoison rotate: false xy: 256, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraAthenaSpeed +heraAthenaPoison rotate: false xy: 320, 256 size: 64, 64 @@ -955,49 +955,49 @@ heraAthenaSpeed orig: 64, 64 offset: 0, 0 index: -1 -heraDamage +heraAthenaSpeed rotate: false xy: 512, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraDamage +heraAthenaSpeed rotate: false xy: 576, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraDamage +heraAthenaSpeed rotate: false xy: 640, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraDamage +heraAthenaSpeed rotate: false xy: 704, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraDamage +heraAthenaSpeed rotate: false xy: 768, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraDamage +heraAthenaSpeed rotate: false xy: 832, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraDamage +heraAthenaSpeed rotate: false xy: 896, 256 size: 64, 64 @@ -1032,77 +1032,77 @@ heraDamage orig: 64, 64 offset: 0, 0 index: -1 -heraDamageStatic +heraDamage rotate: false xy: 1216, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraDamageStatic +heraDamage rotate: false xy: 1280, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraDamageStatic +heraDamage rotate: false xy: 1344, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraDamageStatic +heraDamage rotate: false xy: 1408, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraFire +heraDamage rotate: false xy: 1472, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraFire +heraDamage rotate: false xy: 1536, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraFire +heraDamage rotate: false xy: 1600, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraFire +heraDamageStatic rotate: false xy: 1664, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraFire +heraDamageStatic rotate: false xy: 1728, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraFire +heraDamageStatic rotate: false xy: 1792, 256 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraFire +heraDamageStatic rotate: false xy: 1856, 256 size: 64, 64 @@ -1137,588 +1137,588 @@ heraFire orig: 64, 64 offset: 0, 0 index: -1 -heraFireStatic +heraFire rotate: false xy: 128, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraFireStatic +heraFire rotate: false xy: 192, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraFireStatic +heraFire rotate: false xy: 256, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraFireStatic +heraFire rotate: false xy: 320, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoison +heraFire rotate: false xy: 384, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoison +heraFire rotate: false xy: 448, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoison +heraFire rotate: false xy: 512, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoison +heraFireStatic rotate: false xy: 576, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoison +heraFireStatic rotate: false xy: 640, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoison +heraFireStatic rotate: false xy: 704, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoison +heraFireStatic rotate: false xy: 768, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoisonStatic +heraPoison rotate: false xy: 832, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoisonStatic +heraPoison rotate: false xy: 896, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoisonStatic +heraPoison rotate: false xy: 960, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoisonStatic +heraPoison rotate: false xy: 1024, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoisonStatic +heraPoison rotate: false xy: 1088, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraPoisonStatic +heraPoison rotate: false xy: 1152, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraSpeed +heraPoison rotate: false xy: 1216, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraSpeed +heraPoisonStatic rotate: false xy: 1280, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraSpeed +heraPoisonStatic rotate: false xy: 1344, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraSpeed +heraPoisonStatic rotate: false xy: 1408, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraSpeed +heraPoisonStatic rotate: false xy: 1472, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraSpeed +heraPoisonStatic rotate: false xy: 1536, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraSpeed +heraPoisonStatic rotate: false xy: 1600, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraSpeedStatic +heraSpeed rotate: false xy: 1664, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraSpeedStatic +heraSpeed rotate: false xy: 1728, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraSpeedStatic +heraSpeed rotate: false xy: 1792, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraSpeedStatic +heraSpeed rotate: false xy: 1856, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -heraStatic +heraSpeed rotate: false xy: 1920, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipe +heraSpeed rotate: false xy: 1984, 320 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipe +heraSpeed rotate: false xy: 0, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipe +heraSpeedStatic rotate: false xy: 64, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipe +heraSpeedStatic rotate: false xy: 128, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipe +heraSpeedStatic rotate: false xy: 192, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipe +heraSpeedStatic rotate: false xy: 256, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeDamage +heraStatic rotate: false xy: 320, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeDamage +pipe rotate: false xy: 384, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeDamage +pipe rotate: false xy: 448, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeDamage +pipe rotate: false xy: 512, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeDamage +pipe rotate: false xy: 576, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeDamage +pipe rotate: false xy: 640, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeDamageStatic +pipe rotate: false xy: 704, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeDamageStatic +pipeDamage rotate: false xy: 768, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeDamageStatic +pipeDamage rotate: false xy: 832, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeDamageStatic +pipeDamage rotate: false xy: 896, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeFire +pipeDamage rotate: false xy: 960, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeFire +pipeDamage rotate: false xy: 1024, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeFire +pipeDamage rotate: false xy: 1088, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeFire +pipeDamageStatic rotate: false xy: 1152, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeFire +pipeDamageStatic rotate: false xy: 1216, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeFire +pipeDamageStatic rotate: false xy: 1280, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeFireStatic +pipeDamageStatic rotate: false xy: 1344, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeFireStatic +pipeFire rotate: false xy: 1408, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeFireStatic +pipeFire rotate: false xy: 1472, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeFireStatic +pipeFire rotate: false xy: 1536, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipePoison +pipeFire rotate: false xy: 1600, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipePoison +pipeFire rotate: false xy: 1664, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipePoison +pipeFire rotate: false xy: 1728, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipePoison +pipeFireStatic rotate: false xy: 1792, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipePoison +pipeFireStatic rotate: false xy: 1856, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipePoison +pipeFireStatic rotate: false xy: 1920, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipePoisonStatic +pipeFireStatic rotate: false xy: 1984, 384 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipePoisonStatic +pipePoison rotate: false xy: 0, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipePoisonStatic +pipePoison rotate: false xy: 64, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipePoisonStatic +pipePoison rotate: false xy: 128, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipePoisonStatic +pipePoison rotate: false xy: 192, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeSpeed +pipePoison rotate: false xy: 256, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeSpeed +pipePoison rotate: false xy: 320, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeSpeed +pipePoisonStatic rotate: false xy: 384, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeSpeed +pipePoisonStatic rotate: false xy: 448, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeSpeed +pipePoisonStatic rotate: false xy: 512, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeSpeed +pipePoisonStatic rotate: false xy: 576, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeSpeedStatic +pipePoisonStatic rotate: false xy: 640, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeSpeedStatic +pipeSpeed rotate: false xy: 704, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeSpeedStatic +pipeSpeed rotate: false xy: 768, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeSpeedStatic +pipeSpeed rotate: false xy: 832, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -pipeStatic +pipeSpeed rotate: false xy: 896, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plunger +pipeSpeed rotate: false xy: 960, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plunger +pipeSpeed rotate: false xy: 1024, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plunger +pipeSpeedStatic rotate: false xy: 1088, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plunger +pipeSpeedStatic rotate: false xy: 1152, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plunger +pipeSpeedStatic rotate: false xy: 1216, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plunger +pipeSpeedStatic rotate: false xy: 1280, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plunger +pipeStatic rotate: false xy: 1344, 448 size: 64, 64 @@ -1767,49 +1767,49 @@ plunger orig: 64, 64 offset: 0, 0 index: -1 -plungerBow +plunger rotate: false xy: 1792, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBow +plunger rotate: false xy: 1856, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBow +plunger rotate: false xy: 1920, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBow +plunger rotate: false xy: 1984, 448 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBow +plunger rotate: false xy: 0, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBow +plunger rotate: false xy: 64, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBow +plunger rotate: false xy: 128, 512 size: 64, 64 @@ -1823,399 +1823,399 @@ plungerBow orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamage +plungerBow rotate: false xy: 256, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamage +plungerBow rotate: false xy: 320, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamage +plungerBow rotate: false xy: 384, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamage +plungerBow rotate: false xy: 448, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamage +plungerBow rotate: false xy: 512, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamage +plungerBow rotate: false xy: 576, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamage +plungerBow rotate: false xy: 640, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamage +plungerBowAnimation0007 rotate: false xy: 704, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamageStatic +plungerBowDamage rotate: false xy: 768, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamageStatic +plungerBowDamage rotate: false xy: 832, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamageStatic +plungerBowDamage rotate: false xy: 896, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowDamageStatic +plungerBowDamage rotate: false xy: 960, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFire +plungerBowDamage rotate: false xy: 1024, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFire +plungerBowDamage rotate: false xy: 1088, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFire +plungerBowDamage rotate: false xy: 1152, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFire +plungerBowDamage rotate: false xy: 1216, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFire +plungerBowDamageStatic rotate: false xy: 1280, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFire +plungerBowDamageStatic rotate: false xy: 1344, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFire +plungerBowDamageStatic rotate: false xy: 1408, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFire +plungerBowDamageStatic rotate: false xy: 1472, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFireStatic +plungerBowFire rotate: false xy: 1536, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFireStatic +plungerBowFire rotate: false xy: 1600, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFireStatic +plungerBowFire rotate: false xy: 1664, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowFireStatic +plungerBowFire rotate: false xy: 1728, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoison +plungerBowFire rotate: false xy: 1792, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoison +plungerBowFire rotate: false xy: 1856, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoison +plungerBowFire rotate: false xy: 1920, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoison +plungerBowFire rotate: false xy: 1984, 512 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoison +plungerBowFireStatic rotate: false xy: 0, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoison +plungerBowFireStatic rotate: false xy: 64, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoison +plungerBowFireStatic rotate: false xy: 128, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoison +plungerBowFireStatic rotate: false xy: 192, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoisonStatic +plungerBowPoison rotate: false xy: 256, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoisonStatic +plungerBowPoison rotate: false xy: 320, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoisonStatic +plungerBowPoison rotate: false xy: 384, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowPoisonStatic +plungerBowPoison rotate: false xy: 448, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeed +plungerBowPoison rotate: false xy: 512, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeed +plungerBowPoison rotate: false xy: 576, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeed +plungerBowPoison rotate: false xy: 640, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeed +plungerBowPoison rotate: false xy: 704, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeed +plungerBowPoisonStatic rotate: false xy: 768, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeed +plungerBowPoisonStatic rotate: false xy: 832, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeed +plungerBowPoisonStatic rotate: false xy: 896, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeed +plungerBowPoisonStatic rotate: false xy: 960, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeedStatic +plungerBowSpeed rotate: false xy: 1024, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeedStatic +plungerBowSpeed rotate: false xy: 1088, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeedStatic +plungerBowSpeed rotate: false xy: 1152, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowSpeedStatic +plungerBowSpeed rotate: false xy: 1216, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerBowStatic +plungerBowSpeed rotate: false xy: 1280, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerDamage +plungerBowSpeed rotate: false xy: 1344, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerDamage +plungerBowSpeed rotate: false xy: 1408, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerDamage +plungerBowSpeed rotate: false xy: 1472, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerDamage +plungerBowSpeedStatic rotate: false xy: 1536, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerDamage +plungerBowSpeedStatic rotate: false xy: 1600, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerDamage +plungerBowSpeedStatic rotate: false xy: 1664, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerDamage +plungerBowSpeedStatic rotate: false xy: 1728, 576 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerDamage +plungerBowStatic rotate: false xy: 1792, 576 size: 64, 64 @@ -2257,84 +2257,84 @@ plungerDamage orig: 64, 64 offset: 0, 0 index: -1 -plungerDamageStatic +plungerDamage rotate: false xy: 128, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerDamageStatic +plungerDamage rotate: false xy: 192, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerDamageStatic +plungerDamage rotate: false xy: 256, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerDamageStatic +plungerDamage rotate: false xy: 320, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerFire +plungerDamage rotate: false xy: 384, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerFire +plungerDamage rotate: false xy: 448, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerFire +plungerDamage rotate: false xy: 512, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerFire +plungerDamage rotate: false xy: 576, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerFire +plungerDamageStatic rotate: false xy: 640, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerFire +plungerDamageStatic rotate: false xy: 704, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerFire +plungerDamageStatic rotate: false xy: 768, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerFire +plungerDamageStatic rotate: false xy: 832, 640 size: 64, 64 @@ -2376,84 +2376,84 @@ plungerFire orig: 64, 64 offset: 0, 0 index: -1 -plungerFireStatic +plungerFire rotate: false xy: 1216, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerFireStatic +plungerFire rotate: false xy: 1280, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerFireStatic +plungerFire rotate: false xy: 1344, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerFireStatic +plungerFire rotate: false xy: 1408, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoison +plungerFire rotate: false xy: 1472, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoison +plungerFire rotate: false xy: 1536, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoison +plungerFire rotate: false xy: 1600, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoison +plungerFire rotate: false xy: 1664, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoison +plungerFireStatic rotate: false xy: 1728, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoison +plungerFireStatic rotate: false xy: 1792, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoison +plungerFireStatic rotate: false xy: 1856, 640 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoison +plungerFireStatic rotate: false xy: 1920, 640 size: 64, 64 @@ -2495,98 +2495,98 @@ plungerPoison orig: 64, 64 offset: 0, 0 index: -1 -plungerPoisonStatic +plungerPoison rotate: false xy: 256, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoisonStatic +plungerPoison rotate: false xy: 320, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoisonStatic +plungerPoison rotate: false xy: 384, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoisonStatic +plungerPoison rotate: false xy: 448, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoisonStatic +plungerPoison rotate: false xy: 512, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerPoisonStatic +plungerPoison rotate: false xy: 576, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeed +plungerPoison rotate: false xy: 640, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeed +plungerPoison rotate: false xy: 704, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeed +plungerPoisonStatic rotate: false xy: 768, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeed +plungerPoisonStatic rotate: false xy: 832, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeed +plungerPoisonStatic rotate: false xy: 896, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeed +plungerPoisonStatic rotate: false xy: 960, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeed +plungerPoisonStatic rotate: false xy: 1024, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeed +plungerPoisonStatic rotate: false xy: 1088, 704 size: 64, 64 @@ -2628,91 +2628,91 @@ plungerSpeed orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeedStatic +plungerSpeed rotate: false xy: 1472, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeedStatic +plungerSpeed rotate: false xy: 1536, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeedStatic +plungerSpeed rotate: false xy: 1600, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerSpeedStatic +plungerSpeed rotate: false xy: 1664, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -plungerStatic +plungerSpeed rotate: false xy: 1728, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -sword +plungerSpeed rotate: false xy: 1792, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -sword +plungerSpeed rotate: false xy: 1856, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -sword +plungerSpeed rotate: false xy: 1920, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -sword +plungerSpeedStatic rotate: false xy: 1984, 704 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -sword +plungerSpeedStatic rotate: false xy: 0, 768 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -sword +plungerSpeedStatic rotate: false xy: 64, 768 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -sword +plungerSpeedStatic rotate: false xy: 128, 768 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -sword +plungerStatic rotate: false xy: 192, 768 size: 64, 64 @@ -2852,56 +2852,56 @@ sword orig: 64, 64 offset: 0, 0 index: -1 -swordDamage +sword rotate: false xy: 1472, 768 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordDamage +sword rotate: false xy: 1536, 768 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordDamage +sword rotate: false xy: 1600, 768 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordDamage +sword rotate: false xy: 1664, 768 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordDamage +sword rotate: false xy: 1728, 768 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordDamage +sword rotate: false xy: 1792, 768 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordDamage +sword rotate: false xy: 1856, 768 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordDamage +sword rotate: false xy: 1920, 768 size: 64, 64 @@ -3041,84 +3041,84 @@ swordDamage orig: 64, 64 offset: 0, 0 index: -1 -swordDamageStatic +swordDamage rotate: false xy: 1152, 832 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordDamageStatic +swordDamage rotate: false xy: 1216, 832 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordDamageStatic +swordDamage rotate: false xy: 1280, 832 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordDamageStatic +swordDamage rotate: false xy: 1344, 832 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordFire +swordDamage rotate: false xy: 1408, 832 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordFire +swordDamage rotate: false xy: 1472, 832 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordFire +swordDamage rotate: false xy: 1536, 832 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordFire +swordDamage rotate: false xy: 1600, 832 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordFire +swordDamageStatic rotate: false xy: 1664, 832 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordFire +swordDamageStatic rotate: false xy: 1728, 832 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordFire +swordDamageStatic rotate: false xy: 1792, 832 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordFire +swordDamageStatic rotate: false xy: 1856, 832 size: 64, 64 @@ -3258,84 +3258,84 @@ swordFire orig: 64, 64 offset: 0, 0 index: -1 -swordFireStatic +swordFire rotate: false xy: 1088, 896 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordFireStatic +swordFire rotate: false xy: 1152, 896 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordFireStatic +swordFire rotate: false xy: 1216, 896 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordFireStatic +swordFire rotate: false xy: 1280, 896 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordPoison +swordFire rotate: false xy: 1344, 896 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordPoison +swordFire rotate: false xy: 1408, 896 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordPoison +swordFire rotate: false xy: 1472, 896 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordPoison +swordFire rotate: false xy: 1536, 896 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordPoison +swordFireStatic rotate: false xy: 1600, 896 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordPoison +swordFireStatic rotate: false xy: 1664, 896 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordPoison +swordFireStatic rotate: false xy: 1728, 896 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordPoison +swordFireStatic rotate: false xy: 1792, 896 size: 64, 64 @@ -3468,84 +3468,84 @@ swordPoison orig: 64, 64 offset: 0, 0 index: -1 -swordPoisonStatic +swordPoison rotate: false xy: 960, 960 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordPoisonStatic +swordPoison rotate: false xy: 1024, 960 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordPoisonStatic +swordPoison rotate: false xy: 1088, 960 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordPoisonStatic +swordPoison rotate: false xy: 1152, 960 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordSpeed +swordPoison rotate: false xy: 1216, 960 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordSpeed +swordPoison rotate: false xy: 1280, 960 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordSpeed +swordPoison rotate: false xy: 1344, 960 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordSpeed +swordPoison rotate: false xy: 1408, 960 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordSpeed +swordPoisonStatic rotate: false xy: 1472, 960 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordSpeed +swordPoisonStatic rotate: false xy: 1536, 960 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordSpeed +swordPoisonStatic rotate: false xy: 1600, 960 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordSpeed +swordPoisonStatic rotate: false xy: 1664, 960 size: 64, 64 @@ -3685,107 +3685,121 @@ swordSpeed orig: 64, 64 offset: 0, 0 index: -1 -swordSpeedStatic +swordSpeed rotate: false xy: 896, 1024 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordSpeedStatic +swordSpeed rotate: false xy: 960, 1024 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordSpeedStatic +swordSpeed rotate: false xy: 1024, 1024 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordSpeedStatic +swordSpeed rotate: false xy: 1088, 1024 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -swordStatic +swordSpeed rotate: false xy: 1152, 1024 size: 64, 64 orig: 64, 64 offset: 0, 0 index: -1 -trident +swordSpeed rotate: false xy: 1216, 1024 - size: 80, 64 - orig: 80, 64 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 -trident +swordSpeed rotate: false - xy: 1296, 1024 - size: 80, 64 - orig: 80, 64 + xy: 1280, 1024 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 -trident +swordSpeed rotate: false - xy: 1376, 1024 - size: 80, 64 - orig: 80, 64 + xy: 1344, 1024 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 -trident +swordSpeedStatic rotate: false - xy: 1456, 1024 - size: 80, 64 - orig: 80, 64 + xy: 1408, 1024 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 -trident +swordSpeedStatic + rotate: false + xy: 1472, 1024 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +swordSpeedStatic rotate: false xy: 1536, 1024 - size: 80, 64 - orig: 80, 64 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 -trident +swordSpeedStatic rotate: false - xy: 1616, 1024 - size: 80, 64 - orig: 80, 64 + xy: 1600, 1024 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +swordStatic + rotate: false + xy: 1664, 1024 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 trident rotate: false - xy: 1696, 1024 + xy: 1728, 1024 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 trident rotate: false - xy: 1776, 1024 + xy: 1808, 1024 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 trident rotate: false - xy: 1856, 1024 + xy: 1888, 1024 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 trident rotate: false - xy: 1936, 1024 + xy: 1968, 1024 size: 80, 64 orig: 80, 64 offset: 0, 0 @@ -3804,42 +3818,42 @@ trident orig: 80, 64 offset: 0, 0 index: -1 -tridentDamage +trident rotate: false xy: 160, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentDamage +trident rotate: false xy: 240, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentDamage +trident rotate: false xy: 320, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentDamage +trident rotate: false xy: 400, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentDamage +trident rotate: false xy: 480, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentDamage +trident rotate: false xy: 560, 1088 size: 80, 64 @@ -3888,70 +3902,70 @@ tridentDamage orig: 80, 64 offset: 0, 0 index: -1 -tridentDamageStatic +tridentDamage rotate: false xy: 1120, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentDamageStatic +tridentDamage rotate: false xy: 1200, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentDamageStatic +tridentDamage rotate: false xy: 1280, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentDamageStatic +tridentDamage rotate: false xy: 1360, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentFire +tridentDamage rotate: false xy: 1440, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentFire +tridentDamage rotate: false xy: 1520, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentFire +tridentDamageStatic rotate: false xy: 1600, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentFire +tridentDamageStatic rotate: false xy: 1680, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentFire +tridentDamageStatic rotate: false xy: 1760, 1088 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentFire +tridentDamageStatic rotate: false xy: 1840, 1088 size: 80, 64 @@ -4000,70 +4014,70 @@ tridentFire orig: 80, 64 offset: 0, 0 index: -1 -tridentFireStatic +tridentFire rotate: false xy: 400, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentFireStatic +tridentFire rotate: false xy: 480, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentFireStatic +tridentFire rotate: false xy: 560, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentFireStatic +tridentFire rotate: false xy: 640, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentPoison +tridentFire rotate: false xy: 720, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentPoison +tridentFire rotate: false xy: 800, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentPoison +tridentFireStatic rotate: false xy: 880, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentPoison +tridentFireStatic rotate: false xy: 960, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentPoison +tridentFireStatic rotate: false xy: 1040, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentPoison +tridentFireStatic rotate: false xy: 1120, 1152 size: 80, 64 @@ -4112,77 +4126,77 @@ tridentPoison orig: 80, 64 offset: 0, 0 index: -1 -tridentPoisonStatic +tridentPoison rotate: false xy: 1680, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentPoisonStatic +tridentPoison rotate: false xy: 1760, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentPoisonStatic +tridentPoison rotate: false xy: 1840, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentPoisonStatic +tridentPoison rotate: false xy: 1920, 1152 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentPoisonStatic +tridentPoison rotate: false xy: 0, 1216 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentSpeed +tridentPoison rotate: false xy: 80, 1216 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentSpeed +tridentPoisonStatic rotate: false xy: 160, 1216 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentSpeed +tridentPoisonStatic rotate: false xy: 240, 1216 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentSpeed +tridentPoisonStatic rotate: false xy: 320, 1216 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentSpeed +tridentPoisonStatic rotate: false xy: 400, 1216 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentSpeed +tridentPoisonStatic rotate: false xy: 480, 1216 size: 80, 64 @@ -4231,38 +4245,80 @@ tridentSpeed orig: 80, 64 offset: 0, 0 index: -1 -tridentSpeedStatic +tridentSpeed rotate: false xy: 1040, 1216 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentSpeedStatic +tridentSpeed rotate: false xy: 1120, 1216 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentSpeedStatic +tridentSpeed rotate: false xy: 1200, 1216 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentSpeedStatic +tridentSpeed rotate: false xy: 1280, 1216 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 -tridentStatic +tridentSpeed rotate: false xy: 1360, 1216 size: 80, 64 orig: 80, 64 offset: 0, 0 index: -1 +tridentSpeed + rotate: false + xy: 1440, 1216 + size: 80, 64 + orig: 80, 64 + offset: 0, 0 + index: -1 +tridentSpeedStatic + rotate: false + xy: 1520, 1216 + size: 80, 64 + orig: 80, 64 + offset: 0, 0 + index: -1 +tridentSpeedStatic + rotate: false + xy: 1600, 1216 + size: 80, 64 + orig: 80, 64 + offset: 0, 0 + index: -1 +tridentSpeedStatic + rotate: false + xy: 1680, 1216 + size: 80, 64 + orig: 80, 64 + offset: 0, 0 + index: -1 +tridentSpeedStatic + rotate: false + xy: 1760, 1216 + size: 80, 64 + orig: 80, 64 + offset: 0, 0 + index: -1 +tridentStatic + rotate: false + xy: 1840, 1216 + size: 80, 64 + orig: 80, 64 + offset: 0, 0 + index: -1 diff --git a/source/core/assets/images/CombatItems/animations/combatItemsAnimation.png b/source/core/assets/images/CombatItems/animations/combatItemsAnimation.png index 47a75202b..182ba4dd1 100644 Binary files a/source/core/assets/images/CombatItems/animations/combatItemsAnimation.png and b/source/core/assets/images/CombatItems/animations/combatItemsAnimation.png differ diff --git a/source/core/assets/images/NPC/Dialogue/friendlycreaturedialogue2.png b/source/core/assets/images/NPC/Dialogue/friendlycreaturedialogue2.png new file mode 100644 index 000000000..b01eed767 Binary files /dev/null and b/source/core/assets/images/NPC/Dialogue/friendlycreaturedialogue2.png differ diff --git a/source/core/assets/images/NPC/Dialogue/humanguarddialogue2.png b/source/core/assets/images/NPC/Dialogue/humanguarddialogue2.png new file mode 100644 index 000000000..336355157 Binary files /dev/null and b/source/core/assets/images/NPC/Dialogue/humanguarddialogue2.png differ diff --git a/source/core/assets/images/NPC/Dialogue/plumberfriend2.png b/source/core/assets/images/NPC/Dialogue/plumberfriend2.png new file mode 100644 index 000000000..cdad3d6b9 Binary files /dev/null and b/source/core/assets/images/NPC/Dialogue/plumberfriend2.png differ diff --git a/source/core/assets/images/Skill_tree/skill tree background.png b/source/core/assets/images/Skill_tree/skill tree background.png new file mode 100644 index 000000000..ccea1d63f Binary files /dev/null and b/source/core/assets/images/Skill_tree/skill tree background.png differ diff --git a/source/core/assets/images/Skill_tree/skill_tree2.png b/source/core/assets/images/Skill_tree/skill_tree2.png new file mode 100644 index 000000000..5a9c21c57 Binary files /dev/null and b/source/core/assets/images/Skill_tree/skill_tree2.png differ diff --git a/source/core/assets/images/Skill_tree/skill_tree_2.png b/source/core/assets/images/Skill_tree/skill_tree_2.png index 5a9c21c57..b161b540f 100644 Binary files a/source/core/assets/images/Skill_tree/skill_tree_2.png and b/source/core/assets/images/Skill_tree/skill_tree_2.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/aoeTooltip.png b/source/core/assets/images/Skill_tree/tooltips/aoeTooltip.png new file mode 100644 index 000000000..bb5978009 Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/aoeTooltip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/bleedToolTip.png b/source/core/assets/images/Skill_tree/tooltips/bleedToolTip.png new file mode 100644 index 000000000..28d8ac169 Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/bleedToolTip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/blockTooltip.png b/source/core/assets/images/Skill_tree/tooltips/blockTooltip.png new file mode 100644 index 000000000..fdc427629 Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/blockTooltip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/chargeTooltip.png b/source/core/assets/images/Skill_tree/tooltips/chargeTooltip.png new file mode 100644 index 000000000..6165b5ed1 Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/chargeTooltip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/dashTooltip.png b/source/core/assets/images/Skill_tree/tooltips/dashTooltip.png new file mode 100644 index 000000000..0c8b73f14 Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/dashTooltip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/dialog box-speed.png b/source/core/assets/images/Skill_tree/tooltips/dialog box-speed.png new file mode 100644 index 000000000..f3df5ea6e Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/dialog box-speed.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/dodgeTooltip.png b/source/core/assets/images/Skill_tree/tooltips/dodgeTooltip.png new file mode 100644 index 000000000..a5089b01a Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/dodgeTooltip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/fireballUltimateTooltip.png b/source/core/assets/images/Skill_tree/tooltips/fireballUltimateTooltip.png new file mode 100644 index 000000000..e6155aacd Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/fireballUltimateTooltip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/invulnerabilityTooltip.png b/source/core/assets/images/Skill_tree/tooltips/invulnerabilityTooltip.png new file mode 100644 index 000000000..559d4b2a8 Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/invulnerabilityTooltip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/rootTooltip.png b/source/core/assets/images/Skill_tree/tooltips/rootTooltip.png new file mode 100644 index 000000000..c9b86eea2 Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/rootTooltip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/speedTooltip.png b/source/core/assets/images/Skill_tree/tooltips/speedTooltip.png new file mode 100644 index 000000000..f3df5ea6e Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/speedTooltip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/teleportTooltip.png b/source/core/assets/images/Skill_tree/tooltips/teleportTooltip.png new file mode 100644 index 000000000..3c4c65892 Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/teleportTooltip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/ultimateTooltip.png b/source/core/assets/images/Skill_tree/tooltips/ultimateTooltip.png new file mode 100644 index 000000000..0ae24449a Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/ultimateTooltip.png differ diff --git a/source/core/assets/images/Skill_tree/tooltips/wrenchProjectileTooltip.png b/source/core/assets/images/Skill_tree/tooltips/wrenchProjectileTooltip.png new file mode 100644 index 000000000..25289b3fc Binary files /dev/null and b/source/core/assets/images/Skill_tree/tooltips/wrenchProjectileTooltip.png differ diff --git a/source/core/assets/images/Skills/skill-tree-icon.png b/source/core/assets/images/Skills/skill-tree-icon.png index 2fb688bd2..b3828d743 100644 Binary files a/source/core/assets/images/Skills/skill-tree-icon.png and b/source/core/assets/images/Skills/skill-tree-icon.png differ diff --git a/source/core/assets/images/Skills/skillAnimations.atlas b/source/core/assets/images/Skills/skillAnimations.atlas index 03d431d14..d02bd23ad 100644 --- a/source/core/assets/images/Skills/skillAnimations.atlas +++ b/source/core/assets/images/Skills/skillAnimations.atlas @@ -1,621 +1,796 @@ -skillAnimations.png -size: 1024, 320 -format: RGBA8888 -filter: Linear,Linear -repeat: none -default - rotate: false - xy: 320, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -aoe - rotate: false - xy: 0, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -aoe - rotate: false - xy: 64, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -aoe - rotate: false - xy: 128, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -aoe - rotate: false - xy: 192, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -aoe - rotate: false - xy: 256, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -aoe - rotate: false - xy: 320, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -dash - rotate: false - xy: 384, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -dash - rotate: false - xy: 448, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -dash - rotate: false - xy: 512, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -dash - rotate: false - xy: 576, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -dodge - rotate: false - xy: 640, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -dodge - rotate: false - xy: 704, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -dodge - rotate: false - xy: 768, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -dodge - rotate: false - xy: 832, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -invulnerability - rotate: false - xy: 896, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -invulnerability - rotate: false - xy: 960, 0 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -invulnerability - rotate: false - xy: 0, 64 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -invulnerability - rotate: false - xy: 64, 64 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -invulnerability - rotate: false - xy: 128, 64 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -invulnerability - rotate: false - xy: 192, 64 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -invulnerability - rotate: false - xy: 256, 64 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -invulnerability - rotate: false - xy: 320, 64 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -attackSpeed - rotate: false - xy: 384, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 1 -attackSpeed - rotate: false - xy: 416, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 2 -attackSpeed - rotate: false - xy: 448, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 3 -attackSpeed - rotate: false - xy: 480, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 4 -attackSpeed - rotate: false - xy: 512, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 5 -attackSpeed - rotate: false - xy: 544, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 6 -attackSpeed - rotate: false - xy: 576, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 7 -attackSpeed - rotate: false - xy: 608, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 8 -attackSpeed - rotate: false - xy: 640, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 9 -attackSpeed - rotate: false - xy: 672, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 10 -attackSpeed - rotate: false - xy: 704, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 11 -attackSpeed - rotate: false - xy: 736, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 12 -attackSpeed - rotate: false - xy: 768, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 13 -attackSpeed - rotate: false - xy: 800, 64 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: 14 -block - rotate: false - xy: 832, 64 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -block - rotate: false - xy: 896, 64 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -block - rotate: false - xy: 960, 64 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -block - rotate: false - xy: 0, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -teleport - rotate: false - xy: 64, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -teleport - rotate: false - xy: 128, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -teleport - rotate: false - xy: 192, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -teleport - rotate: false - xy: 256, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -teleport - rotate: false - xy: 320, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -teleport - rotate: false - xy: 384, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -teleport - rotate: false - xy: 448, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -teleport - rotate: false - xy: 512, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 576, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 640, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 704, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 768, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 832, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 896, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 960, 128 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 0, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 64, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 128, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 192, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -fireballUltimate - rotate: false - xy: 256, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -no_animation - rotate: false - xy: 320, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 384, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 448, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 512, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 576, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 640, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 704, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 768, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 832, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 896, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 960, 192 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 0, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 64, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 128, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 192, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 256, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 320, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 384, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 448, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 512, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 576, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 640, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 704, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 768, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 832, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 896, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 -vendemaire - rotate: false - xy: 960, 256 - size: 64, 64 - orig: 64, 64 - offset: 0, 0 - index: -1 +skillAnimations.png +size: 1024, 441 +format: RGBA8888 +filter: Linear,Linear +repeat: none +default + rotate: false + xy: 128, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +arrow + rotate: false + xy: 0, 57 + size: 125, 64 + orig: 125, 64 + offset: 0, 0 + index: -1 +arrow + rotate: false + xy: 125, 57 + size: 125, 64 + orig: 125, 64 + offset: 0, 0 + index: -1 +arrow + rotate: false + xy: 250, 57 + size: 125, 64 + orig: 125, 64 + offset: 0, 0 + index: -1 +arrow + rotate: false + xy: 375, 57 + size: 125, 64 + orig: 125, 64 + offset: 0, 0 + index: -1 +bleed + rotate: false + xy: 500, 57 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +bleed + rotate: false + xy: 564, 57 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +bleed + rotate: false + xy: 628, 57 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +bleed + rotate: false + xy: 692, 57 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +bleed + rotate: false + xy: 756, 57 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +bleed + rotate: false + xy: 820, 57 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +charge + rotate: false + xy: 448, 0 + size: 64, 57 + orig: 64, 57 + offset: 0, 0 + index: -1 +charge + rotate: false + xy: 512, 0 + size: 64, 57 + orig: 64, 57 + offset: 0, 0 + index: -1 +charge + rotate: false + xy: 576, 0 + size: 64, 57 + orig: 64, 57 + offset: 0, 0 + index: -1 +charge + rotate: false + xy: 640, 0 + size: 64, 57 + orig: 64, 57 + offset: 0, 0 + index: -1 +chargemove + rotate: false + xy: 704, 0 + size: 64, 57 + orig: 64, 57 + offset: 0, 0 + index: -1 +chargemove + rotate: false + xy: 768, 0 + size: 64, 57 + orig: 64, 57 + offset: 0, 0 + index: -1 +chargemove + rotate: false + xy: 832, 0 + size: 64, 57 + orig: 64, 57 + offset: 0, 0 + index: -1 +chargemove + rotate: false + xy: 896, 0 + size: 64, 57 + orig: 64, 57 + offset: 0, 0 + index: -1 +chargemove + rotate: false + xy: 960, 0 + size: 64, 57 + orig: 64, 57 + offset: 0, 0 + index: -1 +aoe + rotate: false + xy: 884, 57 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +aoe + rotate: false + xy: 948, 57 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +aoe + rotate: false + xy: 0, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +aoe + rotate: false + xy: 64, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +aoe + rotate: false + xy: 128, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +aoe + rotate: false + xy: 192, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +dash + rotate: false + xy: 256, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +dash + rotate: false + xy: 320, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +dash + rotate: false + xy: 384, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +dash + rotate: false + xy: 448, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +dodge + rotate: false + xy: 512, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +dodge + rotate: false + xy: 576, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +dodge + rotate: false + xy: 640, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +dodge + rotate: false + xy: 704, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +invulnerability + rotate: false + xy: 768, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +invulnerability + rotate: false + xy: 832, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +invulnerability + rotate: false + xy: 896, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +invulnerability + rotate: false + xy: 960, 121 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +invulnerability + rotate: false + xy: 0, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +invulnerability + rotate: false + xy: 64, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +invulnerability + rotate: false + xy: 128, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +invulnerability + rotate: false + xy: 192, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +root + rotate: false + xy: 256, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +root + rotate: false + xy: 320, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +root + rotate: false + xy: 384, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +root + rotate: false + xy: 448, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +root + rotate: false + xy: 512, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +root + rotate: false + xy: 576, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +attackSpeed + rotate: false + xy: 0, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 1 +attackSpeed + rotate: false + xy: 32, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 2 +attackSpeed + rotate: false + xy: 64, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 3 +attackSpeed + rotate: false + xy: 96, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 4 +attackSpeed + rotate: false + xy: 128, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 5 +attackSpeed + rotate: false + xy: 160, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 6 +attackSpeed + rotate: false + xy: 192, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 7 +attackSpeed + rotate: false + xy: 224, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 8 +attackSpeed + rotate: false + xy: 256, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 9 +attackSpeed + rotate: false + xy: 288, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 10 +attackSpeed + rotate: false + xy: 320, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 11 +attackSpeed + rotate: false + xy: 352, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 12 +attackSpeed + rotate: false + xy: 384, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 13 +attackSpeed + rotate: false + xy: 416, 0 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: 14 +block + rotate: false + xy: 640, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +block + rotate: false + xy: 704, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +block + rotate: false + xy: 768, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +block + rotate: false + xy: 832, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +teleport + rotate: false + xy: 896, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +teleport + rotate: false + xy: 960, 185 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +teleport + rotate: false + xy: 0, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +teleport + rotate: false + xy: 64, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +teleport + rotate: false + xy: 128, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +teleport + rotate: false + xy: 192, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +teleport + rotate: false + xy: 256, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +teleport + rotate: false + xy: 320, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 384, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 640, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 704, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 768, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 832, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 896, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 960, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 0, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 64, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 448, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 512, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +fireballUltimate + rotate: false + xy: 576, 249 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +no_animation + rotate: false + xy: 128, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 192, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 896, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 384, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 448, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 512, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 576, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 640, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 704, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 768, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 256, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 320, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 384, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 448, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 512, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 576, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 640, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 704, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 768, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 832, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 960, 313 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 0, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 64, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 128, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 192, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 256, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +vendemaire + rotate: false + xy: 320, 377 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 diff --git a/source/core/assets/images/Skills/skillAnimations.png b/source/core/assets/images/Skills/skillAnimations.png index c8cf5886c..edecc27b9 100644 Binary files a/source/core/assets/images/Skills/skillAnimations.png and b/source/core/assets/images/Skills/skillAnimations.png differ diff --git a/source/core/assets/images/Skills/skillExitButton.png b/source/core/assets/images/Skills/skillExitButton.png new file mode 100644 index 000000000..6bb762664 Binary files /dev/null and b/source/core/assets/images/Skills/skillExitButton.png differ diff --git a/source/core/assets/images/Skills/skillExitButtonDown.png b/source/core/assets/images/Skills/skillExitButtonDown.png new file mode 100644 index 000000000..7b0a54247 Binary files /dev/null and b/source/core/assets/images/Skills/skillExitButtonDown.png differ diff --git a/source/core/assets/images/Skills/skillbar.png b/source/core/assets/images/Skills/skillbar.png new file mode 100644 index 000000000..a293892c5 Binary files /dev/null and b/source/core/assets/images/Skills/skillbar.png differ diff --git a/source/core/assets/images/level_1_tiledmap/minimap1.png b/source/core/assets/images/level_1_tiledmap/minimap1.png index bf3b75262..492e39ca8 100644 Binary files a/source/core/assets/images/level_1_tiledmap/minimap1.png and b/source/core/assets/images/level_1_tiledmap/minimap1.png differ diff --git a/source/core/assets/images/level_2_tiledmap/minimap2.png b/source/core/assets/images/level_2_tiledmap/minimap2.png index 854ae9015..0a5fdedbb 100644 Binary files a/source/core/assets/images/level_2_tiledmap/minimap2.png and b/source/core/assets/images/level_2_tiledmap/minimap2.png differ diff --git a/source/core/assets/sounds/Dialogue/ALONE.wav b/source/core/assets/sounds/Dialogue/ALONE.wav new file mode 100644 index 000000000..d0e111de0 Binary files /dev/null and b/source/core/assets/sounds/Dialogue/ALONE.wav differ diff --git a/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_1.wav b/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_1.wav new file mode 100644 index 000000000..15cdee17f Binary files /dev/null and b/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_1.wav differ diff --git a/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_2.wav b/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_2.wav new file mode 100644 index 000000000..f94e0c832 Binary files /dev/null and b/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_2.wav differ diff --git a/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_3.wav b/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_3.wav new file mode 100644 index 000000000..00e34c39c Binary files /dev/null and b/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_3.wav differ diff --git a/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_4.wav b/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_4.wav new file mode 100644 index 000000000..5ba1cd87c Binary files /dev/null and b/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_4.wav differ diff --git a/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_5.wav b/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_5.wav new file mode 100644 index 000000000..554c7a27c Binary files /dev/null and b/source/core/assets/sounds/Dialogue/FriendlyCreature/Line_5.wav differ diff --git a/source/core/assets/sounds/Dialogue/LEAVE.wav b/source/core/assets/sounds/Dialogue/LEAVE.wav new file mode 100644 index 000000000..b39f834c9 Binary files /dev/null and b/source/core/assets/sounds/Dialogue/LEAVE.wav differ diff --git a/source/core/assets/sounds/Dialogue/ME.wav b/source/core/assets/sounds/Dialogue/ME.wav new file mode 100644 index 000000000..6fdfced01 Binary files /dev/null and b/source/core/assets/sounds/Dialogue/ME.wav differ diff --git a/source/core/assets/sounds/Ora.mp3 b/source/core/assets/sounds/Ora.mp3 index b31c95336..133dbc5aa 100644 Binary files a/source/core/assets/sounds/Ora.mp3 and b/source/core/assets/sounds/Ora.mp3 differ diff --git a/source/core/assets/sounds/charge.mp3 b/source/core/assets/sounds/charge.mp3 new file mode 100644 index 000000000..776eabe81 Binary files /dev/null and b/source/core/assets/sounds/charge.mp3 differ diff --git a/source/core/src/main/com/deco2800/game/SkillsTree/SkillsTreeDisplay.java b/source/core/src/main/com/deco2800/game/SkillsTree/SkillsTreeDisplay.java index afe4245dd..ea3b5a229 100644 --- a/source/core/src/main/com/deco2800/game/SkillsTree/SkillsTreeDisplay.java +++ b/source/core/src/main/com/deco2800/game/SkillsTree/SkillsTreeDisplay.java @@ -1,21 +1,19 @@ package com.deco2800.game.SkillsTree; import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.ui.Image; import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; import com.badlogic.gdx.scenes.scene2d.ui.Table; -import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; +import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; import com.deco2800.game.components.player.*; import com.deco2800.game.entities.Entity; -import com.deco2800.game.entities.EntityService; import com.deco2800.game.services.ServiceLocator; import com.deco2800.game.ui.UIComponent; import org.slf4j.Logger; @@ -32,13 +30,17 @@ public class SkillsTreeDisplay extends UIComponent { private Table exitTable; private Table equipTable; private Image skillTreeImage; + private Image skillbarImage; private boolean skillTreeOpen = false; private ArrayList skillTreeIcons = new ArrayList<>(); + private Image activeTooltip; + private boolean toolTipDisplaying; private PlayerSkillComponent.SkillTypes skill1Type = PlayerSkillComponent.SkillTypes.NONE; private PlayerSkillComponent.SkillTypes skill2Type = PlayerSkillComponent.SkillTypes.NONE; private PlayerSkillComponent.SkillTypes skill3Type = PlayerSkillComponent.SkillTypes.NONE; + @Override public void create() { entity.getEvents().addListener("toggleSkillTree", this::toggleSkillTreeDisplay); @@ -71,10 +73,7 @@ private void addActors() { exitTable = new Table(); equipTable = new Table(); equipTable.bottom().left(); - Pixmap bgPixmap = new Pixmap(1,1, Pixmap.Format.RGB565); - bgPixmap.setColor(Color.TEAL); - bgPixmap.fill(); - TextureRegionDrawable textureRegionDrawableBg = new TextureRegionDrawable(new TextureRegion(new Texture(bgPixmap))); + TextureRegionDrawable textureRegionDrawableBg = new TextureRegionDrawable(new TextureRegion(new Texture("images/Skill_tree/skill tree background.png"))); skillTreeBackground.setBackground(textureRegionDrawableBg); exitTable.top().right(); exitTable.setFillParent(true); @@ -83,11 +82,20 @@ private void addActors() { skillTreeImage = new Image(new Texture(Gdx.files.internal("images/Skill_tree/skill_tree_2.png"))); skillTreeImage.setSize(850f, 850f); skillTreeImage.setPosition(250,0); - - - - TextButton mainMenuBtn = new TextButton("Exit", skin); - mainMenuBtn.addListener( + skillbarImage = new Image(new Texture("images/Skills/skillbar.png")); + skillbarImage.setSize(350,160); + skillbarImage.setPosition( 280, -45); + + + TextureRegionDrawable exitTextureUp = new TextureRegionDrawable(ServiceLocator.getResourceService() + .getAsset("images/Skills/skillExitButton.png", Texture.class)); + TextureRegionDrawable exitTextureDown = new TextureRegionDrawable(ServiceLocator.getResourceService() + .getAsset("images/Skills/skillExitButtonDown.png", Texture.class)); + ImageButton exitButton = new ImageButton(exitTextureUp); + ImageButton.ImageButtonStyle style = exitButton.getStyle(); + style.imageUp = exitTextureUp; + style.imageDown = exitTextureDown; + exitButton.addListener( new ChangeListener() { @Override public void changed(ChangeEvent changeEvent, Actor actor) { @@ -96,13 +104,14 @@ public void changed(ChangeEvent changeEvent, Actor actor) { } }); - exitTable.add(mainMenuBtn).padTop(10f).padRight(10f); + exitTable.add(exitButton).padTop(10f).padRight(10f); refreshEquippedSkillsUI(); stage.addActor(skillTreeBackground); stage.addActor(exitTable); stage.addActor(skillTreeImage); + stage.addActor(skillbarImage); stage.addActor(equipTable); addAllSkillsToTree(); } @@ -121,13 +130,13 @@ private void addAllSkillsToTree() { if (playerSkillPoints >= 0) { row1Lock = false; } - if (playerSkillPoints >= 0) { + if (playerSkillPoints >= 1) { row2Lock = false; } - if (playerSkillPoints >= 0) { + if (playerSkillPoints >= 3) { row3Lock = false; } - if (playerSkillPoints >= 0) { + if (playerSkillPoints >= 6) { row4Lock = false; } @@ -181,6 +190,11 @@ public void dispose() { skillTreeImage.remove(); } + if (skillbarImage != null) { + skillbarImage.clear(); + skillbarImage.remove(); + } + if (!skillTreeIcons.isEmpty()) { for (ImageButton button : skillTreeIcons) { button.clear(); @@ -258,51 +272,51 @@ private void addEquippedSkill(PlayerSkillComponent.SkillTypes skillType, int ski case NONE -> addEquipImage("blankSkillIcon"); case DASH -> { addEquipImage("dash"); - addCountdownTrigger("dashCountdown", skillNum); + addCountdownTrigger("dashCountdown", skillNum, 500); } case TELEPORT -> { addEquipImage("teleport"); - addCountdownTrigger("teleportCountdown", skillNum); + addCountdownTrigger("teleportCountdown", skillNum, 10000); } case BLOCK -> { addEquipImage("block"); - addCountdownTrigger("blockCountdown", skillNum); + addCountdownTrigger("blockCountdown", skillNum, 3000); } case DODGE -> { addEquipImage("dodge"); - addCountdownTrigger("dodgeCountdown", skillNum); + addCountdownTrigger("dodgeCountdown", skillNum, 3000); } case FIREBALLULTIMATE -> { addEquipImage("fireballUltimate"); - addCountdownTrigger("fireballCountdown", skillNum); + addCountdownTrigger("fireballCountdown", skillNum, 20000); } case ULTIMATE -> { addEquipImage("ultimate"); - addCountdownTrigger("ultimateCountdown", skillNum); + addCountdownTrigger("ultimateCountdown", skillNum, 20000); } case ROOT -> { addEquipImage("root"); - addCountdownTrigger("rootCountdown", skillNum); + addCountdownTrigger("rootCountdown", skillNum, 5000); } case AOE -> { addEquipImage("aoe"); - addCountdownTrigger("aoeCountdown", skillNum); + addCountdownTrigger("aoeCountdown", skillNum, 5000); } case PROJECTILE -> { addEquipImage("wrenchProjectile"); - addCountdownTrigger("wrenchCountdown", skillNum); + addCountdownTrigger("wrenchCountdown", skillNum, 5000); } case BLEED -> { addEquipImage("bleed"); - addCountdownTrigger("bleedCountdown", skillNum); + addCountdownTrigger("bleedCountdown", skillNum, 5000); } case CHARGE -> { addEquipImage("charge"); - addCountdownTrigger("chargeCountdown", skillNum); + addCountdownTrigger("chargeCountdown", skillNum, 10000); } case INVULNERABILITY -> { addEquipImage("invulnerability"); - addCountdownTrigger("invulnerabilityCountdown", skillNum); + addCountdownTrigger("invulnerabilityCountdown", skillNum, 10000); } } } @@ -319,9 +333,15 @@ private void addEquipImage(String imageName) { cooldownBar.addSkillIcon(new Image(new Texture(imagePath))); } - private void addCountdownTrigger(String listenerName, int skillNum) { + /** + * Adds a countdown trigger to the cooldown display. + * @param listenerName The name of the countdown controller listener + * @param skillNum the equipped skill number, 1 based and up to 3 equipped skills + * @param cooldownLength the length of the cooldown for the countdown visual display + */ + private void addCountdownTrigger(String listenerName, int skillNum, long cooldownLength) { Countdown countdownController = ServiceLocator.getGameArea().getPlayer().getComponent(Countdown.class); - countdownController.setCountdownTrigger(skillNum, listenerName); + countdownController.setCountdownTrigger(skillNum, listenerName, cooldownLength); } /** @@ -353,6 +373,7 @@ private void addSkillToTree(int skillNumber, String baseImageFileName, PlayerSki case 10 -> addSkillTreeButton(844, 344, imageFileName, skillType, disabled); case 11 -> addSkillTreeButton(781, 210, imageFileName, skillType, disabled); case 12 -> addSkillTreeButton(850, 210, imageFileName, skillType, disabled); + default -> addSkillTreeButton(0, 0, imageFileName, skillType, disabled); } } @@ -380,6 +401,18 @@ private void addSkillTreeButton(int xCoord, int yCoord, String imageFilePath, Pl @Override public void changed(ChangeEvent event, Actor actor) { equipSkill(skillType); + removeActiveTooltip(); + } + }); + button.addListener(new ClickListener() { + @Override + public void enter(InputEvent event, float x, float y, int pointer, Actor fromActor) { + addTooltipImage(imageFilePath, xCoord, yCoord); + } + + @Override + public void exit(InputEvent event, float x, float y, int pointer, Actor fromActor) { + removeActiveTooltip(); } }); } @@ -388,6 +421,35 @@ public void changed(ChangeEvent event, Actor actor) { skillTreeIcons.add(button); } + /** + * Adds tooltip image to skill tree icon. + * @param imageFilePath the name of the skill tree icon + * @param xCoord the x coordinates of the skill icon, taken directly from its placement on the skill tree + * @param yCoord the y coordinates of the skill icon, taken directly from its placement on the skill tree + */ + private void addTooltipImage(String imageFilePath, float xCoord, float yCoord) { + if (!this.toolTipDisplaying) { + this.toolTipDisplaying = true; + this.activeTooltip = new Image(new TextureRegionDrawable(ServiceLocator.getResourceService() + .getAsset("images/Skill_tree/tooltips/" + imageFilePath + "Tooltip.png", Texture.class))); + this.activeTooltip.setPosition(xCoord - SKILL_ICON_BUTTON_SIZE/2f , yCoord + SKILL_ICON_BUTTON_SIZE); + this.activeTooltip.setSize(SKILL_ICON_BUTTON_SIZE * 3f, SKILL_ICON_BUTTON_SIZE * 2f); + stage.addActor(this.activeTooltip); + } + + } + + /** + * Removes the active tooltip for a skill icon + */ + private void removeActiveTooltip() { + if (this.activeTooltip != null) { + this.activeTooltip.remove(); + this.activeTooltip = null; + this.toolTipDisplaying = false; + } + } + /** * Equips a skill of type from types in PlayerSkillComponent.SkillTypes * @param skillType, skill of types PlayerSkillComponent.SkillTypes @@ -423,12 +485,8 @@ private void equipSkill(PlayerSkillComponent.SkillTypes skillType) { * false otherwise */ private boolean isDuplicateSkillEquip(PlayerSkillComponent.SkillTypes skillType) { - if (skillType == skill1Type || skillType == skill2Type || skillType == skill3Type) { - return true; - } else { - return false; - } - } + return (skillType == skill1Type || skillType == skill2Type || skillType == skill3Type); + } } diff --git a/source/core/src/main/com/deco2800/game/areas/ForestGameArea.java b/source/core/src/main/com/deco2800/game/areas/ForestGameArea.java index 66f0bf867..84b0e4170 100644 --- a/source/core/src/main/com/deco2800/game/areas/ForestGameArea.java +++ b/source/core/src/main/com/deco2800/game/areas/ForestGameArea.java @@ -45,6 +45,7 @@ public class ForestGameArea extends GameArea { "images/Enemies/gym_bro.png", "images/Enemies/discus.png", "images/Armour-assets-sprint2/baseArmour.png", + "images/Armour-assets-sprint2/Dark_Armour.png", "images/Armour-assets-sprint2/slowDiamond.png", "images/Armour-assets-sprint2/damageReturner.png", "images/Armour-assets-sprint2/fastLeather.png", @@ -106,6 +107,10 @@ public class ForestGameArea extends GameArea { "images/countdown/3.png", "images/countdown/4.png", "images/countdown/5.png", + "images/countdown/6.png", "images/countdown/7.png", "images/countdown/8.png", "images/countdown/9.png", + "images/countdown/10.png", "images/countdown/11.png", "images/countdown/12.png", "images/countdown/13.png", + "images/countdown/14.png", "images/countdown/15.png", "images/countdown/16.png", "images/countdown/17.png", + "images/countdown/18.png", "images/countdown/19.png", "images/countdown/20.png", "images/CombatItems/animations/PlungerBow/plungerBowProjectile.png", "images/CombatItems/animations/BuffBounce/mapBounce.png", "images/CombatItems/animations/BuffAnimations/buff.png" @@ -200,13 +205,13 @@ public void create() { playMusic(); spawnSpeedPotion(); spawnHealthPotion(); - spawnStaminaPotion(); - spawnDefencePotion(); + //spawnStaminaPotion(); + //spawnDefencePotion(); spawnDumbbell(); - spawnArmour(ArmourFactory.ArmourType.slowDiamond, 90, 15); + spawnArmour(ArmourFactory.ArmourType.slowDiamond, 145, 146); spawnArmour(ArmourFactory.ArmourType.fastLeather, 90, 22); - spawnArmour(ArmourFactory.ArmourType.darkArmour, 90, 26); + //spawnArmour(ArmourFactory.ArmourType.darkArmour, 90, 26); spawnDmgBuff(); spawnFireBuff(); @@ -224,7 +229,7 @@ private void displayUI() { spawnEntity(ui); } - private void spawnTerrain() { + public void spawnTerrain() { // Background terrain terrain = terrainFactory.createTerrain(TerrainType.LEVEL_ONE); spawnEntity(new Entity().addComponent(terrain)); @@ -552,6 +557,26 @@ private void spawnPoisonBuff() { } } + /** + * These buffs were made specifically to help with unit tests and buffs + */ + + private void spawnTestBuffs() { + spawnEntityAt(AuraFactory.createFireBuff(), new GridPoint2(89, 10), true, false); + spawnEntityAt(AuraFactory.createPoisonBuff(),new GridPoint2(92, 10), true, false); + spawnEntityAt(AuraFactory.createWeaponSpeedBuff(), new GridPoint2(94, 10), true, false); + spawnEntityAt(AuraFactory.createWeaponDmgBuff(), new GridPoint2(96, 10), true, false); + } + + /** + * Spawn rock in a certain position. - Team 5 1map4all @LYB + */ +// private void spawnRock(int x, int y) { +// Entity rock = ObstacleFactory.createRock(); +// spawnEntityAt(rock, new GridPoint2(x, y), false, false); +// } + + /** * spawn an armour on the map based on the input armour type * @param armourType armourType of the armour to be spawned @@ -592,30 +617,62 @@ public void spawnCraftingTables() { private void spawnSpeedPotion() { Entity speedPotion = PotionFactory.createSpeedPotion(); itemsOnMap.add(speedPotion); - spawnEntityAt(speedPotion, new GridPoint2(90, 10), true, true); - Entity speedPotion2 = PotionFactory.createSpeedPotion(); - itemsOnMap.add(speedPotion2); - spawnEntityAt(speedPotion2, new GridPoint2(90, 8), true, true); + spawnEntityAt(speedPotion, new GridPoint2(90, 11), true, true); + + Entity speedPotion3 = PotionFactory.createSpeedPotion(); + itemsOnMap.add(speedPotion3); + spawnEntityAt(speedPotion3, new GridPoint2(34, 97), true, true); + + Entity speedPotion4 = PotionFactory.createSpeedPotion(); + itemsOnMap.add(speedPotion4); + spawnEntityAt(speedPotion4, new GridPoint2(145, 152), true, true); + + Entity speedPotion5 = PotionFactory.createSpeedPotion(); + itemsOnMap.add(speedPotion5); + spawnEntityAt(speedPotion5, new GridPoint2(90, 92), true, true); + + Entity speedPotion6 = PotionFactory.createSpeedPotion(); + itemsOnMap.add(speedPotion6); + spawnEntityAt(speedPotion6, new GridPoint2(120, 22), true, true); + + Entity speedPotion7 = PotionFactory.createSpeedPotion(); + itemsOnMap.add(speedPotion7); + spawnEntityAt(speedPotion7, new GridPoint2(150, 153), true, true); + + Entity speedPotion8 = PotionFactory.createSpeedPotion(); + itemsOnMap.add(speedPotion8); + spawnEntityAt(speedPotion8, new GridPoint2(175, 92), true, true); } private void spawnHealthPotion() { - Entity healthPotion = PotionFactory.createHealthPotion(); - itemsOnMap.add(healthPotion); - spawnEntityAt(healthPotion, new GridPoint2(93, 10), true, true); - } - private void spawnStaminaPotion() { - Entity healthPotion = PotionFactory.createStaminaPotion(); - itemsOnMap.add(healthPotion); - spawnEntityAt(healthPotion, new GridPoint2(93, 12), true, true); - } + Entity healthPotion2 = PotionFactory.createHealthPotion(); + itemsOnMap.add(healthPotion2); + spawnEntityAt(healthPotion2, new GridPoint2(100, 63), true, true); + + Entity healthPotion3 = PotionFactory.createHealthPotion(); + itemsOnMap.add(healthPotion3); + spawnEntityAt(healthPotion3, new GridPoint2(90, 113), true, true); - private void spawnDefencePotion() { - Entity healthPotion = PotionFactory.createDefencePotion(); - itemsOnMap.add(healthPotion); - spawnEntityAt(healthPotion, new GridPoint2(93, 10), true, true); + Entity healthPotion4 = PotionFactory.createHealthPotion(); + itemsOnMap.add(healthPotion4); + spawnEntityAt(healthPotion4, new GridPoint2(130, 143), true, true); + + Entity healthPotion5 = PotionFactory.createHealthPotion(); + itemsOnMap.add(healthPotion5); + spawnEntityAt(healthPotion5, new GridPoint2(150, 153), true, true); + + Entity healthPotion6 = PotionFactory.createHealthPotion(); + itemsOnMap.add(healthPotion6); + spawnEntityAt(healthPotion6, new GridPoint2(110, 159), true, true); + + Entity healthPotion7 = PotionFactory.createHealthPotion(); + itemsOnMap.add(healthPotion7); + spawnEntityAt(healthPotion7, new GridPoint2(175, 104), true, true); } + + /** * Spawns dumbbell entity into the game * Spawns x-pos 5 @@ -642,7 +699,7 @@ private void spawnHeraAndAthena() { * Spawns the player entity, with a skill and combat animator overlaid above the player. * @return the player entity */ - private Entity spawnPlayer() { + public Entity spawnPlayer() { Entity newPlayer = PlayerFactory.createPlayer(); Entity newSkillAnimator = PlayerFactory.createSkillAnimator(newPlayer); Entity newKeyPromptAnimator= PlayerFactory.createKeyPromptAnimator(newPlayer); @@ -746,7 +803,7 @@ public static Vector2 GridPointToVector(GridPoint2 position) { * Spawn child NPC in random position. - Team 7 all-mid-npc */ private void spawnChild() { - childPosition = new GridPoint2(93,13); + childPosition = new GridPoint2(33,95); childDialoguePosition = new GridPoint2(33, 96); Entity child = NPCFactory.createChild(player); @@ -766,8 +823,8 @@ public static GridPoint2 getChildPosition() { private void spawnHumanGuard() { - HumanGuardPosition = new GridPoint2(110, 41); - HumanGuardDialoguePosition = new GridPoint2(110, 42); + HumanGuardPosition = new GridPoint2(110, 34); + HumanGuardDialoguePosition = new GridPoint2(110, 35); Entity humanguard = NPCFactory.createHumanGuard(player); spawnEntityAt(humanguard, HumanGuardPosition, true, true); @@ -852,7 +909,7 @@ private void spawnGymBro() { * Spawn Heracles in a position. */ private Entity spawnHeracles() { - GridPoint2 position = new GridPoint2(174, 65); + GridPoint2 position = new GridPoint2(170, 50); Entity heraclesBoss = NPCFactory.createHeracles(player); areaEntities.add(heraclesBoss); spawnEntityAt(heraclesBoss, position, true, true); diff --git a/source/core/src/main/com/deco2800/game/areas/GameArea.java b/source/core/src/main/com/deco2800/game/areas/GameArea.java index 3c66e2869..025128179 100644 --- a/source/core/src/main/com/deco2800/game/areas/GameArea.java +++ b/source/core/src/main/com/deco2800/game/areas/GameArea.java @@ -75,6 +75,7 @@ protected void spawnEntityAt( } entity.setPosition(worldPos); + entity.setGridPosition(tilePos); spawnEntity(entity); } diff --git a/source/core/src/main/com/deco2800/game/areas/UndergroundGameArea.java b/source/core/src/main/com/deco2800/game/areas/UndergroundGameArea.java index 2bfa9461c..bc19a32c0 100644 --- a/source/core/src/main/com/deco2800/game/areas/UndergroundGameArea.java +++ b/source/core/src/main/com/deco2800/game/areas/UndergroundGameArea.java @@ -18,7 +18,7 @@ import com.deco2800.game.components.gamearea.GameAreaDisplay; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.deco2800.game.areas.ForestGameArea.*; +import com.deco2800.game.entities.factories.PotionFactory; import java.util.ArrayList; import java.util.List; @@ -26,7 +26,6 @@ import static com.deco2800.game.areas.ForestGameArea.GridPointToVector; - /** Underground area for the demo game with trees, a player, and some enemies. */ public class UndergroundGameArea extends GameArea { private static final Logger logger = LoggerFactory.getLogger(UndergroundGameArea.class); @@ -143,8 +142,21 @@ public class UndergroundGameArea extends GameArea { "images/countdown/3.png", "images/countdown/4.png", "images/countdown/5.png", + "images/countdown/6.png", + "images/countdown/7.png", "images/countdown/8.png", "images/countdown/9.png", + "images/countdown/10.png", "images/countdown/11.png", "images/countdown/12.png", "images/countdown/13.png", + "images/countdown/14.png", "images/countdown/15.png", "images/countdown/16.png", "images/countdown/17.png", + "images/countdown/18.png", "images/countdown/19.png", "images/countdown/20.png", "images/CombatItems/animations/BuffBounce/mapBounce.png", - "images/CombatItems/animations/BuffAnimations/buff.png" + "images/CombatItems/animations/BuffAnimations/buff.png", + "images/Potions/health_potion.png", + "images/Potions/defence_potion.png", + "images/Potions/agility_potion.png", + "images/Potions/swiftness_potion.png", + "images/Armour-assets-sprint2/Dark_Armour.png", + "images/Armour-assets-sprint2/baseArmour.png", + "images/Armour-assets-sprint2/Dark_Armour.png", + "images/Armour-assets-sprint2/damageReturner.png", }; @@ -155,12 +167,10 @@ public class UndergroundGameArea extends GameArea { "images/CombatItems/animations/combatItemsAnimation.atlas", "images/CombatItems/animations/PlungerBow/plungerBowProjectile.atlas", "images/Enemies/mega_poop.atlas", "images/Enemies/poop.atlas", "images/NPC/guard npc/npcguard.atlas" , - "images/NPC/friendly_creature npc/friendly_creature.atlas", "images/NPC/dialogue_indicator/dialogue.atlas", - "images/NPC/friendly_creature npc/friendly_creature.atlas", "images/CombatItems/animations/BuffBounce/mapBounce.atlas", - "images/CombatItems/animations/BuffAnimations/buff.atlas" - + "images/CombatItems/animations/BuffAnimations/buff.atlas", + "images/NPC/friendly_creature npc/friendly_creature.atlas", "images/NPC/dialogue_indicator/dialogue.atlas" }; private static final String[] undergroundSounds = {"sounds/Impact4.ogg", "sounds/plungerArrowSound.mp3", @@ -215,6 +225,10 @@ public void create() { spawnFireBuff(); spawnPoisonBuff(); spawnSpeedBuff(); + spawnStaminaPotion(); + spawnDefencePotion(); + spawnArmour(ArmourFactory.ArmourType.darkArmour, 38, 80); + spawnArmour(ArmourFactory.ArmourType.damageReturner, 35, 35); } /** @@ -610,6 +624,15 @@ private void spawnDmgBuff() { } } + /** + * spawn an armour on the map based on the input armour type + * @param armourType armourType of the armour to be spawned + */ + private void spawnArmour(ArmourFactory.ArmourType armourType, int x, int y) { + Entity armour = ArmourFactory.createArmour(armourType); + itemsOnMap.add(armour); + spawnEntityAt(armour, new GridPoint2( x,y), true, false); + } /* */ /** @@ -662,6 +685,58 @@ private void spawnPoisonBuff() { } } + private void spawnStaminaPotion() { + Entity staminaPotion = PotionFactory.createStaminaPotion(); + itemsOnMap.add(staminaPotion); + spawnEntityAt(staminaPotion, new GridPoint2(35, 39), true, true); + + Entity staminaPotion4 = PotionFactory.createStaminaPotion(); + itemsOnMap.add(staminaPotion4); + spawnEntityAt(staminaPotion4, new GridPoint2(54, 47), true, true); + + Entity staminaPotion5 = PotionFactory.createStaminaPotion(); + itemsOnMap.add(staminaPotion5); + spawnEntityAt(staminaPotion5, new GridPoint2(80, 48), true, true); + + Entity staminaPotion7 = PotionFactory.createStaminaPotion(); + itemsOnMap.add(staminaPotion7); + spawnEntityAt(staminaPotion7, new GridPoint2(52, 69), true, true); + + Entity staminaPotion8 = PotionFactory.createStaminaPotion(); + itemsOnMap.add(staminaPotion8); + spawnEntityAt(staminaPotion8, new GridPoint2(20, 90), true, true); + + Entity staminaPotion9 = PotionFactory.createStaminaPotion(); + itemsOnMap.add(staminaPotion9); + spawnEntityAt(staminaPotion9, new GridPoint2(38, 85), true, true); + } + + private void spawnDefencePotion() { + Entity defencePotion = PotionFactory.createDefencePotion(); + itemsOnMap.add(defencePotion); + spawnEntityAt(defencePotion, new GridPoint2(35, 12), true, true); + + Entity defencePotion1 = PotionFactory.createDefencePotion(); + itemsOnMap.add(defencePotion1); + spawnEntityAt(defencePotion, new GridPoint2(35, 55), true, true); + + Entity defencePotion2 = PotionFactory.createDefencePotion(); + itemsOnMap.add(defencePotion2); + spawnEntityAt(defencePotion2, new GridPoint2(17, 74), true, true); + + Entity defencePotion3 = PotionFactory.createDefencePotion(); + itemsOnMap.add(defencePotion3); + spawnEntityAt(defencePotion3, new GridPoint2(38, 90), true, true); + + Entity defencePotion4 = PotionFactory.createDefencePotion(); + itemsOnMap.add(defencePotion4); + spawnEntityAt(defencePotion4, new GridPoint2(29, 110), true, true); + + Entity defencePotion5 = PotionFactory.createDefencePotion(); + itemsOnMap.add(defencePotion5); + spawnEntityAt(defencePotion5, new GridPoint2(49, 108), true, true); + } + /** * Spawns the crafting table entity on the underground map */ @@ -744,8 +819,8 @@ public static GridPoint2 getGuardPosition() { private void spawnfriendlycreature() { - friendlycreaturePosition = new GridPoint2(35, 24); - friendlycreatureDialoguePosition = new GridPoint2(35, 25); + friendlycreaturePosition = new GridPoint2(34, 24); + friendlycreatureDialoguePosition = new GridPoint2(34, 25); Entity friendlycreature = NPCFactory.createFriendlyCreature(player); spawnEntityAt(friendlycreature, friendlycreaturePosition, true, true); @@ -796,6 +871,25 @@ public void spawnWeaponProjectile() { //TEAM 04 true, true); } + /** + * Spawns an AOE attack at the player entity's coordinates. + */ + public Entity spawnPlayerAOE() { + Entity newProjectile = ProjectileFactory.createPlayerAOE(player, 0); + spawnEntityAt(newProjectile, + new GridPoint2((int) player.getCenterPosition().x, (int) player.getCenterPosition().y), + true, true); + return newProjectile; + } + + public static void removeProjectileOnMap(Entity entityToRemove) { + entityToRemove.setEnabled(false); + Gdx.app.postRunnable(entityToRemove::dispose); + if (entityToRemove.getComponent(AnimationRenderComponent.class) != null) { + entityToRemove.getComponent(AnimationRenderComponent.class).stopAnimation(); + } + } + private void unloadAssets() { logger.debug("Unloading assets"); ResourceService resourceService = ServiceLocator.getResourceService(); @@ -839,4 +933,30 @@ public static void removeItemOnMap(Entity entityToRemove) { itemsOnMap.remove(entityToRemove); Gdx.app.postRunnable(() -> entityToRemove.dispose()); } + + /** + * Spawns a spray of projectiles at the player entity's coordinates. + */ + public void spawnPlayerProjectileSpray() { + double[] sprayAngles = {0,0.25,0.5,0.75,1,1.25,1.5,1.75}; + for (int i = 0; i < sprayAngles.length; ++i) { + Entity newProjectile = ProjectileFactory.createBasePlayerProjectile(player,sprayAngles[i]); + spawnEntityAt(newProjectile, + new GridPoint2((int) player.getCenterPosition().x, (int) player.getCenterPosition().y), + true, true); + } + } + + /** + * Spawns a spray of projectiles at the player entity's coordinates. + */ + public void spawnPlayerProjectileCone() { + double[] sprayAngles = {0,0.06,0.11,1.89,1.94}; + for (int i = 0; i < sprayAngles.length; ++i) { + Entity newProjectile = ProjectileFactory.createWrenchPlayerProjectile(player,sprayAngles[i]); + spawnEntityAt(newProjectile, + new GridPoint2((int) player.getCenterPosition().x, (int) player.getCenterPosition().y), + true, true); + } + } } diff --git a/source/core/src/main/com/deco2800/game/components/CombatStatsComponent.java b/source/core/src/main/com/deco2800/game/components/CombatStatsComponent.java index 8d2ba44ad..b52e72153 100644 --- a/source/core/src/main/com/deco2800/game/components/CombatStatsComponent.java +++ b/source/core/src/main/com/deco2800/game/components/CombatStatsComponent.java @@ -2,7 +2,7 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.math.Vector2; -import com.deco2800.game.components.combatitemsComponents.PhysicalWeaponStatsComponent; +import com.deco2800.game.components.combatitemscomponents.PhysicalWeaponStatsComponent; import com.deco2800.game.components.player.InventoryComponent; import com.deco2800.game.entities.Entity; @@ -35,7 +35,7 @@ public class CombatStatsComponent extends Component { private int baseAttack; private float damageReduction; private float damageReturn; - private Entity playerWeapon; + public Entity playerWeapon; @Override public void create(){ diff --git a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/AnimatedImage.java b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/AnimatedImage.java similarity index 92% rename from source/core/src/main/com/deco2800/game/components/combatitemsComponents/AnimatedImage.java rename to source/core/src/main/com/deco2800/game/components/combatitemscomponents/AnimatedImage.java index 67dfaa1fb..7e2771776 100644 --- a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/AnimatedImage.java +++ b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/AnimatedImage.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.badlogic.gdx.graphics.g2d.Animation; diff --git a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/AreaOfEffectStatsComponent.java b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/AreaOfEffectStatsComponent.java similarity index 94% rename from source/core/src/main/com/deco2800/game/components/combatitemsComponents/AreaOfEffectStatsComponent.java rename to source/core/src/main/com/deco2800/game/components/combatitemscomponents/AreaOfEffectStatsComponent.java index f60b70619..3a675b976 100644 --- a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/AreaOfEffectStatsComponent.java +++ b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/AreaOfEffectStatsComponent.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.deco2800.game.crafting.Materials; diff --git a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/AuraPickupComponent.java b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/AuraPickupComponent.java similarity index 87% rename from source/core/src/main/com/deco2800/game/components/combatitemsComponents/AuraPickupComponent.java rename to source/core/src/main/com/deco2800/game/components/combatitemscomponents/AuraPickupComponent.java index 6b4f192ab..9af13b73d 100644 --- a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/AuraPickupComponent.java +++ b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/AuraPickupComponent.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.physics.box2d.Fixture; @@ -42,15 +42,17 @@ private void pickUpAura(Fixture me, Fixture other) { //aura is only picked up if weapon equipped if (other == f) { Entity weapon; + //if there is weapon equipped, there are no current buffs and weapon is not golden plunger if ((weapon = ServiceLocator.getGameArea().getPlayer().getComponent(InventoryComponent.class).getEquipable(0)) != null - && ServiceLocator.getGameArea().getPlayer().getComponent(WeaponAuraManager.class).auraApplied == null) { //if there is weapon equipped and there are no current buffs + && ServiceLocator.getGameArea().getPlayer().getComponent(WeaponAuraManager.class).auraApplied == null + && (weapon.getComponent(PhysicalWeaponStatsComponent.class).getDescription().equals("goldenPlungerBow") != true)) { Entity entityOfComponent = getEntity(); Sound pickupSound = ServiceLocator.getResourceService().getAsset("sounds/buffPickupSound.wav", Sound.class); pickupSound.play(); - if (ServiceLocator.getGameArea() instanceof ForestGameArea forestgamearea) { + if (ServiceLocator.getGameArea() instanceof ForestGameArea) { ForestGameArea.removeAuraOnMap(entityOfComponent); } - else if (ServiceLocator.getGameArea() instanceof UndergroundGameArea undergroundgamearea){ + else if (ServiceLocator.getGameArea() instanceof UndergroundGameArea){ UndergroundGameArea.removeAuraOnMap(entityOfComponent); } logger.info("Aura picked up"); diff --git a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/BuffDisplayComponent.java b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/BuffDisplayComponent.java similarity index 97% rename from source/core/src/main/com/deco2800/game/components/combatitemsComponents/BuffDisplayComponent.java rename to source/core/src/main/com/deco2800/game/components/combatitemscomponents/BuffDisplayComponent.java index 22fb95bd8..7de2c4bd8 100644 --- a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/BuffDisplayComponent.java +++ b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/BuffDisplayComponent.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.graphics.g2d.SpriteBatch; diff --git a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/PhysicalWeaponStatsComponent.java b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/PhysicalWeaponStatsComponent.java similarity index 96% rename from source/core/src/main/com/deco2800/game/components/combatitemsComponents/PhysicalWeaponStatsComponent.java rename to source/core/src/main/com/deco2800/game/components/combatitemscomponents/PhysicalWeaponStatsComponent.java index 817f1cc16..5cc0bef8f 100644 --- a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/PhysicalWeaponStatsComponent.java +++ b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/PhysicalWeaponStatsComponent.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.deco2800.game.crafting.Materials; diff --git a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponArrowProjectileComponent.java b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponArrowProjectileComponent.java similarity index 97% rename from source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponArrowProjectileComponent.java rename to source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponArrowProjectileComponent.java index 9d6067c3f..fc19f96dc 100644 --- a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponArrowProjectileComponent.java +++ b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponArrowProjectileComponent.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.math.Vector2; diff --git a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponAuraComponent.java b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponAuraComponent.java similarity index 95% rename from source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponAuraComponent.java rename to source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponAuraComponent.java index 2e82e2aeb..deea705e6 100644 --- a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponAuraComponent.java +++ b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponAuraComponent.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.deco2800.game.components.Component; diff --git a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponAuraManager.java b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponAuraManager.java similarity index 98% rename from source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponAuraManager.java rename to source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponAuraManager.java index 4847961b6..b3bcb62ca 100644 --- a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponAuraManager.java +++ b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponAuraManager.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.deco2800.game.components.Component; import com.deco2800.game.components.player.InventoryComponent; diff --git a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponStatsComponent.java b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponStatsComponent.java similarity index 97% rename from source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponStatsComponent.java rename to source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponStatsComponent.java index 7c995e611..c93acded3 100644 --- a/source/core/src/main/com/deco2800/game/components/combatitemsComponents/WeaponStatsComponent.java +++ b/source/core/src/main/com/deco2800/game/components/combatitemscomponents/WeaponStatsComponent.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.deco2800.game.components.Component; import com.deco2800.game.crafting.Materials; diff --git a/source/core/src/main/com/deco2800/game/components/gamearea/GameAreaDisplay.java b/source/core/src/main/com/deco2800/game/components/gamearea/GameAreaDisplay.java index 0b25aa700..a65a55400 100644 --- a/source/core/src/main/com/deco2800/game/components/gamearea/GameAreaDisplay.java +++ b/source/core/src/main/com/deco2800/game/components/gamearea/GameAreaDisplay.java @@ -25,7 +25,7 @@ import com.deco2800.game.crafting.Materials; import com.deco2800.game.entities.Entity; import com.deco2800.game.entities.EntityService; -import com.deco2800.game.entities.configs.combatitemsConfig.WeaponConfig; +import com.deco2800.game.entities.configs.combatitemsconfig.WeaponConfig; import com.deco2800.game.entities.factories.*; import com.deco2800.game.rendering.TextureRenderComponent; import com.deco2800.game.services.ServiceLocator; @@ -101,6 +101,8 @@ public class GameAreaDisplay extends UIComponent { private Group inventoryGroup = new Group(); private Group itemButtonGroup = new Group(); private Group dropdownGroup = new Group(); + + public Image minimapImage; private Group minimapGroup = new Group(); private Boolean currentScreenCrafting = false; @@ -133,13 +135,12 @@ private void addActors() { } public void displayMinimap() { - GameArea gameArea = ServiceLocator.getGameArea(); - Image minimapImage; - logger.info(String.format("Displaying minimap, area is %s", gameArea.getClass().getSimpleName())); - if (gameArea.getClass().getSimpleName().equals(ForestGameArea.class.getSimpleName())) { + //GameArea gameArea = ServiceLocator.getGameArea(); + logger.info(String.format("Displaying minimap, area is %s", gameAreaName)); + if (gameLevel == 1) { minimapImage = new Image(new Texture(Gdx.files.internal ("images/level_1_tiledmap/minimap1.png"))); - } else if (gameArea.getClass().getSimpleName().equals(UndergroundGameArea.class.getSimpleName())) { + } else if (gameLevel == 2) { minimapImage = new Image(new Texture(Gdx.files.internal ("images/level_2_tiledmap/minimap2.png"))); } else { @@ -148,7 +149,7 @@ public void displayMinimap() { } //Note: the position of the asset is at the bottom left. - minimapImage.setSize(800, 977); + minimapImage.setSize(800, 800); minimapImage.setPosition(Math.round((double)Gdx.graphics.getWidth() / 2 - minimapImage.getWidth() / 2), Math.round((double)Gdx.graphics.getHeight() / 2 - minimapImage.getHeight() / 2)); minimapGroup.addActor(minimapImage); @@ -373,6 +374,7 @@ public void disposeInventoryMenu() { * and creates button event handlers to test for user clicks. */ public void openCraftingMenu() { + KeyboardPlayerInputComponent.setCurrentMenu(true, KeyboardPlayerInputComponent.MenuTypes.CRAFTING); logger.info("Opening Crafting Menu"); inventoryComponent = ServiceLocator.getGameArea().getPlayer().getComponent(InventoryComponent.class); craftMenu = new Image(new Texture(Gdx.files.internal(String.format("images/Crafting-assets-sprint1/" + diff --git a/source/core/src/main/com/deco2800/game/components/npc/DialogueDisplay.java b/source/core/src/main/com/deco2800/game/components/npc/DialogueDisplay.java index 6821487f6..17d129afc 100644 --- a/source/core/src/main/com/deco2800/game/components/npc/DialogueDisplay.java +++ b/source/core/src/main/com/deco2800/game/components/npc/DialogueDisplay.java @@ -58,12 +58,12 @@ public class DialogueDisplay extends UIComponent { private final HashMap dialogueMap = new HashMap() { { put(0, "images/NPC/Dialogue/dialoguesboxfemale2.png"); - put(1, "images/NPC/Dialogue/dialoguesboxchild.png"); - put(2, "images/NPC/Dialogue/dialoguesboxguard.png"); - put(3, "images/NPC/Dialogue/dialoguesboxmale.png"); - put(4, "images/NPC/Dialogue/HumanGuardDialogue.png"); - put(5, "images/NPC/Dialogue/FriendlyCreatureDialogue.png"); - put(6, "images/NPC/Dialogue/PlumberFriend.png"); + put(1, "images/NPC/Dialogue/dialoguesboxchild2.png"); + put(2, "images/NPC/Dialogue/dialoguesboxguard2.png"); + put(3, "images/NPC/Dialogue/dialoguesboxmale2.png"); + put(4, "images/NPC/Dialogue/humanguarddialogue2.png"); + put(5, "images/NPC/Dialogue/friendlycreaturedialogue2.png"); + put(6, "images/NPC/Dialogue/plumberfriend2.png"); } }; static int countFemale = 0; @@ -73,10 +73,10 @@ public class DialogueDisplay extends UIComponent { static int countHumanGuard = 0; static int countHumanGuardAlready = 0; + static int countPlumberFriendAlready = 0; static int countFriendlyCreature = 0; static int countFriendlyCreatureAlready = 0; static int countPlumberFriend = 0; - static int countPlumberFriendAlready; public static Table dialogueContainerFemale; public static Table dialogueContainerGuard; public static Table dialogueContainerMale; @@ -90,12 +90,12 @@ public class DialogueDisplay extends UIComponent { public static TextArea textAreaChild; public static TextArea textAreaHumanGuard; public static TextArea textAreaHumanGuardAlready; + public static TextArea textAreaPlumberFriendAlready; public static TextArea textAreaFriendlyCreature; public static TextArea textAreaFriendlyCreatureAlready; public static TextArea textAreaPlumberFriend; - public static TextArea textAreaPlumberFriendAlready; public static Boolean state = false; - public static TextButton childButton = new TextButton("yes", skin); + TextButton startButton = new TextButton("Start", skin); public int haveTalked = 0; public int haveTalkedPlumberFriend = 0; public int haveTalkedFriendlyCreature = 0; @@ -107,13 +107,14 @@ public class DialogueDisplay extends UIComponent { "" }; public static String[] textGuard = { - "Guard\n", + "Guard: \n", "Have you seen anyone suspicious? ", "No? Okay then...", "Would you mind telling me your name?", "Hmm...okay", "A bit strange for a plumber to be", "roaming around right now..", + "" }; public static String[] textMale = { @@ -124,67 +125,68 @@ public class DialogueDisplay extends UIComponent { "" }; public static String[] textChild = { - "child\n", + "Child: \n", "Hello…Rabbit says he has not seen you around before\n", "Your..hands..they are stained…brown\n", "I know someone who can help you \n", "You might want to speak to crocodile, they live in the drains of the city\n", - "5", - "6", - "7" + "" }; - public static String[] textHumanGuard = { - "George", + "George: \n", "Oh good, you are here!", "My hands are a bit full right now", "Would you mind holding onto this for me?", - "There was a special mission today… Wait…", - "….Mission…I can’t remember what it was", + "There was a special mission today... Wait...", + "...Mission...I can't remember what it was", "" }; public static String[] textHumanGuardAlready = { - "1", - "2", - "3", - "4" + "Why are you still here?", + "LEAVE", + "ME", + "ALONE", + "" + }; + + public static String[] textPlumberFriendAlready = { + "Why are you still here?", + "LEAVE", + "ME", + "ALONE", + "" }; public static String[] textFriendlyCreature = { - "FriendlyCreature\n", - "1", - "2", - "3", - "4" + "FriendlyCreature: \n", + "Hm? Why the hell did u come here?", + "Didn't I say never to come here again??!!!", + "Whatever... sing me a song and I will give you something good", + "As expected... anyway, a promise is a promise. Here, the legendary toilet paper.", + "Now, LEAVE ME ALONE!!!", }; public static String[] textFriendlyCreatureAlready = { - "afdesdf", - "aefaef", - "feafaef", - "faefae" + "Why are you still here?", + "LEAVE", + "ME", + "ALONE", + "" }; public static String[] textPlumberFriend = { - "PlumberFriend\n", + "PlumberFriend: \n", "Hey! I have not seen you in forever.", "Are you still going ahead with your plan?", - "What do you mean ‘what plan’?", + "What do you mean 'what plan'?", "You were gonna sink Atlantis", "Me? Come with you?", - "Hmm…maybe it’s best I don’t go..", - "Instead I’ll help by keeping you out of any suspicions", + "Hmm...maybe it's best I don't go...", + "Instead I'll help by keeping you out of any suspicions", "Also I found some poop after fixing a toilet", - "I don’t have any use for it so you can have it.", + "I don't have any use for it so you can have it.", "" }; - public static String[] textPlumberFriendAlready = { - "1", - "2", - "3", - "4" - }; - @Override public void create() { //initialize the dialogue container for each NPCs @@ -206,67 +208,69 @@ public void create() { // initialize the dialogue image for each NPCs dialogueImagefemale = new Image(ServiceLocator.getResourceService() .getAsset(dialogueMap.get(dialogueImageFemale), Texture.class)); - dialogueImagefemale.setPosition(220,0); + dialogueImagefemale.setPosition((Gdx.graphics.getWidth()/2) - (dialogueImagefemale.getWidth()/2), 0); dialogueimageguard = new Image(ServiceLocator.getResourceService() .getAsset(dialogueMap.get(dialogueImageGuard), Texture.class)); - dialogueimageguard.setPosition(500,20); + dialogueimageguard.setPosition((Gdx.graphics.getWidth()/2) - (dialogueimageguard.getWidth()/2),0); dialogueimagemale = new Image(ServiceLocator.getResourceService() .getAsset(dialogueMap.get(dialogueImageMale), Texture.class)); - dialogueimagemale.setPosition(500,20); + dialogueimagemale.setPosition((Gdx.graphics.getWidth()/2) - (dialogueimagemale.getWidth()/2),0); dialogueimgchild = new Image(ServiceLocator.getResourceService() .getAsset(dialogueMap.get(dialogueImageChild), Texture.class)); - dialogueimgchild.setPosition(500,20); + dialogueimgchild.setPosition((Gdx.graphics.getWidth()/2) - (dialogueimgchild.getWidth()/2),0); dialogueimagehumanguard = new Image(ServiceLocator.getResourceService() .getAsset(dialogueMap.get(dialogueImageHumanGuard), Texture.class)); - dialogueimagehumanguard.setPosition(500,20); + dialogueimagehumanguard.setPosition((Gdx.graphics.getWidth()/2) - (dialogueimagehumanguard.getWidth()/2),0); dialogueimagefriendlycreature = new Image(ServiceLocator.getResourceService() .getAsset(dialogueMap.get(dialogueImageFriendlyCreature), Texture.class)); - dialogueimagefriendlycreature.setPosition(500,20); + dialogueimagefriendlycreature.setPosition((Gdx.graphics.getWidth()/2) - (dialogueimagefriendlycreature.getWidth()/2),0); dialogueimageplumberfriend = new Image(ServiceLocator.getResourceService() .getAsset(dialogueMap.get(dialogueImagePlumberFriend), Texture.class)); - dialogueimageplumberfriend.setPosition(500,20); + //dialogueimageplumberfriend.setPosition(220,0); + dialogueimageplumberfriend.setPosition((Gdx.graphics.getWidth()/2) - (dialogueimageplumberfriend.getWidth()/2),0); // initialize the text area for each NPCs - textAreaFemale = new TextArea(textFemale[countFemale], skin); - textAreaFemale.setWidth(480); + textAreaFemale = new TextArea(textFemale[countFemale], skin, "female"); + textAreaFemale.setWidth(700); textAreaFemale.setHeight(70); - textAreaFemale.setPosition(500,20); - textAreaGuard = new TextArea(textGuard[countGuard], skin); - textAreaGuard.setWidth(480); + textAreaFemale.setPosition((Gdx.graphics.getWidth()/2) - (textAreaFemale.getWidth()/2),29); + textAreaGuard = new TextArea(textGuard[countGuard], skin, "guard"); + textAreaGuard.setWidth(700); textAreaGuard.setHeight(70); - textAreaGuard.setPosition(500,20); - textAreaMale = new TextArea(textMale[countMale], skin); - textAreaMale.setWidth(480); + textAreaGuard.setPosition((Gdx.graphics.getWidth()/2) - (textAreaGuard.getWidth()/2),29); + textAreaMale = new TextArea(textMale[countMale], skin, "male"); + textAreaMale.setWidth(700); textAreaMale.setHeight(70); - textAreaMale.setPosition(500,20); - textAreaChild = new TextArea(textChild[countChild], skin); - textAreaChild.setWidth(480); + textAreaMale.setPosition((Gdx.graphics.getWidth()/2) - (textAreaMale.getWidth()/2),29); + textAreaChild = new TextArea(textChild[countChild], skin, "child"); + textAreaChild.setWidth(700); textAreaChild.setHeight(70); - textAreaChild.setPosition(500,20); - textAreaHumanGuard = new TextArea(textHumanGuard[countHumanGuard], skin); - textAreaHumanGuard.setWidth(480); + textAreaChild.setPosition((Gdx.graphics.getWidth()/2) - (textAreaChild.getWidth()/2),29); + textAreaHumanGuard = new TextArea(textHumanGuard[countHumanGuard], skin, "humanguard"); + textAreaHumanGuard.setWidth(700); textAreaHumanGuard.setHeight(70); - textAreaHumanGuard.setPosition(500,20); - textAreaHumanGuardAlready = new TextArea(textHumanGuardAlready[countHumanGuardAlready], skin); - textAreaHumanGuardAlready.setWidth(480); + textAreaHumanGuard.setPosition((Gdx.graphics.getWidth()/2) - (textAreaHumanGuard.getWidth()/2),29); + textAreaHumanGuardAlready = new TextArea(textHumanGuardAlready[countHumanGuardAlready], skin, "humanguard"); + textAreaHumanGuardAlready.setWidth(700); textAreaHumanGuardAlready.setHeight(70); - textAreaHumanGuardAlready.setPosition(500,20); - textAreaFriendlyCreature = new TextArea(textFriendlyCreature[countFriendlyCreature], skin); - textAreaFriendlyCreature.setWidth(480); - textAreaFriendlyCreature.setHeight(70); - textAreaFriendlyCreature.setPosition(500,20); - textAreaFriendlyCreatureAlready = new TextArea(textFriendlyCreatureAlready[countFriendlyCreatureAlready], skin); - textAreaFriendlyCreatureAlready.setWidth(480); - textAreaFriendlyCreatureAlready.setHeight(70); - textAreaFriendlyCreatureAlready.setPosition(500,20); - textAreaPlumberFriend = new TextArea(textPlumberFriend[countPlumberFriend], skin); - textAreaPlumberFriend.setWidth(480); - textAreaPlumberFriend.setHeight(70); - textAreaPlumberFriend.setPosition(500,20); - textAreaPlumberFriendAlready = new TextArea(textPlumberFriendAlready[countPlumberFriendAlready], skin); - textAreaPlumberFriendAlready.setWidth(480); - textAreaPlumberFriendAlready.setHeight(70); - textAreaPlumberFriendAlready.setPosition(500,20); + textAreaHumanGuardAlready.setPosition((Gdx.graphics.getWidth()/2) - (textAreaHumanGuardAlready.getWidth()/2),29); + textAreaFriendlyCreature = new TextArea(textFriendlyCreature[countFriendlyCreature], skin, "friendlycreature"); + textAreaFriendlyCreature.setWidth(700); + textAreaFriendlyCreature.setHeight(88); + textAreaFriendlyCreature.setPosition((Gdx.graphics.getWidth()/2) - (textAreaFriendlyCreature.getWidth()/2),29); + textAreaFriendlyCreatureAlready = new TextArea(textFriendlyCreatureAlready[countFriendlyCreatureAlready], skin, "friendlycreature"); + textAreaFriendlyCreatureAlready.setWidth(700); + textAreaFriendlyCreatureAlready.setHeight(88); + textAreaFriendlyCreatureAlready.setPosition((Gdx.graphics.getWidth()/2) - (textAreaFriendlyCreatureAlready.getWidth()/2),29); + textAreaPlumberFriend = new TextArea(textPlumberFriend[countPlumberFriend], skin, "plumberfriend"); + textAreaPlumberFriend.setWidth(700); + textAreaPlumberFriend.setHeight(63); + textAreaPlumberFriend.setPosition((Gdx.graphics.getWidth()/2) - (textAreaPlumberFriend.getWidth()/2),29); + textAreaPlumberFriendAlready = new TextArea(textPlumberFriendAlready[countPlumberFriendAlready], skin, "plumberfriend"); + textAreaPlumberFriendAlready.setWidth(700); + textAreaPlumberFriendAlready.setHeight(63); + //textAreaPlumberFriendAlready.setPosition(240,29); + textAreaPlumberFriendAlready.setPosition((Gdx.graphics.getWidth()/2) - (textAreaPlumberFriend.getWidth()/2), 29); // add dialogue image and dialogue text area to the container dialogueContainerFemale.addActor(dialogueImagefemale); @@ -294,10 +298,10 @@ public void nextText() { if ((oneLegGirlPosition) != null && entity.getCenterPosition().dst(GridPointToVector(oneLegGirlPosition)) < 1.5) { logger.info("new text loaded"); countFemale++; - textAreaFemale = new TextArea(textFemale[countFemale], skin); - textAreaFemale.setWidth(480); + textAreaFemale = new TextArea(textFemale[countFemale], skin, "female"); + textAreaFemale.setWidth(700); textAreaFemale.setHeight(50); - textAreaFemale.setPosition(500,20); + textAreaFemale.setPosition((Gdx.graphics.getWidth()/2) - (textAreaFemale.getWidth()/2),29); dialogueContainerFemale.addActor(textAreaFemale); if (countFemale == textFemale.length - 1) { countFemale = 0; @@ -318,10 +322,10 @@ public void nextText() { } else if ((GuardPosition) != null && entity.getCenterPosition().dst(GridPointToVector(GuardPosition)) < 1.5) { logger.info("new text loaded"); countGuard++; - textAreaGuard = new TextArea(textGuard[countGuard], skin); - textAreaGuard.setWidth(480); + textAreaGuard = new TextArea(textGuard[countGuard], skin, "guard"); + textAreaGuard.setWidth(700); textAreaGuard.setHeight(50); - textAreaGuard.setPosition(500,20); + textAreaGuard.setPosition((Gdx.graphics.getWidth()/2) - (textAreaGuard.getWidth()/2),29); dialogueContainerGuard.addActor(textAreaGuard); if (countGuard == textGuard.length - 1) { @@ -331,32 +335,36 @@ public void nextText() { } else if (countGuard == 1) { logger.info("Guard1 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/GuardLines/Guard Audio 1.wav")); + music.setVolume(0.3f); music.play(); } else if (countGuard == 2) { logger.info("Guard2 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/GuardLines/Guard Audio 2.wav")); + music.setVolume(0.3f); music.play(); } else if (countGuard == 3) { logger.info("Guard3 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/GuardLines/Guard Audio 3.wav")); + music.setVolume(0.3f); music.play(); } else if (countGuard == 4) { logger.info("Guard4 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/GuardLines/Guard Audio 4.wav")); + music.setVolume(0.3f); music.play(); } else if (countGuard == 5) { logger.info("Guard5 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Guard Audio 5.wav")); - + music.setVolume(0.3f); music.play(); } } else if ((maleCitizenPosition) != null && entity.getCenterPosition().dst(GridPointToVector(maleCitizenPosition)) < 1.5) { logger.info("new text loaded"); countMale++; - textAreaMale = new TextArea(textMale[countMale], skin); - textAreaMale.setWidth(480); + textAreaMale = new TextArea(textMale[countMale], skin, "male"); + textAreaMale.setWidth(700); textAreaMale.setHeight(50); - textAreaMale.setPosition(500,20); + textAreaMale.setPosition((Gdx.graphics.getWidth()/2) - (textAreaMale.getWidth()/2),29); dialogueContainerMale.addActor(textAreaMale); if (countMale == textMale.length - 1) { countMale = 0; @@ -364,23 +372,26 @@ public void nextText() { } else if (countMale == 1) { logger.info("Male1 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Male Citizen Audio/Male Citizen 1.wav")); + music.setVolume(0.3f); music.play(); } else if (countMale == 2) { logger.info("Male2 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Male Citizen Audio/Male Citizen 2.wav")); + music.setVolume(0.3f); music.play(); } else if (countMale == 3) { logger.info("Male3 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Male Citizen Audio/Male Citizen 3.wav")); + music.setVolume(0.3f); music.play(); } } else if ((childPosition) != null && entity.getCenterPosition().dst(GridPointToVector(childPosition)) < 1.5) { logger.info("new text loaded"); countChild++; - textAreaChild = new TextArea(textChild[countChild], skin); - textAreaChild.setWidth(480); + textAreaChild = new TextArea(textChild[countChild], skin, "child"); + textAreaChild.setWidth(700); textAreaChild.setHeight(50); - textAreaChild.setPosition(500,20); + textAreaChild.setPosition((Gdx.graphics.getWidth()/2) - (textAreaChild.getWidth()/2),29); dialogueContainerChild.addActor(textAreaChild); if (countChild == textChild.length - 1) { countChild = 0; @@ -397,46 +408,16 @@ public void nextText() { } else if (countChild == 4) { Sound sound = Gdx.audio.newSound(Gdx.files.internal("sounds/Dialogue/ChildLines/ChildLine13.wav")); sound.play(1.0f); - } else if (countChild == 5) { - dialogueContainerChild.removeActor(childButton); - TextButton startButton = new TextButton("Start", skin); - dialogueContainerChild.addActor(startButton); - startButton.addListener(new ClickListener() { - @Override - public void clicked(InputEvent event, float x, float y) { - AudioRecorder recorder = Gdx.audio.newAudioRecorder(44100,true); - short[] audioBuffer = new short[44100 * 5]; - recorder.read(audioBuffer, 0, audioBuffer.length); - - AudioDevice audioDevice = Gdx.audio.newAudioDevice(44100, true); - audioDevice.writeSamples(audioBuffer, 0, audioBuffer.length); - System.out.println(Arrays.toString(audioBuffer)); - recorder.dispose(); - audioDevice.dispose(); - }; - }); - - - } else if (countChild == 6) { - dialogueContainerChild.addActor(childButton); - childButton.addListener( new ClickListener() { - @Override - public void clicked(InputEvent event, float x, float y) { - Sound sound = Gdx.audio.newSound(Gdx.files.internal("sounds/ButtonSoundtrack.wav")); - sound.play(1.0f); - inventoryComponent = ServiceLocator.getGameArea().getPlayer().getComponent(InventoryComponent.class); - inventoryComponent.addItem(MaterialFactory.createToiletPaper()); - }; - }); } + } else if ((HumanGuardPosition) != null && entity.getCenterPosition().dst(GridPointToVector(HumanGuardPosition)) < 1.5 && haveTalked==0) { logger.info("new text loaded"); countHumanGuard++; - textAreaHumanGuard = new TextArea(textHumanGuard[countHumanGuard], skin); - textAreaHumanGuard.setWidth(480); + textAreaHumanGuard = new TextArea(textHumanGuard[countHumanGuard], skin, "humanguard"); + textAreaHumanGuard.setWidth(700); textAreaHumanGuard.setHeight(50); - textAreaHumanGuard.setPosition(500,20); + textAreaHumanGuard.setPosition((Gdx.graphics.getWidth()/2) - (textAreaHumanGuard.getWidth()/2),29); dialogueContainerHumanGuard.addActor(textAreaHumanGuard); if (countHumanGuard == textHumanGuard.length - 1) { @@ -446,37 +427,43 @@ public void clicked(InputEvent event, float x, float y) { } else if (countHumanGuard == 1) { logger.info("HumanGuard1 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human Guard 1.wav")); + music.setVolume(0.3f); music.play(); } else if (countHumanGuard == 2) { logger.info("HumanGuard2 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human_Guard_2.wav")); + music.setVolume(0.3f); music.play(); } else if (countHumanGuard == 3) { + logger.info("HumanGuard3 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human_Guard_3.wav")); + music.setVolume(0.3f); + music.play(); inventoryComponent = ServiceLocator.getGameArea().getPlayer().getComponent(InventoryComponent.class); inventoryComponent.addItem(MaterialFactory.createRubber()); inventoryComponent.addItem(MaterialFactory.createPlastic()); - logger.info("HumanGuard3 sound displayed"); - Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human_Guard_3.wav")); - music.play(); + } else if (countHumanGuard == 4) { logger.info("HumanGuard4 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human_Guard_4.wav")); + music.setVolume(0.3f); music.play(); } else if (countHumanGuard == 5) { logger.info("HumanGuard5 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human_Guard_5.wav")); + music.setVolume(0.3f); music.play(); } } else if ((HumanGuardPosition) != null && entity.getCenterPosition().dst(GridPointToVector(HumanGuardPosition)) < 1.5 && haveTalked == 1) { logger.info("new text loaded"); countHumanGuardAlready++; - textAreaHumanGuardAlready = new TextArea(textHumanGuardAlready[countHumanGuardAlready], skin); - textAreaHumanGuardAlready.setWidth(480); + textAreaHumanGuardAlready = new TextArea(textHumanGuardAlready[countHumanGuardAlready], skin, "humanguard"); + textAreaHumanGuardAlready.setWidth(700); textAreaHumanGuardAlready.setHeight(50); - textAreaHumanGuardAlready.setPosition(500,20); + textAreaHumanGuardAlready.setPosition((Gdx.graphics.getWidth()/2) - (textAreaHumanGuardAlready.getWidth()/2),29); dialogueContainerHumanGuard.addActor(textAreaHumanGuardAlready); if (countHumanGuardAlready == textHumanGuardAlready.length - 1) { @@ -484,109 +471,174 @@ public void clicked(InputEvent event, float x, float y) { dialogueContainerHumanGuard.remove(); } else if (countHumanGuardAlready == 1) { logger.info("HumanGuard1 sound displayed"); - Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human Guard 1.wav")); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/LEAVE.wav")); music.play(); } else if (countHumanGuardAlready == 2) { logger.info("HumanGuard2 sound displayed"); - Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human_Guard_2.wav")); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/ME.wav")); music.play(); } else if (countHumanGuardAlready == 3) { - Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human_Guard_3.wav")); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/ALONE.wav")); music.play(); } else if (countHumanGuard == 4) { logger.info("HumanGuard4 sound displayed"); - Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human_Guard_4.wav")); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/ALONE.wav")); music.play(); } } else if ((friendlycreaturePosition) != null && entity.getCenterPosition().dst(GridPointToVector(friendlycreaturePosition)) < 1.5 && haveTalkedFriendlyCreature == 0) { logger.info("new text loaded"); countFriendlyCreature++; - textAreaFriendlyCreature = new TextArea(textFriendlyCreature[countFriendlyCreature], skin); - textAreaFriendlyCreature.setWidth(480); - textAreaFriendlyCreature.setHeight(50); - textAreaFriendlyCreature.setPosition(500,20); + textAreaFriendlyCreature = new TextArea(textFriendlyCreature[countFriendlyCreature], skin, "friendlycreature"); + textAreaFriendlyCreature.setWidth(700); + textAreaFriendlyCreature.setHeight(68); + textAreaFriendlyCreature.setPosition((Gdx.graphics.getWidth()/2) - (textAreaFriendlyCreature.getWidth()/2),29); dialogueContainerFriendlyCreature.addActor(textAreaFriendlyCreature); if (countFriendlyCreature == textFriendlyCreature.length - 1) { countFriendlyCreature = 0; dialogueContainerFriendlyCreature.remove(); haveTalkedFriendlyCreature = 1; } else if (countFriendlyCreature == 1) { + logger.info("FriendlyCreature1 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/FriendlyCreature/Line_1.wav")); + music.play(); + } else if (countFriendlyCreature == 2) { + logger.info("FriendlyCreature2 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/FriendlyCreature/Line_2.wav")); + music.play(); + + } else if (countFriendlyCreature == 3) { + logger.info("FriendlyCreature3 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/FriendlyCreature/Line_3.wav")); + music.play(); + dialogueContainerFriendlyCreature.addActor(startButton); + startButton.addListener(new ClickListener() { + @Override + public void clicked(InputEvent event, float x, float y) { + AudioRecorder recorder = Gdx.audio.newAudioRecorder(44100,true); + short[] audioBuffer = new short[44100 * 15]; + recorder.read(audioBuffer, 0, audioBuffer.length); + + AudioDevice audioDevice = Gdx.audio.newAudioDevice(44100, true); + audioDevice.writeSamples(audioBuffer, 0, audioBuffer.length); + System.out.println(Arrays.toString(audioBuffer)); + recorder.dispose(); + audioDevice.dispose(); + }; + }); + } else if (countFriendlyCreature == 4) { + dialogueContainerFriendlyCreature.removeActor(startButton); + logger.info("FriendlyCreature4 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/FriendlyCreature/Line_4.wav")); + music.play(); inventoryComponent = ServiceLocator.getGameArea().getPlayer().getComponent(InventoryComponent.class); inventoryComponent.addItem(MaterialFactory.createToiletPaper()); + + } else if(countFriendlyCreature == 5) { + logger.info("FriendlyCreature5 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/FriendlyCreature/Line_5.wav")); + music.play(); } } else if ((friendlycreaturePosition) != null && entity.getCenterPosition().dst(GridPointToVector(friendlycreaturePosition)) < 1.5 && haveTalkedFriendlyCreature == 1) { logger.info("new text loaded"); countFriendlyCreatureAlready++; - textAreaFriendlyCreatureAlready = new TextArea(textFriendlyCreatureAlready[countFriendlyCreatureAlready], skin); - textAreaFriendlyCreatureAlready.setWidth(480); - textAreaFriendlyCreatureAlready.setHeight(50); - textAreaFriendlyCreatureAlready.setPosition(500,20); + textAreaFriendlyCreatureAlready = new TextArea(textFriendlyCreatureAlready[countFriendlyCreatureAlready], skin, "friendlycreature"); + textAreaFriendlyCreatureAlready.setWidth(700); + textAreaFriendlyCreatureAlready.setHeight(68); + textAreaFriendlyCreatureAlready.setPosition((Gdx.graphics.getWidth() / 2) - (textAreaFriendlyCreatureAlready.getWidth() / 2), 29); dialogueContainerFriendlyCreature.addActor(textAreaFriendlyCreatureAlready); - if (countFriendlyCreatureAlready == textFriendlyCreatureAlready.length - 1) { + } if (countFriendlyCreatureAlready == textFriendlyCreatureAlready.length - 1) { countFriendlyCreatureAlready = 0; - dialogueContainerPlumberFriend.remove(); - } + dialogueContainerFriendlyCreature.remove(); + } else if (countFriendlyCreatureAlready == 1) { + logger.info("FriendlyCreature1 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/LEAVE.wav")); + music.play(); + } else if (countFriendlyCreatureAlready == 2) { + logger.info("FriendlyCreature2 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/ME.wav")); + music.play(); + } else if (countFriendlyCreatureAlready== 3) { + logger.info("FriendlyCreature3 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/ALONE.wav")); + music.play(); + } else if (countFriendlyCreature == 4) { + logger.info("FriendlyCreature4 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/ALONE.wav")); + music.play(); + } else if ((PlumberFriendPosition) != null && entity.getCenterPosition().dst(GridPointToVector(PlumberFriendPosition)) < 1.5 && haveTalkedPlumberFriend == 0) { + logger.info("new text loaded"); countPlumberFriend++; - textAreaPlumberFriend = new TextArea(textPlumberFriend[countPlumberFriend], skin); - textAreaPlumberFriend.setWidth(480); - textAreaPlumberFriend.setHeight(50); - textAreaPlumberFriend.setPosition(500,20); + textAreaPlumberFriend = new TextArea(textPlumberFriend[countPlumberFriend], skin, "plumberfriend"); + textAreaPlumberFriend.setWidth(700); + textAreaPlumberFriend.setHeight(43); + textAreaPlumberFriend.setPosition((Gdx.graphics.getWidth()/2) - (textAreaPlumberFriend.getWidth()/2),29); dialogueContainerPlumberFriend.addActor(textAreaPlumberFriend); if (countPlumberFriend == textPlumberFriend.length - 1) { + haveTalkedPlumberFriend = 1; countPlumberFriend = 0; dialogueContainerPlumberFriend.remove(); haveTalkedPlumberFriend = 1; } else if (countPlumberFriend == 1) { logger.info("PlumberFriend1 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Plumber Friend Audio/Plumber Friend 1.wav")); + music.setVolume(0.3f); music.play(); } else if (countPlumberFriend == 2) { logger.info("PlumberFriend2 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Plumber Friend Audio/Plumber Friend 2.wav")); + music.setVolume(0.3f); music.play(); } else if (countPlumberFriend == 3) { logger.info("PlumberFriend3 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Plumber Friend Audio/Plumber Friend 3.wav")); + music.setVolume(0.3f); music.play(); } else if (countPlumberFriend == 4) { logger.info("PlumberFriend4 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Plumber Friend Audio/Plumber Friend 4.wav")); + music.setVolume(0.3f); music.play(); } else if (countPlumberFriend == 5) { logger.info("PlumberFriend5 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Plumber Friend Audio/Plumber Friend 5.wav")); + music.setVolume(0.3f); music.play(); } else if (countPlumberFriend == 6) { logger.info("PlumberFriend6 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Plumber Friend Audio/Plumber Friend 6.wav")); + music.setVolume(0.3f); music.play(); } else if (countPlumberFriend == 7) { logger.info("PlumberFriend7 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Plumber Friend Audio/Plumber Friend 7.wav")); + music.setVolume(0.3f); music.play(); } else if (countPlumberFriend == 8) { logger.info("PlumberFriend8 sound displayed"); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Plumber Friend Audio/Plumber Friend 8.wav")); + music.setVolume(0.3f); music.play(); } else if (countPlumberFriend == 9) { logger.info("PlumberFriend9 sound displayed"); inventoryComponent = ServiceLocator.getGameArea().getPlayer().getComponent(InventoryComponent.class); inventoryComponent.addItem(MaterialFactory.createPoop()); Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Plumber Friend Audio/Plumber Friend 9.wav")); + music.setVolume(0.3f); music.play(); + } } else if ((PlumberFriendPosition) != null && entity.getCenterPosition().dst(GridPointToVector(PlumberFriendPosition)) < 1.5 && haveTalkedPlumberFriend == 1) { logger.info("new text loaded"); countPlumberFriendAlready++; - textAreaPlumberFriendAlready = new TextArea(textPlumberFriendAlready[countPlumberFriendAlready], skin); - textAreaPlumberFriendAlready.setWidth(480); - textAreaPlumberFriendAlready.setHeight(50); - textAreaPlumberFriendAlready.setPosition(500, 20); + textAreaPlumberFriendAlready = new TextArea(textPlumberFriendAlready[countPlumberFriendAlready], skin, "plumberfriend"); + textAreaPlumberFriendAlready.setWidth(700); + textAreaPlumberFriendAlready.setHeight(43); + textAreaPlumberFriendAlready.setPosition((Gdx.graphics.getWidth()/2) - (textAreaPlumberFriendAlready.getWidth()/2),29); dialogueContainerPlumberFriend.addActor(textAreaPlumberFriendAlready); if (countPlumberFriendAlready == textPlumberFriendAlready.length - 1) { @@ -594,19 +646,21 @@ public void clicked(InputEvent event, float x, float y) { dialogueContainerPlumberFriend.remove(); } else if (countPlumberFriendAlready == 1) { logger.info("HumanGuard1 sound displayed"); - Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human Guard 1.wav")); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/LEAVE.wav")); music.play(); } else if (countPlumberFriendAlready == 2) { - logger.info("HumanGuard2 sound displayed"); - Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human_Guard_2.wav")); + logger.info("PlumberFriend2 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/ME.wav")); music.play(); } else if (countPlumberFriendAlready == 3) { - Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human_Guard_3.wav")); + logger.info("PlumberFriend3 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/ALONE.wav")); music.play(); } else if (countPlumberFriendAlready == 4) { - logger.info("HumanGuard4 sound displayed"); - Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/Human Guard/Human_Guard_4.wav")); + logger.info("PlumberFriend4 sound displayed"); + Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/Dialogue/ALONE.wav")); music.play(); + } } } @@ -635,6 +689,7 @@ public void openDialogue() { state = false; } else if ((PlumberFriendPosition) != null && entity.getCenterPosition().dst(GridPointToVector(PlumberFriendPosition)) < 1.5) { logger.info("dialogue closed manually"); + System.out.println(haveTalkedPlumberFriend); stage.addActor(dialogueContainerPlumberFriend); state = false; } else if ((friendlycreaturePosition) != null && entity.getCenterPosition().dst(GridPointToVector(friendlycreaturePosition)) < 1.5) { @@ -680,4 +735,4 @@ public void dispose() { super.dispose(); } -} \ No newline at end of file +} diff --git a/source/core/src/main/com/deco2800/game/components/player/CooldownBarDisplay.java b/source/core/src/main/com/deco2800/game/components/player/CooldownBarDisplay.java index 1e3f0de06..c70ef69a4 100644 --- a/source/core/src/main/com/deco2800/game/components/player/CooldownBarDisplay.java +++ b/source/core/src/main/com/deco2800/game/components/player/CooldownBarDisplay.java @@ -7,7 +7,6 @@ public class CooldownBarDisplay extends UIComponent { private Table cooldownBar; - private Table cooldownTable; @Override @@ -32,12 +31,11 @@ private void addActors() { stage.addActor(cooldownBar); } - //private boolean cooldownImageNeedsUpdating() { - - //} public void addSkillIcon(Image skillIcon) { - cooldownBar.add(skillIcon).size(96,96).pad(3f); + if (cooldownBar != null) { + cooldownBar.add(skillIcon).size(96,96).pad(3f); + } } public void clearSkillIcons() { @@ -48,6 +46,5 @@ public void clearSkillIcons() { public void dispose() { super.dispose(); cooldownBar.clear(); - //cooldownTable.clear(); } } diff --git a/source/core/src/main/com/deco2800/game/components/player/Countdown.java b/source/core/src/main/com/deco2800/game/components/player/Countdown.java index d5d4bf9c3..53614b497 100644 --- a/source/core/src/main/com/deco2800/game/components/player/Countdown.java +++ b/source/core/src/main/com/deco2800/game/components/player/Countdown.java @@ -5,8 +5,6 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.utils.TimeUtils; -import com.deco2800.game.entities.Entity; -import com.deco2800.game.screens.MainGameScreen; import com.deco2800.game.services.ServiceLocator; import com.deco2800.game.ui.UIComponent; import org.slf4j.Logger; @@ -16,26 +14,24 @@ import java.util.HashMap; public class Countdown extends UIComponent { - //Ability activeAbility = Ability.NONE; + long startTimeSkill0; long startTimeSkill1; long startTimeSkill2; long startTimeSkill3; - private static final Logger logger = LoggerFactory.getLogger(Countdown.class); + long skill0CountdownLength; + long skill1CountdownLength; + long skill2CountdownLength; + long skill3CountdownLength; - private int MAX_NUMBER = 5; - private long COUNTDOWN_DURATION_MILLIS = 5000; + private static final int MAX_NUMBER = 20; private ArrayList addedCountdownListeners = new ArrayList<>(); HashMap> numberImages; private Table bar; - //private enum Ability { - //DASH, BLOCK, DODGE, INVULNERABLE, TELEPORT, NONE - //} - /** * Creates reusable ui styles and adds actors to the stage. */ @@ -55,6 +51,21 @@ public void create() { initialiseImages(3, "images/countdown/3.png"); initialiseImages(4, "images/countdown/4.png"); initialiseImages(5, "images/countdown/5.png"); + initialiseImages(6, "images/countdown/6.png"); + initialiseImages(7, "images/countdown/7.png"); + initialiseImages(8, "images/countdown/8.png"); + initialiseImages(9, "images/countdown/9.png"); + initialiseImages(10, "images/countdown/10.png"); + initialiseImages(11, "images/countdown/11.png"); + initialiseImages(12, "images/countdown/12.png"); + initialiseImages(13, "images/countdown/13.png"); + initialiseImages(14, "images/countdown/14.png"); + initialiseImages(15, "images/countdown/15.png"); + initialiseImages(16, "images/countdown/16.png"); + initialiseImages(17, "images/countdown/17.png"); + initialiseImages(18, "images/countdown/18.png"); + initialiseImages(19, "images/countdown/19.png"); + initialiseImages(20, "images/countdown/20.png"); entity.getEvents().addListener("dashCountdown", () -> this.startCountdown(0)); @@ -69,11 +80,17 @@ private void initialiseImages(int imageNum, String filename) { } } - public void setCountdownTrigger(int skillNum, String listenerName) { + public void setCountdownTrigger(int skillNum, String listenerName, long cooldownLength) { entity.getEvents().addListener(listenerName, () -> this.startCountdown(skillNum)); addedCountdownListeners.add(listenerName); + switch (skillNum) { + case 0 -> skill0CountdownLength = cooldownLength; + case 1 -> skill1CountdownLength = cooldownLength; + case 2 -> skill2CountdownLength = cooldownLength; + default -> skill3CountdownLength = cooldownLength; + } } public void clearCountdownListeners() { @@ -105,9 +122,7 @@ private void startCountdown(int skillNum) { */ @Override public void update() { - // For now just gives each ability 10 seconds - //if (activeAbility == Ability.NONE) - // return; + bar.clearChildren(); long elapsedTime0 = TimeUtils.timeSinceMillis(startTimeSkill0); long elapsedTime1 = TimeUtils.timeSinceMillis(startTimeSkill1); @@ -118,19 +133,24 @@ public void update() { int numberToDisplay2 = getNumToDisplay(elapsedTime2, 2); int numberToDisplay3 = getNumToDisplay(elapsedTime3, 3); - if (true) { // temp disable flag until fixed - alterTable(0, numberToDisplay0); - alterTable(1, numberToDisplay1); - alterTable(2, numberToDisplay2); - alterTable(3, numberToDisplay3); - } + alterTable(0, numberToDisplay0); + alterTable(1, numberToDisplay1); + alterTable(2, numberToDisplay2); + alterTable(3, numberToDisplay3); } private int getNumToDisplay(long elapsedTime, int skillNum) { int numberToDisplay = 0; - if (elapsedTime < COUNTDOWN_DURATION_MILLIS) { - numberToDisplay = ((int) (((COUNTDOWN_DURATION_MILLIS - elapsedTime) / 1000) + 1)); + long cooldownLength = 0; + switch (skillNum) { + case 0 -> cooldownLength = skill0CountdownLength; + case 1 -> cooldownLength = skill1CountdownLength; + case 2 -> cooldownLength = skill2CountdownLength; + case 3 -> cooldownLength = skill3CountdownLength; + } + if (elapsedTime < cooldownLength) { + numberToDisplay = ((int) (((cooldownLength - elapsedTime) / 1000) + 1)); } if (numberToDisplay > MAX_NUMBER) { numberToDisplay = MAX_NUMBER; diff --git a/source/core/src/main/com/deco2800/game/components/player/InventoryComponent.java b/source/core/src/main/com/deco2800/game/components/player/InventoryComponent.java index dfb8e4453..fd4fd3912 100644 --- a/source/core/src/main/com/deco2800/game/components/player/InventoryComponent.java +++ b/source/core/src/main/com/deco2800/game/components/player/InventoryComponent.java @@ -2,7 +2,7 @@ import com.deco2800.game.components.DefensiveItemsComponents.ArmourStatsComponent; -import com.deco2800.game.components.combatitemsComponents.PhysicalWeaponStatsComponent; +import com.deco2800.game.components.combatitemscomponents.PhysicalWeaponStatsComponent; import com.deco2800.game.components.Component; import com.deco2800.game.entities.Entity; import com.deco2800.game.entities.EntityService; @@ -109,8 +109,15 @@ public void registerAnimation(Entity weapon) { entity.getComponent(PlayerTouchAttackComponent.class).setCombatAnimator(newCombatAnimator); ServiceLocator.getGameArea().spawnEntity(newCombatAnimator); String description = weapon.getComponent(PhysicalWeaponStatsComponent.class).getDescription(); - String staticAnimation = description+"Static"; - combatAnimator.getEvents().trigger(staticAnimation); + + //add exception for golden plunger + if (description.equals("goldenPlungerBow")){ + combatAnimator.getEvents().trigger(description); + } + else { + String staticAnimation = description+"Static"; + combatAnimator.getEvents().trigger(staticAnimation); + } } /** @@ -162,7 +169,7 @@ public int getItemIndex(Entity item, List storage) { */ public void addItem(Entity item) { if (inventory.size() == INVENTORY_SIZE) { - logger.info("Inventory is full"); + if (!hasItem(item, inventory)) logger.info("Inventory is full"); } else if (!hasItem(item, inventory)) { if ((item.checkEntityType(EntityTypes.WEAPON) || item.checkEntityType(EntityTypes.ARMOUR))) { @@ -173,6 +180,7 @@ public void addItem(Entity item) { inventory.add(item); } } + if (getItemIndex(item, inventory) != -1 && getItemQuantity(item) < 9 && (item.checkEntityType(EntityTypes.POTION) @@ -190,9 +198,10 @@ && getItemQuantity(item) < 9 * @param quantity the quantity array of corresponding inventory */ public void sortInventory(int index, List list, int[] quantity) { - if (list.size() > index) { - for (int i = index; i < list.size(); ++i) { - quantity[i] = quantity[i + 1]; + final int size = list.size(); + if (size > index) { + for (int i = index; i < size; ++i) { + if (i != size - 1) quantity[i] = quantity[i + 1]; } } } @@ -389,6 +398,7 @@ public boolean equipItem(Entity item) { * Swap the item in equipable * * @param item the item to be swapped in + * @requires getEquipables().size() > 1 AND item.checkEntityType(ARMOUR || WEAPON) */ public void swapItem(Entity item) { int itemSlot = item.checkEntityType(EntityTypes.WEAPON) ? 0 : 1; @@ -402,7 +412,7 @@ public void swapItem(Entity item) { applyWeaponEffect(item, true); registerAnimation(item); equipables[0] = item; - } else if (itemSlot == 1) { + } else { applyArmourEffect(swappedItem, false); //Swap applyArmourEffect(item, true); @@ -430,7 +440,7 @@ public boolean unequipItem(int itemSlot) { applyWeaponEffect(item, unequipped); //CANCEL_ANIMATION cancelAnimation(); - } else if (item.checkEntityType(EntityTypes.ARMOUR)) { + } else { applyArmourEffect(item, unequipped); } addItem(item); @@ -464,7 +474,15 @@ public List getQuickBarItems() { return List.copyOf(quickBarItems); } - /**add + /** + * Returns the current quantity of all potions in the quick bar + * @return quantity array + */ + public int[] getQuickBarQuantity() { + return Arrays.copyOf(quickBarQuantity, 3); + } + + /** * Check if two items are the same kind * * @param item the item to be checked @@ -547,6 +565,15 @@ public void removePotion(int inputIndex) { quickBarQuantity[inputIndex] = 0; } + /** + * Set the quantity of the potion based on its index on the quick bar + * @param index index of the potion + */ + public void setPotionQuantity(int index, int quantity) { + if (index >= QUICKBAR_SIZE || quantity > MAX_QTY) return; + quickBarQuantity[index] = quantity; + } + /** * Consume the potion from quickbar based on the input index. * @@ -556,11 +583,12 @@ public void consumePotion(int inputIndex) { //Does nothing if there is no potion on the selected slot or the quantity < 1 if (quickBarItems.size() >= inputIndex) { quickBarItems.get(--inputIndex).getComponent(PotionEffectComponent.class).applyEffect(entity); - if (quickBarQuantity[inputIndex] == 1) { - removePotion(inputIndex); - sortInventory(inputIndex, quickBarItems, quickBarQuantity); - } else if (quickBarQuantity[inputIndex] > 1) { + if (quickBarQuantity[inputIndex] >= 1) { --quickBarQuantity[inputIndex]; + if (quickBarQuantity[inputIndex] == 0) { + removePotion(inputIndex); + sortInventory(inputIndex, quickBarItems, quickBarQuantity); + } } } } diff --git a/source/core/src/main/com/deco2800/game/components/player/KeyboardPlayerInputComponent.java b/source/core/src/main/com/deco2800/game/components/player/KeyboardPlayerInputComponent.java index 8f7e00fff..ea355e662 100644 --- a/source/core/src/main/com/deco2800/game/components/player/KeyboardPlayerInputComponent.java +++ b/source/core/src/main/com/deco2800/game/components/player/KeyboardPlayerInputComponent.java @@ -22,7 +22,7 @@ public class KeyboardPlayerInputComponent extends InputComponent { private static int keyPressedCounter; private static boolean menuOpened = false; private static Enum currentMenu = MenuTypes.NONE; - enum MenuTypes{ + public enum MenuTypes{ INVENTORY, CRAFTING, MINIMAP, @@ -65,14 +65,8 @@ public boolean keyDown(int keycode) { entity.getEvents().trigger("attackEnemy"); return true; case Keys.Q: - if (currentMenu == MenuTypes.NONE - || currentMenu == MenuTypes.CRAFTING) { - currentMenu = MenuTypes.CRAFTING; entity.getEvents().trigger("can_open"); - menuOpened = !menuOpened; - if (!menuOpened) currentMenu = MenuTypes.NONE; return true; - } case Keys.J: entity.getEvents().trigger("skill"); return true; @@ -193,6 +187,11 @@ public boolean keyUp(int keycode) { } } + public static void setCurrentMenu(Boolean opened, MenuTypes menu) { + menuOpened = opened; + currentMenu = menu; + } + public static void clearMenuOpening() { menuOpened = false; currentMenu = MenuTypes.NONE; diff --git a/source/core/src/main/com/deco2800/game/components/player/PlayerActions.java b/source/core/src/main/com/deco2800/game/components/player/PlayerActions.java index b9f37b164..33453bb79 100644 --- a/source/core/src/main/com/deco2800/game/components/player/PlayerActions.java +++ b/source/core/src/main/com/deco2800/game/components/player/PlayerActions.java @@ -49,6 +49,7 @@ public class PlayerActions extends Component { private Music bleedingSound= Gdx.audio.newMusic(Gdx.files.internal("sounds/bleeding.wav")); private Music projectileSound = Gdx.audio.newMusic(Gdx.files.internal("sounds/projectile.mp3")); private Music rootSound = Gdx.audio.newMusic(Gdx.files.internal("sounds/root.mp3")); + private Music chargeSound = Gdx.audio.newMusic(Gdx.files.internal("sounds/charge.mp3")); private Music invulnerabilitySound= Gdx.audio.newMusic(Gdx.files.internal("sounds/invulnerability.mp3")); private Music oraSound= Gdx.audio.newMusic(Gdx.files.internal("sounds/ora.mp3")); private Music zawarudoSound= Gdx.audio.newMusic(Gdx.files.internal("sounds/zawarudo.mp3")); @@ -225,12 +226,11 @@ void dash() { * Makes the player charge. Registers call of the charge function to the skill manager component. */ void charge() { - if(mana >= 2){ - skillManager.startCharge(this.walkDirection.cpy()); - entity.getEvents().trigger("decreaseStamina", -2); + if(mana >= 20){ + skillManager.startCharge(); + entity.getEvents().trigger("decreaseMana", -20); + chargeSound.play(); } - - playerModifier.createModifier(PlayerModifier.STAMINAREGEN, 3, true, 2000); } /** @@ -281,8 +281,8 @@ void rest() { * Makes the player teleport. Registers call of the teleport function to the skill manager component. */ void teleport() { - if (mana>=40) { - entity.getEvents().trigger("decreaseMana", -40); + if (mana>=20) { + entity.getEvents().trigger("decreaseMana", -20); skillManager.startTeleport(); teleportSound.play(); } @@ -315,8 +315,8 @@ void root() { * Does an aoe attackEnemy around the player. Registers call of the aoe function to the skill manager component. */ void aoe() { - if (mana>=2) { - entity.getEvents().trigger("decreaseMana", -2); + if (mana>=5) { + entity.getEvents().trigger("decreaseMana", -5); skillManager.aoeAttack(); } } diff --git a/source/core/src/main/com/deco2800/game/components/player/PlayerCombatAnimationController.java b/source/core/src/main/com/deco2800/game/components/player/PlayerCombatAnimationController.java index d6a85f91f..1dd7ec611 100644 --- a/source/core/src/main/com/deco2800/game/components/player/PlayerCombatAnimationController.java +++ b/source/core/src/main/com/deco2800/game/components/player/PlayerCombatAnimationController.java @@ -138,6 +138,9 @@ public void create() { entity.getEvents().addListener("plungerBowSpeedStatic", this::animatePlungerBowSpeedStatic); entity.getEvents().addListener("plungerBowStatic", this::animatePlungerBowStatic); + /*gold plunger bow animation listeners*/ + entity.getEvents().addListener("goldenPlungerBow", this::animateGoldenPlungerBow); + entity.getEvents().trigger("attackEnemy"); } @@ -437,6 +440,6 @@ void animatePlungerBowStatic() { animator.startAnimation("plungerBowStatic"); } - void animateGoldenPlungerBow() {animator.startAnimation("goldenBow");} + void animateGoldenPlungerBow() {animator.startAnimation("goldenPlungerBow");} } diff --git a/source/core/src/main/com/deco2800/game/components/player/PlayerModifier.java b/source/core/src/main/com/deco2800/game/components/player/PlayerModifier.java index 2a5fd5d0f..5df259719 100644 --- a/source/core/src/main/com/deco2800/game/components/player/PlayerModifier.java +++ b/source/core/src/main/com/deco2800/game/components/player/PlayerModifier.java @@ -234,19 +234,15 @@ private void applyModifierPerm (Modifier mod) { playerActions.updateMaxSpeed(modSpeed); } case DMGREDUCTION -> { - System.out.println("Applying perm dmg red"); modDamageReduction += mod.value; refDamageReduction += mod.value; combatStatsComponent.setDamageReduction(modDamageReduction); - System.out.println("new dmg red " + modDamageReduction); } case DMGRETURN -> { - System.out.println("Applying perm dmg return"); modDamageReturn += mod.value; refDamageReturn += mod.value; combatStatsComponent.setDamageReturn(modDamageReturn); - System.out.println("new dmg return " + modDamageReturn); } case MANAREGEN -> { modManaRegen += mod.value; @@ -297,11 +293,9 @@ public boolean createModifier (String target, float value, boolean scaling, int break; case DMGREDUCTION: valChange = (scaling) ? refDamageReduction * value : value; - System.out.println("Original reduc " + refDamageReduction + " change " + valChange); break; case DMGRETURN: valChange = (scaling) ? refDamageReturn * value : value; - System.out.println("Original return " + refDamageReturn + " change " + valChange); break; case MANAREGEN : valChange = (scaling) ? (int)(refManaRegen * value) : (int)value; diff --git a/source/core/src/main/com/deco2800/game/components/player/PlayerSkillAnimationController.java b/source/core/src/main/com/deco2800/game/components/player/PlayerSkillAnimationController.java index c43d85197..bd3a0e3d4 100644 --- a/source/core/src/main/com/deco2800/game/components/player/PlayerSkillAnimationController.java +++ b/source/core/src/main/com/deco2800/game/components/player/PlayerSkillAnimationController.java @@ -50,9 +50,24 @@ public void create() { entity.getEvents().addListener("invulnerabilityAnimation", this::animateInvulnerability); entity.getEvents().addListener("aoeAnimation", this::animateAOE); entity.getEvents().addListener("dashAnimation", this::animateDash); + entity.getEvents().addListener("chargeAnimation", this::animateCharge); + entity.getEvents().addListener("chargemoveAnimation", this::animateChargemove); + entity.getEvents().addListener("bleedAnimation", this::animateBleed); entity.getEvents().trigger("regularAnimation"); } + private void animateChargemove() { + animator.startAnimation("chargemove"); + } + + private void animateBleed() { + animator.startAnimation("bleed"); + } + + private void animateCharge() { + animator.startAnimation("charge"); + } + private void animateAOE() { animator.startAnimation("aoe"); } @@ -111,6 +126,6 @@ void animateUltimate() { * Triggers the attackspeed animation. */ void animateRoot() { - animator.startAnimation("attackSpeed"); + animator.startAnimation("root"); } } \ No newline at end of file diff --git a/source/core/src/main/com/deco2800/game/components/player/PlayerSkillComponent.java b/source/core/src/main/com/deco2800/game/components/player/PlayerSkillComponent.java index cafb9353f..c2b4ec31f 100644 --- a/source/core/src/main/com/deco2800/game/components/player/PlayerSkillComponent.java +++ b/source/core/src/main/com/deco2800/game/components/player/PlayerSkillComponent.java @@ -4,12 +4,16 @@ import com.badlogic.gdx.physics.box2d.Body; import com.deco2800.game.ai.tasks.AITaskComponent; import com.deco2800.game.areas.ForestGameArea; +import com.deco2800.game.areas.UndergroundGameArea; import com.deco2800.game.components.CombatStatsComponent; import com.deco2800.game.components.Component; import com.deco2800.game.components.tasks.ChaseTask; import com.deco2800.game.entities.Entity; import com.deco2800.game.entities.factories.EntityTypes; +import com.deco2800.game.physics.PhysicsEngine; +import com.deco2800.game.physics.PhysicsLayer; import com.deco2800.game.physics.components.PhysicsComponent; +import com.deco2800.game.physics.raycast.RaycastHit; import com.deco2800.game.rendering.AnimationRenderComponent; import com.deco2800.game.services.ServiceLocator; @@ -56,13 +60,16 @@ public enum SkillTypes { Map skillCooldowns = new HashMap<>(); // Teleport variables - private static final int TELEPORT_LENGTH = 4; + private static final int TELEPORT_LENGTH = 8; private long teleportEnd; // Teleport charge end system time private boolean teleporting; private static final long TELEPORT_CHARGE_LENGTH = 1000; // In MilliSec (1000millisec = 1sec) private static final float TELEPORT_MOVEMENT_RESTRICTION = 0.5f; // As a proportion of regular move (0.8 = 80%) - private static final long TELEPORT_COOLDOWN = 3000; + private static final long TELEPORT_COOLDOWN = 10000; private boolean teleportEndEvent = false; + private final RaycastHit hit = new RaycastHit(); + private final PhysicsEngine physics; + private static final String TELEPORT_NAME = "teleport"; // Dashing Variables private static final Vector2 DASH_SPEED = new Vector2(6f, 6f); @@ -72,6 +79,7 @@ public enum SkillTypes { private boolean dashing = false; private long dashEnd; // Dash end system time private boolean dashEndEvent = false; + private static final String DASH_NAME = "dash"; // Dodge Variables private long dodgeEnd; // Teleport charge end system time @@ -82,16 +90,18 @@ public enum SkillTypes { private static final long DODGE_LENGTH = 300; // In MilliSec (1000millsec = 1sec) private static final Vector2 DODGE_SPEED = new Vector2(-4.5f, -4.5f); // As a proportion of regular move (0.8 = 80%) private static final float DODGE_SIDE_MOVE = 3.0f; - private static final long DODGE_COOLDOWN = 500; + private static final long DODGE_COOLDOWN = 3000; private boolean dodgeEndEvent = false; private Vector2 dodgeDirection; + private static final String DODGE_NAME = "dodge"; // Block Variables private boolean blocking; private long blockEnd; private static final long BLOCK_LENGTH = 400; - private static final long BLOCK_COOLDOWN = 500; + private static final long BLOCK_COOLDOWN = 3000; private boolean blockEndEvent; + private static final String BLOCK_NAME = "block"; // Root Variables private boolean rootApplied; @@ -99,6 +109,7 @@ public enum SkillTypes { private long rootEnd; private static final long ROOT_LENGTH = 5000; private boolean rootEndEvent = false; + private static final String ROOT_NAME = "root"; // Bleed Variables private boolean bleedApplied; @@ -109,6 +120,7 @@ public enum SkillTypes { private static final long BLEED_HITS = 7; private static final int BLEED_DAMAGE = 5; private boolean bleedEndEvent = false; + private static final String BLEED_NAME = "bleed"; // Charge variables private boolean enemyDead = false; @@ -117,7 +129,11 @@ public enum SkillTypes { private boolean charging; private long chargeEnd; private static final Vector2 CHARGE_SPEED = new Vector2(20f, 20f); - private int CHARGE_DAMAGE = 30; + private static final int CHARGE_DAMAGE = 30; + private boolean chargeUp = false; + private long chargeUpEnd; + private static final long CHARGE_UP_LENGTH = 700; + private static final String CHARGE_NAME = "charge"; private boolean chargingUltimate; private long ultimateChargeEnd; @@ -125,29 +141,45 @@ public enum SkillTypes { private static final long ULTIMATE_TIMESTOP_LENGTH = 6000; private long ultimateTimeStopEnd; private boolean timeStopped; + private static final String ULTIMATE_NAME = "ultimate"; private boolean chargingUltimateFireball; private static final long FIREBALL_CHARGE_LENGTH = 1000; private long ultimateFireballChargeEnd; + private static final String FIREBALL_NAME = "fireball"; private boolean invulnerabilitySkill; private static final long INVULNERABILITY_LENGTH = 2600; private long invulnerabilitySkillEnd; + private static final String INVULNERABILITY_NAME = "invulnerable"; private long aoeAnimationEnd; private boolean aoeAnimationRunning; private static final long AOE_ANIMATION_LENGTH = 500; + private static final String AOE_NAME = "aoe"; private long rootAnimationEnd; private boolean rootAnimationRunning; private static final long ROOT_ANIMATION_LENGTH = 500; + private long bleedAnimationEnd; + private boolean bleedAnimationRunning; + private static final long BLEED_ANIMATION_LENGTH = 500; + + private static final String PROJECTILE_NAME = "projectile"; + + private static final String NO_ANIMATION_LISTENER = "regularAnimation"; + private static final String ENEMY_HIT_LISTENER = "hitEnemy"; + private static final String FLASH_LISTENER = "skillScreenOverlayFlash"; + + /** * Initialises the player skill component, taking a player entity as the parent component. * @param playerEntity the player entity this skill component is a subcomponent of */ public PlayerSkillComponent(Entity playerEntity) { this.playerEntity = playerEntity; + physics = ServiceLocator.getPhysicsService().getPhysics(); } /** @@ -185,14 +217,14 @@ public void update() { if (this.blocking && System.currentTimeMillis() > this.blockEnd) { this.blocking = false; this.blockEndEvent = true; - skillAnimator.getEvents().trigger("regularAnimation"); + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); } // Check if the player is in a dash and waiting for the dash to end if (this.dashing && System.currentTimeMillis() > this.dashEnd) { // Only end animation if not interrupting another skill if (!this.teleporting && !this.blocking && !this.dodging && !this.charging) { - skillAnimator.getEvents().trigger("regularAnimation"); + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); } this.dashing = false; this.dashEndEvent = true; @@ -202,25 +234,32 @@ public void update() { if (this.charging && System.currentTimeMillis() > this.chargeEnd) { // Only end animation if not interrupting another skill if (!this.teleporting && !this.blocking && !this.dodging) { - skillAnimator.getEvents().trigger("regularAnimation"); + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); } this.charging = false; } + // Check if the player is waiting to charge from charging + if (this.chargeUp && System.currentTimeMillis() > this.chargeUpEnd) { + this.chargeUp = false; + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); + chargeMove(); + } + // Check if the player is waiting to teleport from charging // if true teleport the player and finish charging if (this.teleporting && System.currentTimeMillis() > this.teleportEnd) { this.teleporting = false; this.teleportEndEvent = true; teleportPlayer(); - skillAnimator.getEvents().trigger("regularAnimation"); + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); } // Check if the player is waiting to finish a dodge if (this.dodging && System.currentTimeMillis() > this.dodgeEnd) { this.dodging = false; this.dodgeEndEvent = true; - skillAnimator.getEvents().trigger("regularAnimation"); + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); } else if (System.currentTimeMillis() > this.dodgeSpeedBoostEnd) { this.dodgeSpeedBoost = false; } @@ -247,15 +286,15 @@ public void update() { if (this.chargingUltimate) { if (System.currentTimeMillis() > this.ultimateChargeEnd) { - playerEntity.getEvents().trigger("skillScreenOverlayFlash", false); - skillAnimator.getEvents().trigger("regularAnimation"); + playerEntity.getEvents().trigger(FLASH_LISTENER, false); + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); this.chargingUltimate = false; ServiceLocator.getEntityService().toggleTimeStop(); this.timeStopped = true; } else if (System.currentTimeMillis() > this.ultimateChargeEnd - 1500) { - playerEntity.getEvents().trigger("skillScreenOverlayFlash", false); + playerEntity.getEvents().trigger(FLASH_LISTENER, false); } else if (System.currentTimeMillis() > this.ultimateChargeEnd - 1800) { - playerEntity.getEvents().trigger("skillScreenOverlayFlash", true); + playerEntity.getEvents().trigger(FLASH_LISTENER, true); } } if (this.timeStopped) { @@ -268,9 +307,11 @@ public void update() { if (this.chargingUltimateFireball) { if (System.currentTimeMillis() > this.ultimateFireballChargeEnd) { this.chargingUltimateFireball = false; - skillAnimator.getEvents().trigger("regularAnimation"); + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); if (ServiceLocator.getGameArea().getClass() == ForestGameArea.class) { ((ForestGameArea) ServiceLocator.getGameArea()).spawnPlayerProjectileSpray(); + } else if (ServiceLocator.getGameArea().getClass() == UndergroundGameArea.class) { + ((UndergroundGameArea) ServiceLocator.getGameArea()).spawnPlayerProjectileSpray(); } } } @@ -278,20 +319,26 @@ public void update() { if (this.invulnerabilitySkill) { if (System.currentTimeMillis() > this.invulnerabilitySkillEnd) { this.invulnerabilitySkill = false; - skillAnimator.getEvents().trigger("regularAnimation"); + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); } } if (this.rootAnimationRunning) { if (System.currentTimeMillis() > this.rootAnimationEnd) { this.rootAnimationRunning = false; - skillAnimator.getEvents().trigger("regularAnimation"); + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); } } if (this.aoeAnimationRunning) { if (System.currentTimeMillis() > this.aoeAnimationEnd) { this.aoeAnimationRunning = false; - skillAnimator.getEvents().trigger("regularAnimation"); + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); + } + } + if (this.bleedAnimationRunning) { + if (System.currentTimeMillis() > this.bleedAnimationEnd) { + this.bleedAnimationRunning = false; + skillAnimator.getEvents().trigger(NO_ANIMATION_LISTENER); } } } @@ -331,10 +378,10 @@ public void setSkill(int skillNum, SkillTypes skillName, Entity entity, PlayerAc entity.getEvents().addListener(skillEvent, playerActionsComponent::block); } else if (skillName == SkillTypes.BLEED) { entity.getEvents().addListener(skillEvent, playerActionsComponent::bleed); - entity.getEvents().addListener("hitEnemy", this::hitBleed); + entity.getEvents().addListener(ENEMY_HIT_LISTENER, this::hitBleed); } else if (skillName == SkillTypes.ROOT) { entity.getEvents().addListener(skillEvent, playerActionsComponent::root); - entity.getEvents().addListener("hitEnemy", this::hitRoot); + entity.getEvents().addListener(ENEMY_HIT_LISTENER, this::hitRoot); } else if (skillName == SkillTypes.FIREBALLULTIMATE) { entity.getEvents().addListener(skillEvent, playerActionsComponent::fireballUltimate); } else if (skillName == SkillTypes.ULTIMATE) { @@ -367,7 +414,8 @@ public void resetSkills(Entity entity) { */ public boolean movementIsModified() { - return (isDashing() || isTeleporting() || isDodging() || isCharging() || this.dodgeSpeedBoost); + return (isDashing() || isTeleporting() || isDodging() || isCharging() || isChargingUp() + || this.dodgeSpeedBoost); } /** @@ -406,7 +454,7 @@ else if (isCharging()) { modifiedMovementVector = addVectors(reducedMovement, dashVelocity); } - if (isTeleporting()) { + if (isTeleporting() || isChargingUp()) { Vector2 reducedMovement = new Vector2(modifiedMovementVector.x * TELEPORT_MOVEMENT_RESTRICTION, modifiedMovementVector.y * TELEPORT_MOVEMENT_RESTRICTION); modifiedMovementVector = reducedMovement; @@ -511,6 +559,15 @@ public boolean isCharging() { return this.charging; } + /** + * Checks if the player is in the charge up skill state + * @return true - if the player is charging up + * false - otherwise + */ + public boolean isChargingUp() { + return this.chargeUp; + } + /** * Checks if the player is in the teleport skill state * @return true - if the player is charging a teleport @@ -579,14 +636,14 @@ public boolean isRooted() { * Should be called when the player actions component registers invulnerability skill */ public void startInvulnerabilitySkill() { - if (cooldownFinished("invulnerable", (INVULNERABILITY_LENGTH * 3))) { + if (cooldownFinished(INVULNERABILITY_NAME, 10000)) { this.invulnerabilitySkill = true; skillAnimator.getEvents().trigger("invulnerabilityAnimation"); playerEntity.getEvents().trigger("invulnerabilityCountdown"); long invulnerabilityStart = System.currentTimeMillis(); this.invulnerabilitySkillEnd = invulnerabilityStart + INVULNERABILITY_LENGTH; setInvulnerable(INVULNERABILITY_LENGTH); - setSkillCooldown("invulnerable"); + setSkillCooldown(INVULNERABILITY_NAME); } } @@ -596,7 +653,7 @@ public void startInvulnerabilitySkill() { * @param moveDirection the direction of the players movement at the start of the dash event. */ public void startDash(Vector2 moveDirection) { - if (cooldownFinished("dash", (long) (DASH_LENGTH * 1.2))) { + if (cooldownFinished(DASH_NAME, 500)) { this.dashDirection = moveDirection; this.dashing = true; skillAnimator.getEvents().trigger("dashAnimation"); @@ -604,7 +661,7 @@ public void startDash(Vector2 moveDirection) { long dashStart = System.currentTimeMillis(); this.dashEnd = dashStart + DASH_LENGTH; setInvulnerable(DASH_LENGTH/2); - setSkillCooldown("dash"); + setSkillCooldown(DASH_NAME); } } @@ -613,13 +670,13 @@ public void startDash(Vector2 moveDirection) { * Should be called when player actions component registers teleport event. */ public void startTeleport() { - if (cooldownFinished("teleport", TELEPORT_COOLDOWN)) { + if (cooldownFinished(TELEPORT_NAME, TELEPORT_COOLDOWN)) { this.teleporting = true; skillAnimator.getEvents().trigger("teleportAnimation"); playerEntity.getEvents().trigger("teleportCountdown"); long teleportStart = System.currentTimeMillis(); this.teleportEnd = teleportStart + TELEPORT_CHARGE_LENGTH; - setSkillCooldown("teleport"); + setSkillCooldown(TELEPORT_NAME); } } @@ -628,7 +685,7 @@ public void startTeleport() { * Should be called when player actions component registers dodge event. */ public void startDodge(Vector2 moveDirection) { - if (cooldownFinished("dodge", DODGE_COOLDOWN)) { + if (cooldownFinished(DODGE_NAME, DODGE_COOLDOWN)) { this.dodgeDirection = moveDirection; this.dodging = true; skillAnimator.getEvents().trigger("dodgeAnimation"); @@ -636,7 +693,7 @@ public void startDodge(Vector2 moveDirection) { long dodgeStart = System.currentTimeMillis(); this.dodgeEnd = dodgeStart + DODGE_LENGTH; setInvulnerable(DODGE_LENGTH); - setSkillCooldown("dodge"); + setSkillCooldown(DODGE_NAME); } } @@ -645,14 +702,14 @@ public void startDodge(Vector2 moveDirection) { * Should be called when player actions component registers block event. */ public void startBlock() { - if (cooldownFinished("block", BLOCK_COOLDOWN)) { + if (cooldownFinished(BLOCK_NAME, BLOCK_COOLDOWN)) { this.blocking = true; skillAnimator.getEvents().trigger("blockAnimation"); playerEntity.getEvents().trigger("blockCountdown"); long blockStart = System.currentTimeMillis(); this.blockEnd = blockStart + BLOCK_LENGTH; setInvulnerable(BLOCK_LENGTH); - setSkillCooldown("block"); + setSkillCooldown(BLOCK_NAME); } } @@ -662,12 +719,16 @@ public void startBlock() { * Should be called when player actions component registers root event. */ public void startRoot() { - skillAnimator.getEvents().trigger("rootAnimation"); - playerEntity.getEvents().trigger("rootCountdown"); - this.rootAnimationRunning = true; - long rootStart = System.currentTimeMillis(); - this.rootAnimationEnd = rootStart + ROOT_ANIMATION_LENGTH; - this.rootApplied = true; + + if (cooldownFinished(ROOT_NAME, 5000)) { + skillAnimator.getEvents().trigger("rootAnimation"); + playerEntity.getEvents().trigger("rootCountdown"); + this.rootAnimationRunning = true; + long rootStart = System.currentTimeMillis(); + this.rootAnimationEnd = rootStart + ROOT_ANIMATION_LENGTH; + this.rootApplied = true; + setSkillCooldown(ROOT_NAME); + } } /** @@ -675,14 +736,14 @@ public void startRoot() { * Should be called when player actions component registers ultimate event. */ public void startUltimate() { - if (cooldownFinished("timestop", (long) (ULTIMATE_CHARGE_LENGTH * 3))) { + if (cooldownFinished(ULTIMATE_NAME, 20000)) { skillAnimator.getEvents().trigger("ultimateAnimation"); playerEntity.getEvents().trigger("ultimateCountdown"); chargingUltimate = true; long ultimateStart = System.currentTimeMillis(); this.ultimateChargeEnd = ultimateStart + ULTIMATE_CHARGE_LENGTH; this.ultimateTimeStopEnd = ultimateChargeEnd + ULTIMATE_TIMESTOP_LENGTH; - setSkillCooldown("timestop"); + setSkillCooldown(ULTIMATE_NAME); } } @@ -691,11 +752,14 @@ public void startUltimate() { * Should be called when player actions component registers projectile skill event. */ public void startProjectileSkill() { - if (cooldownFinished("projectile", 5000)) { + if (cooldownFinished(PROJECTILE_NAME, 5000)) { playerEntity.getEvents().trigger("wrenchCountdown"); if (ServiceLocator.getGameArea().getClass() == ForestGameArea.class) { ((ForestGameArea) ServiceLocator.getGameArea()).spawnPlayerProjectileCone(); + } else if (ServiceLocator.getGameArea().getClass() == UndergroundGameArea.class) { + ((UndergroundGameArea) ServiceLocator.getGameArea()).spawnPlayerProjectileSpray(); } + setSkillCooldown(PROJECTILE_NAME); } } @@ -704,13 +768,13 @@ public void startProjectileSkill() { * Should be called when player actions component registers ultimate event. */ public void startFireballUltimate() { - if (cooldownFinished("fireball", FIREBALL_CHARGE_LENGTH * 10)) { + if (cooldownFinished(FIREBALL_NAME, 20000)) { chargingUltimateFireball = true; skillAnimator.getEvents().trigger("fireballAnimation"); playerEntity.getEvents().trigger("fireballCountdown"); long ultimateStart = System.currentTimeMillis(); this.ultimateFireballChargeEnd = ultimateStart + FIREBALL_CHARGE_LENGTH; - setSkillCooldown("fireball"); + setSkillCooldown(FIREBALL_NAME); } } @@ -731,8 +795,15 @@ public void hitRoot(Entity target) { * Should be called when player actions component registers bleed event. */ public void startBleed() { - this.bleedApplied = true; - playerEntity.getEvents().trigger("bleedCountdown"); + if (cooldownFinished(BLEED_NAME, 5000)) { + this.bleedApplied = true; + playerEntity.getEvents().trigger("bleedCountdown"); + skillAnimator.getEvents().trigger("bleedAnimation"); + this.bleedAnimationRunning = true; + long bleedStartTime = System.currentTimeMillis(); + this.bleedAnimationEnd = bleedStartTime + BLEED_ANIMATION_LENGTH; + setSkillCooldown(BLEED_NAME); + } } /** @@ -777,20 +848,29 @@ public void checkBleed(Entity target) { */ public void teleportPlayer() { PlayerActions actions = playerEntity.getComponent(PlayerActions.class); - float teleportPositionX = playerEntity.getPosition().x + actions.getWalkDirection().x * TELEPORT_LENGTH; - float teleportPositionY = playerEntity.getPosition().y + actions.getWalkDirection().y * TELEPORT_LENGTH; - - // Check if teleport is out of map bounds - if (teleportPositionX < -0.08) - teleportPositionX = -0.08f; - if (teleportPositionY < 0.11) - teleportPositionY = 0.11f; - if (teleportPositionX > 24.18) - teleportPositionX = 24.18f; - if (teleportPositionY > 24.68) - teleportPositionY = 24.68f; - playerEntity.setPosition(teleportPositionX, teleportPositionY); - + Vector2 walkDirection = actions.getWalkDirection(); + if (walkDirection.x == 0 && walkDirection.y == 0) { + return; + } + float teleportPositionX = playerEntity.getPosition().x + walkDirection.x * TELEPORT_LENGTH; + float teleportPositionY = playerEntity.getPosition().y + walkDirection.y * TELEPORT_LENGTH; + Vector2 from = new Vector2(playerEntity.getPosition().x - walkDirection.x * 0.2f, + playerEntity.getPosition().y - walkDirection.y * 0.2f); + Vector2 fromCenter = playerEntity.getCenterPosition(); + Vector2 fromCenterEdges = new Vector2(fromCenter.x - walkDirection.x * 0.2f, + fromCenter.y - walkDirection.y * 0.2f); + Vector2 to = new Vector2(teleportPositionX, teleportPositionY); + + if (physics.raycast(from, to, PhysicsLayer.OBSTACLE, hit)) { + if (Math.abs(hit.point.x - fromCenter.x) < 0.75f && Math.abs(hit.point.y - fromCenter.y) < 0.75f) { + return; + } + playerEntity.setPosition(hit.point.x - walkDirection.x, hit.point.y - walkDirection.y); + } else if (walkDirection.x == 0 && physics.raycast(fromCenterEdges, to, PhysicsLayer.OBSTACLE, hit)) { + playerEntity.setPosition(hit.point.x - walkDirection.x, hit.point.y - walkDirection.y); + } else { + playerEntity.setPosition(to); + } } /** @@ -889,14 +969,13 @@ private void setInvulnerable(long invulnerableLength) { * @param slow true to slow enemy, false to return to normal speed */ private void changeSpeed(Entity target, long slowLength, boolean slow) { - if (slow) { + if (slow && !target.checkEntityType(EntityTypes.RANGED)) { target.getComponent(AITaskComponent.class).addTask (new ChaseTask(playerEntity, 50, 5f, 6f, 1f)); this.rooted = true; this.rootApplied = false; this.rootEnd = System.currentTimeMillis() + slowLength; - } else if (target != null){ - //target.getComponent(AITaskComponent.class).dispose(); + } else if (target != null && !target.checkEntityType(EntityTypes.RANGED)){ target.getComponent(AITaskComponent.class).getPriorityTasks().remove (target.getComponent(AITaskComponent.class).getPriorityTasks().size() - 1); } @@ -905,21 +984,30 @@ private void changeSpeed(Entity target, long slowLength, boolean slow) { /** * The functional start of the charge. * Should be called when player actions component registers charge event. - * @param moveDirection the direction of the players movement at the start of the charge event. */ - public void startCharge(Vector2 moveDirection) { - if (1 < 2) {//cooldown - this.chargeDirection = moveDirection; - this.charging = true; - this.chargeFirstHit = true; - skillAnimator.getEvents().trigger("dashAnimation"); + public void startCharge() { + if (cooldownFinished(CHARGE_NAME, 10000)) {//cooldown + this.chargeUp = true; + this.chargeUpEnd = System.currentTimeMillis() + CHARGE_UP_LENGTH; + skillAnimator.getEvents().trigger("chargeAnimation"); playerEntity.getEvents().trigger("chargeCountdown"); - this.chargeEnd = System.currentTimeMillis() + DASH_LENGTH; - setInvulnerable(DASH_LENGTH / 2); - setSkillCooldown("charge"); + setSkillCooldown(CHARGE_NAME); } } + /** + * Speeds up player movement for charge attack + */ + public void chargeMove() { + PlayerActions actions = playerEntity.getComponent(PlayerActions.class); + this.chargeDirection = actions.getWalkDirection(); + this.charging = true; + this.chargeFirstHit = true; + skillAnimator.getEvents().trigger("chargemoveAnimation"); + this.chargeEnd = System.currentTimeMillis() + DASH_LENGTH; + setInvulnerable(DASH_LENGTH / 2); + } + /** * Ensures enemy is not a projectile then sets entity enemy variable * @param target the first enemy the player collides with @@ -965,20 +1053,24 @@ private void chargeAttack(Entity target) { * Damages all enemies around player and knocks them back. */ public void aoeAttack() { - if (cooldownFinished("aoe", AOE_ANIMATION_LENGTH * 10)) { + if (cooldownFinished(AOE_NAME, 5000)) { long aoeStart = System.currentTimeMillis(); this.aoeAnimationEnd = aoeStart + AOE_ANIMATION_LENGTH; skillAnimator.getEvents().trigger("aoeAnimation"); playerEntity.getEvents().trigger("aoeCountdown"); this.aoeAnimationRunning = true; + Entity projectile; if (ServiceLocator.getGameArea().getClass() == ForestGameArea.class) { - Entity projectile = ((ForestGameArea) ServiceLocator.getGameArea()).spawnPlayerAOE(); + projectile = ((ForestGameArea) ServiceLocator.getGameArea()).spawnPlayerAOE(); ForestGameArea.removeProjectileOnMap(projectile); - if (projectile.getComponent(AnimationRenderComponent.class) != null) { - projectile.getComponent(AnimationRenderComponent.class).stopAnimation(); - } + } else { + projectile = ((UndergroundGameArea) ServiceLocator.getGameArea()).spawnPlayerAOE(); + UndergroundGameArea.removeProjectileOnMap(projectile); + } + if (projectile.getComponent(AnimationRenderComponent.class) != null) { + projectile.getComponent(AnimationRenderComponent.class).stopAnimation(); } - setSkillCooldown("aoe"); + setSkillCooldown(AOE_NAME); } } } diff --git a/source/core/src/main/com/deco2800/game/components/player/PlayerTouchAttackComponent.java b/source/core/src/main/com/deco2800/game/components/player/PlayerTouchAttackComponent.java index 9b67a04ef..511161dc6 100644 --- a/source/core/src/main/com/deco2800/game/components/player/PlayerTouchAttackComponent.java +++ b/source/core/src/main/com/deco2800/game/components/player/PlayerTouchAttackComponent.java @@ -4,7 +4,7 @@ import com.badlogic.gdx.physics.box2d.Fixture; import com.deco2800.game.areas.ForestGameArea; import com.deco2800.game.areas.UndergroundGameArea; -import com.deco2800.game.components.combatitemsComponents.*; +import com.deco2800.game.components.combatitemscomponents.*; import com.deco2800.game.components.CombatStatsComponent; import com.deco2800.game.components.TouchAttackComponent; import com.deco2800.game.entities.Entity; @@ -76,77 +76,44 @@ public Entity getCombatAnimator() { } /** - * Method called when the player entity is attacking. + * Method called when the player entity is attacking. This is the main attack function which calls subsequent related functions */ void attackEnemy() { if (canAttack) { - canAttack = false; // base damage variable for the logger double damage = entity.getComponent(CombatStatsComponent.class).getDamageReduction(); + + //set weapon and aura entities Entity weaponEquipped = entity.getComponent(InventoryComponent.class).getEquipable(0); Entity auraEquipped = ServiceLocator.getGameArea().getPlayer().getComponent(WeaponAuraManager.class).auraApplied; + if (weaponEquipped != null) { if (weaponEquipped.getComponent(PhysicalWeaponStatsComponent.class) != null) { - cooldownEnd = (long) (System.currentTimeMillis() + weaponEquipped.getComponent(PhysicalWeaponStatsComponent.class).getCoolDown()); + attackWithPhysicalWeapon(weaponEquipped, auraEquipped); // set the damage value for logger damage = weaponEquipped.getComponent(PhysicalWeaponStatsComponent.class).getDamage(); - //Sets the attackEnemy animation dependent on the weapon that is currently equipped - String description = weaponEquipped.getComponent(PhysicalWeaponStatsComponent.class).getDescription(); - //When an aura is applied, play the respective aura animation - String animationDesc; - if (auraEquipped != null) { - String currentAura = auraEquipped.getComponent(WeaponAuraComponent.class).getDescription(); - animationDesc = description+currentAura; - } - else { - animationDesc = description; - } - combatAnimator.getEvents().trigger(animationDesc); } } else { - cooldownEnd = (System.currentTimeMillis() + 4000); //cooldown when no weapon equipped - } - - //play physical weapon sounds - if (weaponEquipped == null) { - Sound attackSound = ServiceLocator.getResourceService().getAsset("sounds/Impact4.ogg", Sound.class); - attackSound.play(); - } - else if (weaponEquipped.checkEntityType(EntityTypes.MELEE) - && weaponEquipped.getComponent(PhysicalWeaponStatsComponent.class).getDescription().equals("plunger")) { - Sound attackSound = ServiceLocator.getResourceService().getAsset("sounds/combatitems/plungerSound.mp3", Sound.class); - attackSound.play(); - } else if (weaponEquipped.checkEntityType(EntityTypes.MELEE)) { - Sound attackSound = ServiceLocator.getResourceService().getAsset("sounds/combatitems/metalSword.wav", Sound.class); - attackSound.play(); + attackWithNoWeapon(); } + //check for collision if (enemyCollide) { applyDamageToTarget(target); entity.getEvents().trigger("hitEnemy", target); // for skill listener - String sDamage = String.valueOf(damage); - logger.trace("attackEnemy enemy: %s".formatted(sDamage)); - } - - else if (weaponEquipped != null && weaponEquipped.checkEntityType(EntityTypes.RANGED)) { - //play ranged weapon sounds - Sound attackSound = ServiceLocator.getResourceService().getAsset("sounds/combatitems/rangeWeaponSound.mp3", Sound.class); - attackSound.play(); - - if (ServiceLocator.getGameArea() instanceof ForestGameArea forestgamearea) { - (forestgamearea).spawnWeaponProjectile(); - } - else if (ServiceLocator.getGameArea() instanceof UndergroundGameArea undergroundgamearea){ - (undergroundgamearea).spawnWeaponProjectile(); - } + logger.trace("attackEnemy enemy: {} ",damage); } + playAttackSounds(weaponEquipped); } } + /** + * Method called to check if the player can attack + */ public void checkCanAttack() { if (System.currentTimeMillis() > cooldownEnd) { canAttack = true; @@ -154,6 +121,86 @@ public void checkCanAttack() { } } + /** + * Plays attack sounds for combat weapons dependent on the weapon in hand + * @param weaponEquipped The entity representing the weapon the player is currently holding + */ + public void playAttackSounds(Entity weaponEquipped) { + //play physical weapon sounds + if (weaponEquipped == null) { + Sound attackSound = ServiceLocator.getResourceService().getAsset("sounds/Impact4.ogg", Sound.class); + attackSound.play(); + } + else if (weaponEquipped.checkEntityType(EntityTypes.MELEE) + && weaponEquipped.getComponent(PhysicalWeaponStatsComponent.class).getDescription().equals("plunger")) { + Sound attackSound = ServiceLocator.getResourceService().getAsset("sounds/combatitems/plungerSound.mp3", Sound.class); + attackSound.play(); + } else if (weaponEquipped.checkEntityType(EntityTypes.MELEE)) { + Sound attackSound = ServiceLocator.getResourceService().getAsset("sounds/combatitems/metalSword.wav", Sound.class); + attackSound.play(); + } + //play ranged weapon sounds + else if (weaponEquipped.checkEntityType(EntityTypes.RANGED)) { + Sound attackSound = ServiceLocator.getResourceService().getAsset("sounds/combatitems/rangeWeaponSound.mp3", Sound.class); + attackSound.play(); + } + + } + + /** + * Plays attack animation dependent on weapon in hand + * @param weaponEquipped The entity representing the weapon the player is currently holding + * @param auraEquipped The entity representing the aura that is currently active + */ + public void playAttackAnimation(Entity weaponEquipped, Entity auraEquipped){ + //Sets the attackEnemy animation dependent on the weapon that is currently equipped + String description = weaponEquipped.getComponent(PhysicalWeaponStatsComponent.class).getDescription(); + //When an aura is applied, play the respective aura animation + String animationDesc; + if (auraEquipped != null) { + String currentAura = auraEquipped.getComponent(WeaponAuraComponent.class).getDescription(); + animationDesc = description+currentAura; + } + else { + animationDesc = description; + } + combatAnimator.getEvents().trigger(animationDesc); + } + + /** + * Method to set attack cooldown and trigger attack animation dependent on the weapon and aura equipped + * @param weaponEquipped The entity representing the weapon the player is currently holding + * @param auraEquipped The entity representing the aura that is currently active + */ + public void attackWithPhysicalWeapon(Entity weaponEquipped, Entity auraEquipped) { + cooldownEnd = (long) (System.currentTimeMillis() + weaponEquipped.getComponent(PhysicalWeaponStatsComponent.class).getCoolDown()); + playAttackAnimation(weaponEquipped, auraEquipped); + + //check if ranged + if (weaponEquipped.checkEntityType(EntityTypes.RANGED)) { + attackRanged(); + } + } + + /** + * Method which sets the base cooldown to 4 seconds when attack with a fist + */ + public void attackWithNoWeapon(){ + cooldownEnd = (System.currentTimeMillis() + 4000); //cooldown when no weapon equipped + } + + /** + * Method triggered when the player is holding a ranged weapon, which creates the projectiles on the map + */ + public void attackRanged() { + if (ServiceLocator.getGameArea() instanceof ForestGameArea forestgamearea) { + (forestgamearea).spawnWeaponProjectile(); + } + else if (ServiceLocator.getGameArea() instanceof UndergroundGameArea undergroundgamearea){ + (undergroundgamearea).spawnWeaponProjectile(); + } + } + /** * Applies damage to a given enemy target * @param target the target enemy entity to do damage to diff --git a/source/core/src/main/com/deco2800/game/components/player/QuickBarDisplay.java b/source/core/src/main/com/deco2800/game/components/player/QuickBarDisplay.java index 9a7d54ba3..25586cb5e 100644 --- a/source/core/src/main/com/deco2800/game/components/player/QuickBarDisplay.java +++ b/source/core/src/main/com/deco2800/game/components/player/QuickBarDisplay.java @@ -29,7 +29,7 @@ public void create() { /** * This function visualizes potions in the item bar when equipped from the inventory. */ - private void addActors() { + private static void addActors() { potions = new Group(); Image quickBarImage = new Image(new Texture("images/Inventory/quickbar_sprint3.png")); quickBarImage.setSize(382,175); @@ -38,8 +38,14 @@ private void addActors() { stage.addActor(potions); } + /** + * Draw the quick bar by default UI behavior + * @param batch Batch to render to. + * //Intentionally blank method + */ @Override - public void draw(SpriteBatch batch) {} + public void draw(SpriteBatch batch) { + } public static void updatePotionTable() { @@ -54,14 +60,6 @@ public static void updatePotionTable() { potions.addActor(potion); } - - /*for (int i = 0; i < potionImages.size(); i++) { - Image potion = potionImages.get(i); - potionTable.add(potion).size(64, 64); - potion.setPosition(845 + i * 100, 60); - } - stage.addActor(potionTable);*/ - } @Override diff --git a/source/core/src/main/com/deco2800/game/components/tasks/JumpTask.java b/source/core/src/main/com/deco2800/game/components/tasks/JumpTask.java index ac141de59..f643bd2ca 100644 --- a/source/core/src/main/com/deco2800/game/components/tasks/JumpTask.java +++ b/source/core/src/main/com/deco2800/game/components/tasks/JumpTask.java @@ -50,7 +50,7 @@ public JumpTask(Entity target, int priority, float attackRange, float glidingSpe this.knockBackForce = knockBackForce; this.glidingSpeed = glidingSpeed; gameTime = ServiceLocator.getTimeSource(); - lastJumpTime = gameTime.getTime() + 1000f; + this.lastJumpTime = gameTime.getTime() + 1000f; physics = ServiceLocator.getPhysicsService().getPhysics(); debugRenderer = ServiceLocator.getRenderService().getDebug(); } diff --git a/source/core/src/main/com/deco2800/game/components/tasks/ProjectileTask.java b/source/core/src/main/com/deco2800/game/components/tasks/ProjectileTask.java index 81106d130..7bb08c5c4 100644 --- a/source/core/src/main/com/deco2800/game/components/tasks/ProjectileTask.java +++ b/source/core/src/main/com/deco2800/game/components/tasks/ProjectileTask.java @@ -2,7 +2,6 @@ import com.badlogic.gdx.math.Vector2; import com.deco2800.game.ai.tasks.DefaultTask; import com.deco2800.game.ai.tasks.PriorityTask; -import com.deco2800.game.components.npc.EnemyProjectileComponent; import com.deco2800.game.entities.factories.EntityTypes; import com.deco2800.game.physics.PhysicsEngine; import com.deco2800.game.physics.PhysicsLayer; @@ -113,9 +112,9 @@ public void shoot(String projectileType) { projectile = createDiscus(owner.getEntity(), target); } if (owner.getEntity().checkEntityType(EntityTypes.MEGAPOOP)) { - Entity projectile = createPoopsSludge(owner.getEntity(), target); - ServiceLocator.getEntityService().register(projectile); - projectile.setPosition(owner.getEntity().getPosition().x - 0.5f, owner.getEntity().getPosition().y - 0.5f); + Entity projectile1 = createPoopsSludge(owner.getEntity(), target); + ServiceLocator.getEntityService().register(projectile1); + projectile1.setPosition(owner.getEntity().getPosition().x - 0.5f, owner.getEntity().getPosition().y - 0.5f); Entity projectile2 = createPoopsSludge(owner.getEntity(), target); ServiceLocator.getEntityService().register(projectile2); diff --git a/source/core/src/main/com/deco2800/game/crafting/CraftingLogic.java b/source/core/src/main/com/deco2800/game/crafting/CraftingLogic.java index 653824289..4761e2fae 100644 --- a/source/core/src/main/com/deco2800/game/crafting/CraftingLogic.java +++ b/source/core/src/main/com/deco2800/game/crafting/CraftingLogic.java @@ -1,8 +1,8 @@ package com.deco2800.game.crafting; import com.deco2800.game.entities.Entity; -import com.deco2800.game.entities.configs.combatitemsConfig.WeaponConfig; -import com.deco2800.game.entities.configs.combatitemsConfig.WeaponConfigSetup; +import com.deco2800.game.entities.configs.combatitemsconfig.WeaponConfig; +import com.deco2800.game.entities.configs.combatitemsconfig.WeaponConfigSetup; import com.deco2800.game.entities.factories.WeaponFactory; import com.deco2800.game.files.FileLoader; diff --git a/source/core/src/main/com/deco2800/game/crafting/CraftingSystem.java b/source/core/src/main/com/deco2800/game/crafting/CraftingSystem.java index 11984e162..b34cfeaf8 100644 --- a/source/core/src/main/com/deco2800/game/crafting/CraftingSystem.java +++ b/source/core/src/main/com/deco2800/game/crafting/CraftingSystem.java @@ -1,6 +1,6 @@ package com.deco2800.game.crafting; -import com.deco2800.game.entities.configs.combatitemsConfig.WeaponConfigSetup; +import com.deco2800.game.entities.configs.combatitemsconfig.WeaponConfigSetup; import com.deco2800.game.files.FileLoader; import java.util.*; diff --git a/source/core/src/main/com/deco2800/game/entities/Entity.java b/source/core/src/main/com/deco2800/game/entities/Entity.java index daceaa4f3..fef6042cc 100644 --- a/source/core/src/main/com/deco2800/game/entities/Entity.java +++ b/source/core/src/main/com/deco2800/game/entities/Entity.java @@ -1,5 +1,6 @@ package com.deco2800.game.entities; +import com.badlogic.gdx.math.GridPoint2; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.IntMap; @@ -44,6 +45,7 @@ public class Entity { private boolean enabled = true; private boolean created = false; private Vector2 position = Vector2.Zero.cpy(); + private GridPoint2 gridPosition; private Vector2 scale = new Vector2(1, 1); private Array createdComponents; private boolean isDead = false; @@ -68,6 +70,15 @@ public void setEnabled(boolean enabled) { this.enabled = enabled; } + /** + * Get the entity's game grid position. + * + * @return position + */ + public GridPoint2 getGridPosition() { + return gridPosition; // Cpy gives us pass-by-value to prevent bugs + } + /** * Get the entity's game position. * @@ -77,6 +88,13 @@ public Vector2 getPosition() { return position.cpy(); // Cpy gives us pass-by-value to prevent bugs } + /** + * Set the entity's game grid position. + */ + public void setGridPosition(GridPoint2 position) { + this.gridPosition = position; + } + /** * Set the entity's game position. * diff --git a/source/core/src/main/com/deco2800/game/entities/configs/BaseEntityConfig.java b/source/core/src/main/com/deco2800/game/entities/configs/BaseEntityConfig.java index c8d34b2a2..92a5c85b4 100644 --- a/source/core/src/main/com/deco2800/game/entities/configs/BaseEntityConfig.java +++ b/source/core/src/main/com/deco2800/game/entities/configs/BaseEntityConfig.java @@ -4,7 +4,7 @@ * Defines a basic set of properties stored in entities config files to be loaded by Entity Factories. */ public class BaseEntityConfig { - public int health = 30; + public int health = 100; public int stamina = 1; public int baseAttack = 5; public int mana= 20; diff --git a/source/core/src/main/com/deco2800/game/entities/configs/GymBroConfig.java b/source/core/src/main/com/deco2800/game/entities/configs/GymBroConfig.java index aa542c8c7..5ab148b3e 100644 --- a/source/core/src/main/com/deco2800/game/entities/configs/GymBroConfig.java +++ b/source/core/src/main/com/deco2800/game/entities/configs/GymBroConfig.java @@ -7,7 +7,7 @@ * The statistics that make up the configuration of the Atlantis Citizen enemy. */ public class GymBroConfig extends BaseEntityConfig { - public static final float speed = 2f; - public static final int baseAttackGymBro = 5; - public static final int healthGymBro = 70; + public static final float SPEED = 2f; + public static final int BASEATTACKGYMBRO = 5; + public static final int HEALTHGYMBRO = 70; } \ No newline at end of file diff --git a/source/core/src/main/com/deco2800/game/entities/configs/HeraclesConfig.java b/source/core/src/main/com/deco2800/game/entities/configs/HeraclesConfig.java index 5538003c2..9d4a76130 100644 --- a/source/core/src/main/com/deco2800/game/entities/configs/HeraclesConfig.java +++ b/source/core/src/main/com/deco2800/game/entities/configs/HeraclesConfig.java @@ -4,8 +4,8 @@ * The statistics that make up the configuration of Heracles, the level 1 boss. */ public class HeraclesConfig extends BaseEntityConfig { - public static final int healthHeracles = 10; - public static final int baseAttackHeracles = 10; - public static final float speed = 2f; + public static final int HEALTHHERACLES = 100; + public static final int BASEATTACKHERACLES = 10; + public static final float SPEED = 2f; } diff --git a/source/core/src/main/com/deco2800/game/entities/configs/MegaPoopConfig.java b/source/core/src/main/com/deco2800/game/entities/configs/MegaPoopConfig.java index b7b9cff41..4b9d6f6d2 100644 --- a/source/core/src/main/com/deco2800/game/entities/configs/MegaPoopConfig.java +++ b/source/core/src/main/com/deco2800/game/entities/configs/MegaPoopConfig.java @@ -4,5 +4,5 @@ * The statistics that make up the configuration of Mega Poop, the level 2 boss. */ public class MegaPoopConfig extends BaseEntityConfig { - public static final float speed = 100f; + public static final float SPEED = 100f; } diff --git a/source/core/src/main/com/deco2800/game/entities/configs/PoopsConfig.java b/source/core/src/main/com/deco2800/game/entities/configs/PoopsConfig.java index f57da08f1..7700a9aef 100644 --- a/source/core/src/main/com/deco2800/game/entities/configs/PoopsConfig.java +++ b/source/core/src/main/com/deco2800/game/entities/configs/PoopsConfig.java @@ -7,7 +7,7 @@ * The statistics that make up the configuration of Poops, level 2 ranged enemy */ public class PoopsConfig extends BaseEntityConfig { - public static final int healthPoops = 60; - public static final float speed = 1f; + public static final int HEALTHPOOPS = 60; + public static final float SPEED = 1f; } diff --git a/source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/AuraConfig.java b/source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/AuraConfig.java similarity index 84% rename from source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/AuraConfig.java rename to source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/AuraConfig.java index 44ebe8aa8..389761050 100644 --- a/source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/AuraConfig.java +++ b/source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/AuraConfig.java @@ -1,4 +1,4 @@ -package com.deco2800.game.entities.configs.combatitemsConfig; +package com.deco2800.game.entities.configs.combatitemsconfig; /** diff --git a/source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/BaseAuraConfig.java b/source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/BaseAuraConfig.java similarity index 84% rename from source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/BaseAuraConfig.java rename to source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/BaseAuraConfig.java index ab51cea09..88bb3a55e 100644 --- a/source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/BaseAuraConfig.java +++ b/source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/BaseAuraConfig.java @@ -1,4 +1,4 @@ -package com.deco2800.game.entities.configs.combatitemsConfig; +package com.deco2800.game.entities.configs.combatitemsconfig; /** * Defines all Aura configs to be loaded by the Aura Factory. diff --git a/source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/WeaponConfig.java b/source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/WeaponConfig.java similarity index 86% rename from source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/WeaponConfig.java rename to source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/WeaponConfig.java index 54b75072e..99ceb1607 100644 --- a/source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/WeaponConfig.java +++ b/source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/WeaponConfig.java @@ -1,4 +1,4 @@ -package com.deco2800.game.entities.configs.combatitemsConfig; +package com.deco2800.game.entities.configs.combatitemsconfig; import com.deco2800.game.crafting.Materials; diff --git a/source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/WeaponConfigSetup.java b/source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/WeaponConfigSetup.java similarity index 91% rename from source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/WeaponConfigSetup.java rename to source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/WeaponConfigSetup.java index f94afc7fc..c7f080ed7 100644 --- a/source/core/src/main/com/deco2800/game/entities/configs/combatitemsConfig/WeaponConfigSetup.java +++ b/source/core/src/main/com/deco2800/game/entities/configs/combatitemsconfig/WeaponConfigSetup.java @@ -1,4 +1,4 @@ -package com.deco2800.game.entities.configs.combatitemsConfig; +package com.deco2800.game.entities.configs.combatitemsconfig; /** diff --git a/source/core/src/main/com/deco2800/game/entities/factories/ArmourFactory.java b/source/core/src/main/com/deco2800/game/entities/factories/ArmourFactory.java index 2ff48abf2..2b19529ff 100644 --- a/source/core/src/main/com/deco2800/game/entities/factories/ArmourFactory.java +++ b/source/core/src/main/com/deco2800/game/entities/factories/ArmourFactory.java @@ -98,7 +98,7 @@ private static String getTexture (ArmourType type) { texturePath = "images/Armour-assets-sprint2/slowDiamond.png"; break; case darkArmour: - texturePath = "images/Armour-assets-sprint2/baseArmour.png"; + texturePath = "images/Armour-assets-sprint2/Dark_Armour.png"; break; default: texturePath = "images/Armour-assets-sprint2/baseArmour.png"; diff --git a/source/core/src/main/com/deco2800/game/entities/factories/AuraFactory.java b/source/core/src/main/com/deco2800/game/entities/factories/AuraFactory.java index 968ef6903..1e2e016e6 100644 --- a/source/core/src/main/com/deco2800/game/entities/factories/AuraFactory.java +++ b/source/core/src/main/com/deco2800/game/entities/factories/AuraFactory.java @@ -3,11 +3,11 @@ import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.physics.box2d.BodyDef; -import com.deco2800.game.components.combatitemsComponents.AuraPickupComponent; -import com.deco2800.game.components.combatitemsComponents.WeaponAuraComponent; +import com.deco2800.game.components.combatitemscomponents.AuraPickupComponent; +import com.deco2800.game.components.combatitemscomponents.WeaponAuraComponent; import com.deco2800.game.entities.Entity; -import com.deco2800.game.entities.configs.combatitemsConfig.AuraConfig; -import com.deco2800.game.entities.configs.combatitemsConfig.BaseAuraConfig; +import com.deco2800.game.entities.configs.combatitemsconfig.AuraConfig; +import com.deco2800.game.entities.configs.combatitemsconfig.BaseAuraConfig; import com.deco2800.game.files.FileLoader; diff --git a/source/core/src/main/com/deco2800/game/entities/factories/NPCFactory.java b/source/core/src/main/com/deco2800/game/entities/factories/NPCFactory.java index 1ed66e9a5..e2b470290 100644 --- a/source/core/src/main/com/deco2800/game/entities/factories/NPCFactory.java +++ b/source/core/src/main/com/deco2800/game/entities/factories/NPCFactory.java @@ -273,7 +273,7 @@ public static Entity createGymBro(Entity target) { gymBro.getComponent(AITaskComponent.class) .addTask(new WanderTask(new Vector2(2f, 2f), 2f)) - .addTask(new ChaseTask(target, 10, 5f, 6f, config.speed)) + .addTask(new ChaseTask(target, 10, 5f, 6f, config.SPEED)) .addTask(new DeadTask(target, 15)); AnimationRenderComponent animator = @@ -295,7 +295,7 @@ public static Entity createGymBro(Entity target) { gymBro - .addComponent(new CombatStatsComponent(config.healthGymBro, config.baseAttackGymBro, config.stamina, config.mana)) + .addComponent(new CombatStatsComponent(config.HEALTHGYMBRO, config.BASEATTACKGYMBRO, config.stamina, config.mana)) .addComponent(animator) .addComponent(new GymBroAnimationController()) .addComponent(new EnemyExperienceComponent(1)); @@ -319,8 +319,8 @@ public static Entity createHeracles(Entity target) { heracles.getComponent(AITaskComponent.class) .addTask(new WanderTask(new Vector2(2f, 2f), 2f)) - .addTask(new ProjectileTask(target, projectileType, 10, 5f, 6f,config.speed, 2f)) - .addTask(new JumpTask(target, 11, 8f,19f, 1.5f)) + .addTask(new ProjectileTask(target, projectileType, 10, 5f, 6f,config.SPEED, 2f)) + .addTask(new JumpTask(target, 10, 8f,19f, 1.5f)) .addTask(new DeadTask(target,15)); AnimationRenderComponent animator = @@ -346,7 +346,7 @@ public static Entity createHeracles(Entity target) { heracles - .addComponent(new CombatStatsComponent(config.healthHeracles, config.baseAttackHeracles, config.stamina, config.mana)) + .addComponent(new CombatStatsComponent(config.HEALTHHERACLES, config.BASEATTACKHERACLES, config.stamina, config.mana)) .addComponent(animator) .addComponent(new HeraclesAnimationController()) .addComponent(new EnemyExperienceComponent(1)); @@ -367,7 +367,7 @@ public static Entity createPoops(Entity target) { PoopsConfig config = new NPCConfigs().poops; String projectileType = "poopSludge"; poops.getComponent(AITaskComponent.class) - .addTask(new ProjectileTask(target, projectileType, 10, 5f, 6f,config.speed, 2f)) + .addTask(new ProjectileTask(target, projectileType, 10, 5f, 6f,config.SPEED, 2f)) .addTask(new WanderTask(new Vector2(2f, 2f), 2f)) .addTask(new DeadTask(target, 15)); @@ -385,7 +385,7 @@ public static Entity createPoops(Entity target) { animator.addAnimation(VANISH_RIGHT, 0.1f, Animation.PlayMode.LOOP); poops - .addComponent(new CombatStatsComponent(config.healthPoops, config.baseAttack, config.stamina, config.mana)) + .addComponent(new CombatStatsComponent(config.HEALTHPOOPS, config.baseAttack, config.stamina, config.mana)) .addComponent(animator) .addComponent(new PoopAnimationController()) .addComponent(new EnemyExperienceComponent(1)); @@ -409,7 +409,7 @@ public static Entity createMegaPoop(Entity target) { megaPoop.getComponent(AITaskComponent.class) .addTask(new WanderTask(new Vector2(2f, 2f), 2f)) .addTask(new TransportTask(target, 10, 10f)) - .addTask(new ProjectileTask(target, projectileType, 10, 5f, 6f,config.speed, 2f)) + .addTask(new ProjectileTask(target, projectileType, 10, 5f, 6f,config.SPEED, 2f)) .addTask(new DeadTask(target, 15)); AnimationRenderComponent animator = diff --git a/source/core/src/main/com/deco2800/game/entities/factories/PlayerFactory.java b/source/core/src/main/com/deco2800/game/entities/factories/PlayerFactory.java index 5c3129108..401dcdc37 100644 --- a/source/core/src/main/com/deco2800/game/entities/factories/PlayerFactory.java +++ b/source/core/src/main/com/deco2800/game/entities/factories/PlayerFactory.java @@ -2,8 +2,8 @@ import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.graphics.g2d.TextureAtlas; -import com.deco2800.game.components.combatitemsComponents.BuffDisplayComponent; -import com.deco2800.game.components.combatitemsComponents.WeaponAuraManager; +import com.deco2800.game.components.combatitemscomponents.BuffDisplayComponent; +import com.deco2800.game.components.combatitemscomponents.WeaponAuraManager; import com.deco2800.game.components.CombatStatsComponent; import com.deco2800.game.components.maingame.PauseMenuActions; import com.deco2800.game.components.npc.DialogueDisplay; @@ -83,8 +83,8 @@ public static Entity createPlayer() { player.getComponent(AnimationRenderComponent.class).scaleEntity(); player.setEntityType(EntityTypes.PLAYER); - /*//FOR TESTING - player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createPlunger()); + //FOR TESTING + /*player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createPlunger()); player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createSwordLvl2()); player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createDagger()); player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createHera()); @@ -93,8 +93,8 @@ public static Entity createPlayer() { player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createPipe()); player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createTridentLvl2()); player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createPlunger()); - player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createPlungerBow());*/ - player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createGoldenPlungerBow()); + player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createPlungerBow()); + player.getComponent(InventoryComponent.class).addItem(WeaponFactory.createGoldenPlungerBow());*/ return player; } @@ -131,6 +131,10 @@ public static Entity createSkillAnimator(Entity playerEntity) { animator.addAnimation("invulnerability", 0.1f, Animation.PlayMode.LOOP); animator.addAnimation("fireballUltimate", 0.1f, Animation.PlayMode.NORMAL); animator.addAnimation("aoe", 0.05f, Animation.PlayMode.LOOP); + animator.addAnimation("charge", 0.1f, Animation.PlayMode.LOOP); + animator.addAnimation("chargemove", 0.03f, Animation.PlayMode.LOOP); + animator.addAnimation("bleed", 0.1f, Animation.PlayMode.LOOP); + animator.addAnimation("root", 0.1f, Animation.PlayMode.LOOP); Entity skillAnimator = new Entity().addComponent(animator) @@ -264,6 +268,9 @@ public static Entity createCombatAnimator(Entity playerEntity) { animator.addAnimation("plungerBowSpeedStatic", 0.1f, Animation.PlayMode.LOOP); animator.addAnimation("plungerBowStatic", 0.1f); + /*golden plunger bow animations*/ + animator.addAnimation("goldenPlungerBow", 0.1f); + Entity combatAnimator = new Entity().addComponent(animator) .addComponent(new PlayerCombatAnimationController(playerEntity)); diff --git a/source/core/src/main/com/deco2800/game/entities/factories/PotionFactory.java b/source/core/src/main/com/deco2800/game/entities/factories/PotionFactory.java index e074070cf..0fa842749 100644 --- a/source/core/src/main/com/deco2800/game/entities/factories/PotionFactory.java +++ b/source/core/src/main/com/deco2800/game/entities/factories/PotionFactory.java @@ -129,6 +129,16 @@ public static Entity createTestHealthPotion() { return potion; } + /** + * Creates health regen potion without rendering Component. + * @return health regen potion for testing purposes + */ + public static Entity createTestHealthRegenPotion() { + Entity potion = createBasePotion() + .addComponent(new PotionEffectComponent(PhysicsLayer.PLAYER, "health")); + return potion; + } + /** * made to hold images of different potions' image location. */ diff --git a/source/core/src/main/com/deco2800/game/entities/factories/ProjectileFactory.java b/source/core/src/main/com/deco2800/game/entities/factories/ProjectileFactory.java index a77c28e9b..6144a83c4 100644 --- a/source/core/src/main/com/deco2800/game/entities/factories/ProjectileFactory.java +++ b/source/core/src/main/com/deco2800/game/entities/factories/ProjectileFactory.java @@ -3,8 +3,8 @@ import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.math.Vector2; -import com.deco2800.game.components.combatitemsComponents.WeaponArrowProjectileComponent; -import com.deco2800.game.components.combatitemsComponents.PhysicalWeaponStatsComponent; +import com.deco2800.game.components.combatitemscomponents.WeaponArrowProjectileComponent; +import com.deco2800.game.components.combatitemscomponents.PhysicalWeaponStatsComponent; import com.deco2800.game.components.CombatStatsComponent; import com.deco2800.game.components.TouchAttackComponent; import com.deco2800.game.components.npc.EnemyProjectileComponent; @@ -12,7 +12,7 @@ import com.deco2800.game.components.player.PlayerActions; import com.deco2800.game.components.player.PlayerSkillProjectileComponent; import com.deco2800.game.entities.Entity; -import com.deco2800.game.entities.configs.combatitemsConfig.WeaponConfigSetup; +import com.deco2800.game.entities.configs.combatitemsconfig.WeaponConfigSetup; import com.deco2800.game.files.FileLoader; import com.deco2800.game.physics.PhysicsLayer; import com.deco2800.game.physics.PhysicsUtils; @@ -319,42 +319,18 @@ public static Entity createPlayerAOE(Entity player, double angle) { PhysicsComponent physicsComponent = new PhysicsComponent(); PlayerSkillProjectileComponent playerSkillProjectileComponent = new PlayerSkillProjectileComponent(); - AnimationRenderComponent projectileAnimator = new AnimationRenderComponent( - ServiceLocator.getResourceService().getAsset("images/Skills/projectileSprites.atlas", - TextureAtlas.class)); - projectileAnimator.addAnimation("upright",0.2f, Animation.PlayMode.LOOP); - projectileAnimator.addAnimation("right",0.2f, Animation.PlayMode.LOOP); - projectileAnimator.addAnimation("downright",0.2f, Animation.PlayMode.LOOP); - projectileAnimator.addAnimation("down",0.2f, Animation.PlayMode.LOOP); - projectileAnimator.addAnimation("downleft",0.2f, Animation.PlayMode.LOOP); - projectileAnimator.addAnimation("left",0.2f, Animation.PlayMode.LOOP); - projectileAnimator.addAnimation("upleft",0.2f, Animation.PlayMode.LOOP); - projectileAnimator.addAnimation("up",0.2f, Animation.PlayMode.LOOP); - Entity projectile = new Entity() .addComponent(physicsComponent) .addComponent(new ColliderComponent().setLayer(PhysicsLayer.NONE)) .addComponent(new HitboxComponent().setLayer(PhysicsLayer.NPC)) .addComponent(new TouchAttackComponent(PhysicsLayer.NPC, 150.0f)) .addComponent(new CombatStatsComponent(100000, 0, 0, 0)) - .addComponent(projectileAnimator) .addComponent(playerSkillProjectileComponent); projectile.setScale(4, 4); PhysicsUtils.setScaledCollider(projectile, 1, 1); - //projectile.getComponent(AnimationRenderComponent.class).scaleEntity(); projectile.setEntityType(EntityTypes.PROJECTILE); - - PlayerActions playerActions = player.getComponent(PlayerActions.class); - if(playerActions.getWalkDirection().cpy().x == 0 && playerActions.getWalkDirection().cpy().y == 0) { - playerSkillProjectileComponent.setProjectileDirection(new Vector2(1, 0).scl(0.001f)); - projectileAnimator.startAnimation("right"); - } else { - double angleRadians = angle * Math.PI; - Vector2 rotatedVector = rotateVector(playerActions.getWalkDirection().cpy(), angleRadians); - setAnimationDirection(getVectorAngle(rotatedVector.cpy()), projectileAnimator); - playerSkillProjectileComponent.setProjectileDirection(rotatedVector.cpy().scl(0.001f)); - } + playerSkillProjectileComponent.setProjectileDirection(new Vector2(1, 0).scl(0.001f)); return projectile; } } \ No newline at end of file diff --git a/source/core/src/main/com/deco2800/game/entities/factories/WeaponFactory.java b/source/core/src/main/com/deco2800/game/entities/factories/WeaponFactory.java index 8278fa045..b0b2600de 100644 --- a/source/core/src/main/com/deco2800/game/entities/factories/WeaponFactory.java +++ b/source/core/src/main/com/deco2800/game/entities/factories/WeaponFactory.java @@ -2,11 +2,11 @@ import com.badlogic.gdx.physics.box2d.BodyDef; +import com.deco2800.game.components.combatitemscomponents.PhysicalWeaponStatsComponent; import com.deco2800.game.components.ItemPickupComponent; import com.deco2800.game.entities.Entity; -import com.deco2800.game.components.combatitemsComponents.*; -import com.deco2800.game.entities.configs.combatitemsConfig.WeaponConfig; -import com.deco2800.game.entities.configs.combatitemsConfig.WeaponConfigSetup; +import com.deco2800.game.entities.configs.combatitemsconfig.WeaponConfig; +import com.deco2800.game.entities.configs.combatitemsconfig.WeaponConfigSetup; import com.deco2800.game.files.FileLoader; import com.deco2800.game.physics.PhysicsLayer; import com.deco2800.game.physics.components.HitboxComponent; @@ -205,7 +205,7 @@ public static Entity createPlungerBow() { public static Entity createGoldenPlungerBow() { Entity goldenPlungerBow = createBaseWeapon(); WeaponConfig config = configs.goldenPlungerBow; - PhysicalWeaponStatsComponent weaponStats = new PhysicalWeaponStatsComponent(config.damage, config.coolDown, config.materials, config.weight, "goldenBow"); + PhysicalWeaponStatsComponent weaponStats = new PhysicalWeaponStatsComponent(config.damage, config.coolDown, config.materials, config.weight, "goldenPlungerBow"); goldenPlungerBow .addComponent(weaponStats) .addComponent(new TextureRenderComponent("images/CombatItems/Sprint-3/craftingTeamAssetsNoWhiteSpace/goldenBowPlunger.png")); diff --git a/source/core/src/main/com/deco2800/game/screens/MainGameScreen.java b/source/core/src/main/com/deco2800/game/screens/MainGameScreen.java index 6646819c3..a8dcdf629 100644 --- a/source/core/src/main/com/deco2800/game/screens/MainGameScreen.java +++ b/source/core/src/main/com/deco2800/game/screens/MainGameScreen.java @@ -81,16 +81,29 @@ public class MainGameScreen extends ScreenAdapter { "images/Skills/bleed.png", "images/Skills/bleed_disabled.png", "images/Skills/charge.png", - "images/Skills/charge_disabled.png" + "images/Skills/charge_disabled.png", + "images/Skill_tree/tooltips/aoeTooltip.png", + "images/Skill_tree/tooltips/bleedTooltip.png", + "images/Skill_tree/tooltips/blockTooltip.png", + "images/Skill_tree/tooltips/chargeTooltip.png", + "images/Skill_tree/tooltips/dashTooltip.png", + "images/Skill_tree/tooltips/dodgeTooltip.png", + "images/Skill_tree/tooltips/fireballUltimateTooltip.png", + "images/Skill_tree/tooltips/invulnerabilityTooltip.png", + "images/Skill_tree/tooltips/wrenchProjectileTooltip.png", + "images/Skill_tree/tooltips/rootTooltip.png", + "images/Skill_tree/tooltips/teleportTooltip.png", + "images/Skill_tree/tooltips/ultimateTooltip.png" }; + private static final String[] dialogueImg = { - "images/NPC/Dialogue/dialoguesboxmale.png", - "images/NPC/Dialogue/dialoguesboxguard.png", - "images/NPC/Dialogue/dialoguesboxchild.png", + "images/NPC/Dialogue/dialoguesboxmale2.png", + "images/NPC/Dialogue/dialoguesboxguard2.png", + "images/NPC/Dialogue/dialoguesboxchild2.png", "images/NPC/Dialogue/dialoguesboxfemale2.png", - "images/NPC/Dialogue/HumanGuardDialogue.png", - "images/NPC/Dialogue/FriendlyCreatureDialogue.png", - "images/NPC/Dialogue/PlumberFriend.png" + "images/NPC/Dialogue/humanguarddialogue2.png", + "images/NPC/Dialogue/friendlycreaturedialogue2.png", + "images/NPC/Dialogue/plumberfriend2.png" }; private static final String[] teleportImg = {"images/Skills/teleport.png"}; private static final String[] skillScreenOverlays = { @@ -99,8 +112,11 @@ public class MainGameScreen extends ScreenAdapter { "images/Skills/EquippedSkillsText.png", "images/Skills/clearSkillsButton.png", "images/Skills/clearSkillsButton_down.png", - "images/Skills/skill-tree-icon.png" + "images/Skills/skill-tree-icon.png", + "images/Skills/skillExitButton.png", + "images/Skills/skillExitButtonDown.png" }; + private static final Vector2 CAMERA_POSITION = new Vector2(7.5f, 7.5f); private Entity player; private final GdxGame game; @@ -167,14 +183,14 @@ public MainGameScreen(GdxGame game, int level) { private void playMusicOne() { Music music = ServiceLocator.getResourceService().getAsset(backgroundMusicMapOne, Music.class); music.setLooping(true); - music.setVolume(0.3f); + music.setVolume(0.2f); music.play(); } private void playMusicTwo() { Music music = ServiceLocator.getResourceService().getAsset(backgroundMusicMapTwo, Music.class); music.setLooping(true); - music.setVolume(0.3f); + music.setVolume(0.2f); music.play(); } diff --git a/source/core/src/test/com/deco2800/game/areas/ForestGameAreaTest.java b/source/core/src/test/com/deco2800/game/areas/ForestGameAreaTest.java new file mode 100644 index 000000000..fbc93eff6 --- /dev/null +++ b/source/core/src/test/com/deco2800/game/areas/ForestGameAreaTest.java @@ -0,0 +1,83 @@ +package com.deco2800.game.areas; + +import com.badlogic.gdx.graphics.glutils.ShapeRenderer; +import com.badlogic.gdx.math.GridPoint2; +import com.badlogic.gdx.math.Matrix4; +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer; +import com.deco2800.game.components.gamearea.GameAreaDisplay; +import com.deco2800.game.entities.Entity; +import com.deco2800.game.extensions.GameExtension; +import com.deco2800.game.rendering.DebugRenderer; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +@ExtendWith(MockitoExtension.class) +@ExtendWith(GameExtension.class) + +class ForestGameAreaTest { + @Mock + ShapeRenderer shapeRenderer; + @Mock + Box2DDebugRenderer physicsRenderer; + @Mock + Matrix4 projMatrix; + + DebugRenderer debugRenderer; + + @BeforeEach + void beforeEach() { + debugRenderer = new DebugRenderer(physicsRenderer, shapeRenderer); + } + + + @Test + void spawnPlayer() { + ForestGameArea forestGameArea = mock(ForestGameArea.class); + forestGameArea.spawnPlayer(); + verify(forestGameArea).spawnPlayer(); + } + + @Test + void testSpawnTerrain() { + ForestGameArea forestGameArea = mock(ForestGameArea.class); + forestGameArea.getPlayer(); + verify(forestGameArea).getPlayer(); + } + + @Test + void testGetPlayer() { + ForestGameArea forestGameArea = mock(ForestGameArea.class); + forestGameArea.getPlayer(); + verify(forestGameArea).getPlayer(); + } + + @Test + void testCreate() { + ForestGameArea forestGameArea = mock(ForestGameArea.class); + forestGameArea.create(); + verify(forestGameArea).create(); + } + + @Test + void spawnEntityOnMap() { + ForestGameArea forestGameArea = mock(ForestGameArea.class); + Entity entity = new Entity(); + forestGameArea.spawnEntityOnMap(entity, new GridPoint2(10,10), true, true); + verify(forestGameArea).spawnEntityOnMap(entity, new GridPoint2(10,10), true, true); + } + + @Test + void testDispose() { + ForestGameArea forestGameArea = mock(ForestGameArea.class); + forestGameArea.dispose(); + verify(forestGameArea).dispose(); + } +} \ No newline at end of file diff --git a/source/core/src/test/com/deco2800/game/areas/GameAreaTest.java b/source/core/src/test/com/deco2800/game/areas/GameAreaTest.java index 4d061220d..edf37f616 100644 --- a/source/core/src/test/com/deco2800/game/areas/GameAreaTest.java +++ b/source/core/src/test/com/deco2800/game/areas/GameAreaTest.java @@ -1,8 +1,12 @@ package com.deco2800.game.areas; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import com.badlogic.gdx.math.GridPoint2; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.deco2800.game.areas.terrain.TerrainFactory; +import com.deco2800.game.components.gamearea.GameAreaDisplay; import com.deco2800.game.components.npc.NPCAnimationController; import com.deco2800.game.entities.Entity; import com.deco2800.game.entities.EntityService; @@ -39,6 +43,61 @@ public void create() {} verify(entity).dispose(); } + // Tests if minimap is successfully called. + @Test + void checkMinimap() { + GameArea gameArea = mock(ForestGameArea.class); + ServiceLocator.registerGameArea(gameArea); + GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); + + gameAreaDisplay.displayMinimap(); + verify(gameAreaDisplay).displayMinimap(); + } + + @Test + void testCreate() { + GameArea gameArea = mock(GameArea.class); + gameArea.create(); + verify(gameArea).create(); + } + + @Test + void testDispose() { + GameArea gameArea = mock(GameArea.class); + gameArea.dispose(); + verify(gameArea).dispose(); + } + + @Test + void testSpawnEntity() { + GameArea gameArea = mock(GameArea.class); + gameArea.dispose(); + verify(gameArea).dispose(); + } + + @Test + void testSpawnEntityAt() { + GameArea gameArea = mock(GameArea.class); + Entity entity = new Entity(); + gameArea.spawnEntityAt(entity, new GridPoint2(10,10), true, true); + verify(gameArea).spawnEntityAt(entity, new GridPoint2(10,10), true, true); + } + + @Test + void getPlayer() { + GameArea gameArea = mock(GameArea.class); + gameArea.getPlayer(); + verify(gameArea).getPlayer(); + } + + @Test + void setPlayer() { + GameArea gameArea = mock(GameArea.class); + Entity customPlayer = new Entity(); + gameArea.setPlayer(customPlayer); + verify(gameArea).setPlayer(customPlayer); + } + // @Test // void shouldSpawnMale() { // diff --git a/source/core/src/test/com/deco2800/game/areas/UndergroundGameAreaTest.java b/source/core/src/test/com/deco2800/game/areas/UndergroundGameAreaTest.java new file mode 100644 index 000000000..8d2620fff --- /dev/null +++ b/source/core/src/test/com/deco2800/game/areas/UndergroundGameAreaTest.java @@ -0,0 +1,80 @@ +package com.deco2800.game.areas; + +import com.badlogic.gdx.math.GridPoint2; +import com.deco2800.game.areas.terrain.TerrainFactory; +import com.deco2800.game.entities.Entity; +import com.deco2800.game.entities.EntityService; +import com.deco2800.game.extensions.GameExtension; +import com.deco2800.game.services.ServiceLocator; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +@ExtendWith(GameExtension.class) +class UndergroundGameAreaTest { + void shouldSpawnEntities() { + TerrainFactory factory = mock(TerrainFactory.class); + + UndergroundGameArea undergroundGameArea = + new UndergroundGameArea(factory) { + @Override + public void create() {} + }; + + ServiceLocator.registerEntityService(new EntityService()); + Entity entity = mock(Entity.class); + + undergroundGameArea.spawnEntity(entity); + verify(entity).create(); + + undergroundGameArea.dispose(); + verify(entity).dispose(); + } + + @Test + void testGetPlayer() { + UndergroundGameArea undergroundGameArea = mock(UndergroundGameArea.class); + undergroundGameArea.getPlayer(); + verify(undergroundGameArea).getPlayer(); + } + + @Test + void testCreate() { + UndergroundGameArea undergroundGameArea = mock(UndergroundGameArea.class); + undergroundGameArea.create(); + verify(undergroundGameArea).create(); + } + + @Test + void testSpawnCraftingTable() { + UndergroundGameArea undergroundGameArea = mock(UndergroundGameArea.class); + Entity entity = new Entity(); + undergroundGameArea.spawnEntity(entity); + verify(undergroundGameArea).spawnEntity(entity); + } + + @Test + void testSpawnWeaponProjectile() { + UndergroundGameArea undergroundGameArea = mock(UndergroundGameArea.class); + undergroundGameArea.spawnWeaponProjectile(); + verify(undergroundGameArea).spawnWeaponProjectile(); + } + + @Test + void testDispose() { + UndergroundGameArea undergroundGameArea = mock(UndergroundGameArea.class); + undergroundGameArea.dispose(); + verify(undergroundGameArea).dispose(); + } + + @Test + void testRemoveItemOnMap() { + UndergroundGameArea undergroundGameArea = mock(UndergroundGameArea.class); + Entity entity = new Entity(); + undergroundGameArea.spawnEntityAt(entity, new GridPoint2(10,10), true, true); + verify(undergroundGameArea).spawnEntityAt(entity, new GridPoint2(10,10), true, true); + } +} \ No newline at end of file diff --git a/source/core/src/test/com/deco2800/game/components/GameArea/GameAreaDisplayTest.java b/source/core/src/test/com/deco2800/game/components/GameArea/GameAreaDisplayTest.java index 3a7bdb341..ac5f01fca 100644 --- a/source/core/src/test/com/deco2800/game/components/GameArea/GameAreaDisplayTest.java +++ b/source/core/src/test/com/deco2800/game/components/GameArea/GameAreaDisplayTest.java @@ -1,22 +1,15 @@ package com.deco2800.game.components.GameArea; -import com.badlogic.gdx.assets.AssetManager; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; -import com.badlogic.gdx.scenes.scene2d.Stage; import com.deco2800.game.areas.GameArea; import com.deco2800.game.components.gamearea.GameAreaDisplay; -import com.deco2800.game.components.player.InventoryComponent; -import com.deco2800.game.components.player.OpenPauseComponent; -import com.deco2800.game.crafting.Materials; -import com.deco2800.game.entities.Entity; import com.deco2800.game.entities.EntityService; -import com.deco2800.game.entities.factories.MaterialFactory; import com.deco2800.game.extensions.GameExtension; import com.deco2800.game.input.InputService; import com.deco2800.game.physics.PhysicsService; import com.deco2800.game.rendering.RenderService; import com.deco2800.game.services.ResourceService; import com.deco2800.game.services.ServiceLocator; +import org.junit.Assert; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -31,188 +24,94 @@ @ExtendWith(MockitoExtension.class) class GameAreaDisplayTest { - @Mock Entity player; - @Mock GameAreaDisplay gameAreaDisplay; - - InventoryComponent inventoryComponent = new InventoryComponent(); + GameArea gameArea; + @Mock + RenderService service; @BeforeEach void setUp() { - AssetManager assetManager = spy(AssetManager.class); - ResourceService resourceService = new ResourceService(assetManager); - ServiceLocator.registerResourceService(resourceService); - - String[] textures = { - "images/Crafting-assets-sprint1/crafting table/crafting_inventory_lvl1.png", - "images/Crafting-assets-sprint1/crafting table/crafting_inventory_lvl2.png", - "images/Crafting-assets-sprint1/widgets/craft_button_lvl1.png", - "images/Crafting-assets-sprint1/widgets/craft_button_lvl2.png", - "images/Crafting-assets-sprint1/widgets/exit_button_lvl1.png", - "images/Crafting-assets-sprint1/widgets/exit_button_lvl2.png", - "images/PauseMenu/lvl2PauseScreen.png", - "images/PauseMenu/newPauseScreen.png", - "images/crafting_assets_sprint2/transparent-texture-buttonClick.png", - "images/keybind/level_1/ControlPage.png", - "images/keybind/level_2/ControlPage.png", - "images/CombatItems/Sprint-3/craftingTeamAssetsNoWhiteSpace/Hera.png", - "images/Crafting-assets-sprint1/popups/number1_popup.png", - "images/Crafting-assets-sprint1/popups/number2_popup.png", - "images/Crafting-assets-sprint1/popups/number3_popup.png", - "images/Crafting-assets-sprint1/popups/number4_popup.png", - "images/Crafting-assets-sprint1/popups/number5_popup.png", - "images/Crafting-assets-sprint1/popups/crafting_indicator.png", - "images/Crafting-assets-sprint1/popups/arrow-top-right.png", - "images/Crafting-assets-sprint1/popups/arrow-top-left.png", - "images/Crafting-assets-sprint1/popups/first-mat-prompt.png", - "images/Crafting-assets-sprint1/popups/second-mat-prompt.png", - "images/Crafting-assets-sprint1/popups/craft-prompt.png", - "images/Crafting-assets-sprint1/crafting table/crafting_catalogue_1_lvl1.png", - "images/Crafting-assets-sprint1/crafting table/crafting_catalogue_1_lvl2.png", - "images/Crafting-assets-sprint1/widgets/inventory_button_lvl1.png", - "images/Crafting-assets-sprint1/widgets/inventory_button_lvl2.png", - "images/Crafting-assets-sprint1/widgets/catalogue_page2_lvl1.png", - "images/Crafting-assets-sprint1/widgets/catalogue_page2_lvl2.png", - "images/Crafting-assets-sprint1/crafting table/crafting_catalogue_2_lvl1.png", - "images/Crafting-assets-sprint1/crafting table/crafting_catalogue_2_lvl2.png", - "images/Crafting-assets-sprint1/widgets/catalogue_page1_lvl1.png", - "images/Crafting-assets-sprint1/widgets/catalogue_page1_lvl2.png", -// "sounds/ItemClick.wav", -// "sounds/Scroll.wav", -// "sounds/new_Weapon_Crafted.wav", - "images/CombatItems/Sprint-1/Level 2 Dagger 1.png", - "images/CombatItems/Sprint-1/Level 2 Dagger 2png.png", - "images/CombatItems/Sprint-1/Enemy_dumbbell.png", - "images/CombatItems/Sprint-1/Level 2 Dagger 2png.png", - "images/CombatItems/Sprint-1/Sword_Lvl2.png", - "images/Crafting-assets-sprint1/materials/gold.png", - "images/Crafting-assets-sprint1/materials/rainbow_poop.png", - "images/Crafting-assets-sprint1/materials/iron.png", - "images/Crafting-assets-sprint1/materials/toilet_paper.png", - "images/Crafting-assets-sprint1/materials/steel.png", - "images/Crafting-assets-sprint1/materials/wood.png", - "images/Crafting-assets-sprint1/materials/plastic.png", - "images/Crafting-assets-sprint1/materials/rubber.png", - "images/Crafting-assets-sprint1/materials/platinum.png", - "images/Crafting-assets-sprint1/materials/silver.png" - }; - resourceService.loadTextures(textures); - String[] textureAtlases = {"images/CombatItems/animations/combatItemsAnimation.atlas"}; - resourceService.loadTextureAtlases(textureAtlases); - resourceService.loadAll(); - - GameArea gameArea = spy(GameArea.class); - RenderService renderService = new RenderService(); - renderService.setStage(mock(Stage.class)); - GameAreaDisplay areaDisplay = new GameAreaDisplay(""); - ServiceLocator.registerGameArea(gameArea); - ServiceLocator.registerRenderService(renderService); - ServiceLocator.registerCraftArea(areaDisplay); - ServiceLocator.registerPlayerGuideArea(areaDisplay); - areaDisplay.create(); - - player = new Entity(); - gameAreaDisplay = new GameAreaDisplay(""); - player.addComponent(gameAreaDisplay); - player.create(); - - gameArea.setPlayer(player); - -// inventoryComponent = ServiceLocator.getGameArea().getPlayer().getComponent(InventoryComponent.class); -// inventoryComponent.addItem(MaterialFactory.createGold()); -// inventoryComponent.addItem(MaterialFactory.createPoop()); -// inventoryComponent.addItem(MaterialFactory.createBaseMaterial()); -// inventoryComponent.addItem(MaterialFactory.createWood()); -// inventoryComponent.addItem(MaterialFactory.createToiletPaper()); -// inventoryComponent.addItem(MaterialFactory.createGold()); -// inventoryComponent.addItem(MaterialFactory.createIron()); -// inventoryComponent.addItem(MaterialFactory.createPlastic()); -// inventoryComponent.addItem(MaterialFactory.createRubber()); -// inventoryComponent.addItem(MaterialFactory.createSilver()); -// inventoryComponent.addItem(MaterialFactory.createSteel()); -// inventoryComponent.addItem(MaterialFactory.createRubber()); - - - - } - - @Test - void shouldCreate() { - assertNotNull(gameAreaDisplay.getGameAreaName()); - GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); - gameAreaDisplay.create(); - verify(gameAreaDisplay).create(); + ServiceLocator.registerEntityService(new EntityService()); + ServiceLocator.registerPhysicsService(new PhysicsService()); + ServiceLocator.registerInputService(new InputService()); + ServiceLocator.registerResourceService(new ResourceService()); + ServiceLocator.registerRenderService(new RenderService()); +// ServiceLocator.registerCraftArea(new GameAreaDisplay("TestGameArea")); } +// @Test +// void shouldCreate() { +// ServiceLocator.registerGameArea(gameArea); +// GameAreaDisplay gameAreaDisplay = spy(GameAreaDisplay.class); +// gameAreaDisplay.create(); +// verify(gameAreaDisplay).create(); +// } + @Test - void ShouldOpenCraftingMenu() { -// player.getEvents().trigger("Opening Crafting Menu"); -// gameAreaDisplay = new GameAreaDisplay("Underground"); -// assertEquals(0, gameAreaDisplay.getFirstTime()); + void openCraftingMenu() { GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); gameAreaDisplay.openCraftingMenu(); verify(gameAreaDisplay).openCraftingMenu(); } @Test - void setPauseMenu() { + void displayInventoryMenu() { GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); - gameAreaDisplay.setPauseMenu(); - verify(gameAreaDisplay).setPauseMenu(); + gameAreaDisplay.displayInventoryMenu(); + verify(gameAreaDisplay).displayInventoryMenu(); } @Test - void disposePauseMenu() { + void displayItems() { GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); - gameAreaDisplay.disposePauseMenu(); - verify(gameAreaDisplay).disposePauseMenu(); + gameAreaDisplay.displayItems(); + verify(gameAreaDisplay).displayItems(); } + @Test - void setPlayerGuideMenu() { + void displayEquipables() { GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); - gameAreaDisplay.setPlayerGuideMenu(""); - verify(gameAreaDisplay).setPlayerGuideMenu(""); + gameAreaDisplay.displayEquipables(); + verify(gameAreaDisplay).displayEquipables(); } + @Test + void setPauseMenu() { + } + + @Test + void setPlayerGuideMenu() { + } @Test void disposePlayerGuideMenu() { - GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); - gameAreaDisplay.disposePlayerGuideMenu(); - verify(gameAreaDisplay).disposePlayerGuideMenu(); } @Test - void getPlayerGuideMenu(){ - GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); - gameAreaDisplay.getPlayerGuideMenu(); - verify(gameAreaDisplay).getPlayerGuideMenu(); + void setKeyBindMenu() { } + @Test + void disposeKeyBindMenu() { + } @Test - void displayCatOne() { - GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); - gameAreaDisplay.displayCatOne(); - verify(gameAreaDisplay).displayCatOne(); + void createKeyBindings() { } @Test - void displayCatTwo() { - GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); - gameAreaDisplay.displayCatTwo(); - verify(gameAreaDisplay).displayCatTwo(); + void displayCatOne() { } @Test void disposeCraftingMenu() { - GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); - gameAreaDisplay.disposeCraftingMenu(); - verify(gameAreaDisplay).disposeCraftingMenu(); } @Test - void getFirstTime() { - assertEquals(0, gameAreaDisplay.getFirstTime()); + void disposePauseMenu() { + } + + @Test + void toggleSkillTree() { } // @Test @@ -223,5 +122,14 @@ void getFirstTime() { // verify(gameAreaDisplay).draw(spriteBatch); // } + @Test + void dispose() { + } + @Test + void getGameAreaName() { + GameAreaDisplay gameAreaDisplay = mock(GameAreaDisplay.class); + gameAreaDisplay.getGameAreaName(); + verify(gameAreaDisplay).getGameAreaName(); + } } \ No newline at end of file diff --git a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/AreaOfEffectStatsComponentTest.java b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/AreaOfEffectStatsComponentTest.java similarity index 95% rename from source/core/src/test/com/deco2800/game/components/combatitemsComponents/AreaOfEffectStatsComponentTest.java rename to source/core/src/test/com/deco2800/game/components/combatitemscomponents/AreaOfEffectStatsComponentTest.java index 5fd335172..6a34324ec 100644 --- a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/AreaOfEffectStatsComponentTest.java +++ b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/AreaOfEffectStatsComponentTest.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.deco2800.game.crafting.Materials; import com.deco2800.game.extensions.GameExtension; diff --git a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/AuraPickupComponentTest.java b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/AuraPickupComponentTest.java similarity index 97% rename from source/core/src/test/com/deco2800/game/components/combatitemsComponents/AuraPickupComponentTest.java rename to source/core/src/test/com/deco2800/game/components/combatitemscomponents/AuraPickupComponentTest.java index 9f41a702d..93f4ce2a7 100644 --- a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/AuraPickupComponentTest.java +++ b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/AuraPickupComponentTest.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.badlogic.gdx.physics.box2d.Fixture; import com.deco2800.game.areas.ForestGameArea; diff --git a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/PhysicalStatsComponentTest.java b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/PhysicalStatsComponentTest.java similarity index 95% rename from source/core/src/test/com/deco2800/game/components/combatitemsComponents/PhysicalStatsComponentTest.java rename to source/core/src/test/com/deco2800/game/components/combatitemscomponents/PhysicalStatsComponentTest.java index a14bc0fe8..83929f42a 100644 --- a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/PhysicalStatsComponentTest.java +++ b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/PhysicalStatsComponentTest.java @@ -1,5 +1,5 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; diff --git a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/RangedStatsComponentTest.java b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/RangedStatsComponentTest.java similarity index 95% rename from source/core/src/test/com/deco2800/game/components/combatitemsComponents/RangedStatsComponentTest.java rename to source/core/src/test/com/deco2800/game/components/combatitemscomponents/RangedStatsComponentTest.java index 68bfbbd07..618c95f37 100644 --- a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/RangedStatsComponentTest.java +++ b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/RangedStatsComponentTest.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.deco2800.game.crafting.Materials; import com.deco2800.game.extensions.GameExtension; import java.util.HashMap; diff --git a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/WeaponAuraComponentTest.java b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/WeaponAuraComponentTest.java similarity index 94% rename from source/core/src/test/com/deco2800/game/components/combatitemsComponents/WeaponAuraComponentTest.java rename to source/core/src/test/com/deco2800/game/components/combatitemscomponents/WeaponAuraComponentTest.java index e75f99a59..5b60cc264 100644 --- a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/WeaponAuraComponentTest.java +++ b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/WeaponAuraComponentTest.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.deco2800.game.extensions.GameExtension; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.BeforeEach; diff --git a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/WeaponAuraManagerTest.java b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/WeaponAuraManagerTest.java similarity index 98% rename from source/core/src/test/com/deco2800/game/components/combatitemsComponents/WeaponAuraManagerTest.java rename to source/core/src/test/com/deco2800/game/components/combatitemscomponents/WeaponAuraManagerTest.java index 879b3fce7..3cfe741d2 100644 --- a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/WeaponAuraManagerTest.java +++ b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/WeaponAuraManagerTest.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.deco2800.game.areas.ForestGameArea; diff --git a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/WeaponPickupComponentTest.java b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/WeaponPickupComponentTest.java similarity index 97% rename from source/core/src/test/com/deco2800/game/components/combatitemsComponents/WeaponPickupComponentTest.java rename to source/core/src/test/com/deco2800/game/components/combatitemscomponents/WeaponPickupComponentTest.java index fb95770c9..e145f9b79 100644 --- a/source/core/src/test/com/deco2800/game/components/combatitemsComponents/WeaponPickupComponentTest.java +++ b/source/core/src/test/com/deco2800/game/components/combatitemscomponents/WeaponPickupComponentTest.java @@ -1,4 +1,4 @@ -package com.deco2800.game.components.combatitemsComponents; +package com.deco2800.game.components.combatitemscomponents; import com.deco2800.game.extensions.GameExtension; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/source/core/src/test/com/deco2800/game/components/player/InventoryComponentTest.java b/source/core/src/test/com/deco2800/game/components/player/InventoryComponentTest.java index 5d97915be..71652ad93 100644 --- a/source/core/src/test/com/deco2800/game/components/player/InventoryComponentTest.java +++ b/source/core/src/test/com/deco2800/game/components/player/InventoryComponentTest.java @@ -1,14 +1,12 @@ package com.deco2800.game.components.player; -import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.Stage; import com.deco2800.game.areas.ForestGameArea; import com.deco2800.game.areas.GameArea; import com.deco2800.game.components.DefensiveItemsComponents.ArmourStatsComponent; import com.deco2800.game.components.gamearea.GameAreaDisplay; -import com.deco2800.game.areas.ForestGameArea; -import com.deco2800.game.components.combatitemsComponents.PhysicalWeaponStatsComponent; +import com.deco2800.game.components.combatitemscomponents.PhysicalWeaponStatsComponent; import com.deco2800.game.entities.Entity; import com.deco2800.game.entities.EntityService; import com.deco2800.game.entities.factories.*; @@ -16,15 +14,12 @@ import com.deco2800.game.input.InputService; import com.deco2800.game.physics.PhysicsService; import com.deco2800.game.rendering.AnimationRenderComponent; -import com.deco2800.game.rendering.RenderComponent; import com.deco2800.game.rendering.RenderService; import com.deco2800.game.services.ResourceService; import com.deco2800.game.services.ServiceLocator; -import com.deco2800.game.ui.UIComponent; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.platform.commons.logging.LoggerFactory; import org.mockito.junit.jupiter.MockitoExtension; import java.util.ArrayList; @@ -63,7 +58,14 @@ void beforeEach() { "images/Crafting-assets-sprint1/materials/plastic.png", "images/Crafting-assets-sprint1/materials/rubber.png", "images/Crafting-assets-sprint1/materials/platinum.png", - "images/Crafting-assets-sprint1/materials/silver.png"}; + "images/Crafting-assets-sprint1/materials/silver.png", + "images/Potions/agility_potion.png", + "images/Potions/health_potion.png", + "images/Potions/defence_potion.png", + "images/Potions/swiftness_potion.png", + "images/Armour-assets-sprint2/Dark_Armour.png", + "images/Armour-assets-sprint2/slowDiamond.png", + "images/CombatItems/Sprint-3/craftingTeamAssetsNoWhiteSpace/goldenBowPlunger.png"}; resourceService.loadTextures(textures); String[] textureAtlases = {"images/CombatItems/animations/combatItemsAnimation.atlas"}; resourceService.loadTextureAtlases(textureAtlases); @@ -95,50 +97,46 @@ void setCombatAnimator() { @Test void registerAnimation() { -// Entity player = PlayerFactory.createTestPlayer(); -// InventoryComponent inventory = player.getComponent(InventoryComponent.class); -//// Entity combatAnimator = PlayerFactory.createCombatAnimator(player); -// Entity combatAnimator = mock(Entity.class); -// inventory.setCombatAnimator(combatAnimator); -// -//// EventHandler eventHandler = new EventHandler(); -//// when(combatAnimator.getEvents()).thenReturn(eventHandler); -// -// Entity weapon = WeaponFactory.createHera(); -// String description = weapon.getComponent(PhysicalWeaponStatsComponent.class).getDescription(); -// String staticAnimation = description+"Static"; -// -//// combatAnimator.getEvents().trigger(staticAnimation); -// -// inventory.registerAnimation(weapon); -// -// verify(combatAnimator).getEvents().trigger(staticAnimation); -//// assertEquals(inventory.getCombatAnimator(), combatAnimator); + Entity player = PlayerFactory.createTestPlayer(); + InventoryComponent inventory = player.getComponent(InventoryComponent.class); + Entity combatAnimator = mock(Entity.class); + inventory.setCombatAnimator(combatAnimator); + + Entity weapon = WeaponFactory.createHera(); + Entity goldPlungerBow = WeaponFactory.createGoldenPlungerBow(); + + inventory.registerAnimation(weapon); + inventory.registerAnimation(goldPlungerBow); } + @Test + void removeEquipable(){ + Entity player = PlayerFactory.createTestPlayer(); + Entity testWeapon = WeaponFactory.createTestWeapon("hera"); + Entity testArmour = ArmourFactory.createBaseArmour(); + Entity notAddedWeapon = WeaponFactory.createDagger(); + Entity wood = MaterialFactory.createWood(); + + InventoryComponent inventory = player.getComponent(InventoryComponent.class); + inventory.addItem(testWeapon); + inventory.equipItem(testWeapon); + assertTrue(inventory.removeEquipable(0)); + assertFalse(inventory.removeEquipable(1)); + } @Test void cancelAnimation() { -// Entity player = PlayerFactory.createTestPlayer(); -// InventoryComponent inventory = player.getComponent(InventoryComponent.class); -// Entity combatAnimator = mock(Entity.class); -//// combatAnimator = new Entity(); -// -// AnimationRenderComponent animator = new AnimationRenderComponent( -// ServiceLocator.getResourceService().getAsset( -// "images/CombatItems/animations/combatItemsAnimation.atlas", TextureAtlas.class)); -// animator.addAnimation("athena", 0.1f); -// combatAnimator.addComponent(animator); -//// combatAnimator.addComponent(new AnimationRenderComponent( -//// ServiceLocator.getResourceService().getAsset( -//// "images/CombatItems/animations/combatItemsAnimation.atlas", TextureAtlas.class))); -// -//// AnimationRenderComponent animationRenderComponent = mock(AnimationRenderComponent.class); -//// when(animationRenderComponent.stopAnimation()).thenReturn(true); -// -// inventory.setCombatAnimator(combatAnimator); -// inventory.cancelAnimation(); -// -// verify(combatAnimator).dispose(); + Entity player = PlayerFactory.createTestPlayer(); + InventoryComponent inventory = player.getComponent(InventoryComponent.class); + Entity combatAnimator = mock(Entity.class); + + inventory.cancelAnimation(); + + AnimationRenderComponent animator = new AnimationRenderComponent( + ServiceLocator.getResourceService().getAsset( + "images/CombatItems/animations/combatItemsAnimation.atlas", TextureAtlas.class)); + animator.addAnimation("athena", 0.1f); + combatAnimator.addComponent(animator); + } @Test @@ -205,9 +203,7 @@ void addItem() { expectedList.add(testDumbbell); expectedList.add(testHera); expectedList.add(testArmour); - for (int i = 0; i < 9; i++) { - expectedList.add(testSpeedPotion); - } + expectedList.add(testSpeedPotion); expectedList.add(testHealthPotion); expectedList.add(gold); expectedList.add(iron); @@ -219,14 +215,11 @@ void addItem() { expectedList.add(silver); expectedList.add(poop); expectedList.add(toiletPaper); + //Test case 1 adding player to inventory should do nothing + inventory.addItem(player); + for (Entity entity : expectedList) inventory.addItem(entity); + for (int i = 0; i < 9; i++) inventory.addItem(testSpeedPotion); - for (Entity entity : expectedList) { - inventory.addItem(entity); - } - - for (int j = 0; j < 8; j++) { - expectedList.remove(testSpeedPotion); - } expectedList.remove(toiletPaper); assertEquals(expectedList, inventory.getInventory()); } @@ -258,6 +251,8 @@ void removeItem() { Entity testArmour = ArmourFactory.createBaseArmour(); Entity testPotion = PotionFactory.createTestHealthPotion(); + testInventory3.removeItem(testWeapon); + testInventory3.addItem(testWeapon); testInventory3.addItem(testArmour); @@ -276,10 +271,15 @@ void removeItem2() { InventoryComponent testInventory3 = new InventoryComponent(); Entity iron = MaterialFactory.createIron(); - testInventory3.addItem(iron); testInventory3.removeItem(EntityTypes.IRON); + testInventory3.addItem(iron); + testInventory3.removeItem(EntityTypes.IRON); assertFalse(testInventory3.hasItem(iron, testInventory3.getInventory())); + + //Should do nothing + testInventory3.addItem(iron); + testInventory3.removeItem(EntityTypes.WOOD); } @Test @@ -352,67 +352,84 @@ void getEquipables() { } @Test - void removeEquipable() { - //Needs work, Incomplete test - -// Entity player = PlayerFactory.createTestPlayer(); -// InventoryComponent inventory = player.getComponent(InventoryComponent.class); -// Entity testWeapon = WeaponFactory.createHera(); -// Entity[] expectedList = new Entity[2]; -// -//// InventoryComponent inventoryComponent = spy(InventoryComponent.class); -//// doNothing().when(inventoryComponent).cancelAnimation(); -// -// inventory.addItem(testWeapon); -// inventory.equipItem(testWeapon); -// inventory.removeEquipable(0); -// -// assertArrayEquals(expectedList, inventory.getEquipables()); - } + void equipItem() { + Entity player = PlayerFactory.createTestPlayer(); + Entity testWeapon = WeaponFactory.createTestWeapon("hera"); + Entity testArmour = ArmourFactory.createBaseArmour(); + Entity notAddedWeapon = WeaponFactory.createDagger(); + Entity wood = MaterialFactory.createWood(); + List expectedList = new ArrayList<>(16); + Entity animator = new Entity(); + animator.getComponent(AnimationRenderComponent.class); + Entity entity = mock(Entity.class); + PlayerFactory playerFactory = mock(PlayerFactory.class); + ServiceLocator serviceLocator = mock(ServiceLocator.class); - @Test - void equipItem() { - /* - have no idea why methods still report errors after they have been mocked - */ - -// Entity player = PlayerFactory.createTestPlayer(); -// Entity testWeapon = WeaponFactory.createTestWeapon("hera"); -// Entity testArmour = ArmourFactory.createBaseArmour(); -// Entity animator = new Entity(); -// animator.getComponent(AnimationRenderComponent.class); -// Entity entity = mock(Entity.class); -// PlayerFactory playerFactory = mock(PlayerFactory.class); -// ServiceLocator serviceLocator = mock(ServiceLocator.class); -// -// when(playerFactory.createCombatAnimator(entity)).thenReturn(animator); -// when(serviceLocator.getGameArea()).thenReturn(gameArea); -// -// InventoryComponent inventory = player.getComponent(InventoryComponent.class); -// PlayerModifier pmComponent = player.getComponent(PlayerModifier.class); -// -// ArmourStatsComponent armourStats = testArmour.getComponent(ArmourStatsComponent.class); -// PhyiscalWeaponStatsComponent meleeStats = testWeapon.getComponent(PhyiscalWeaponStatsComponent.class); -// -// inventory.addItem(testWeapon); -// inventory.addItem(testArmour); -// -// inventory.equipItem(testArmour); -// assertTrue(pmComponent. -// checkModifier(PlayerModifier.MOVESPEED, (-(float)armourStats.getWeight()), true, 0)); -// -// inventory.equipItem(testWeapon); -// assertTrue(pmComponent. -// checkModifier(PlayerModifier.MOVESPEED, (float) (-meleeStats.getWeight() / 15), true, 0)); + InventoryComponent inventory = player.getComponent(InventoryComponent.class); + PlayerModifier pmComponent = player.getComponent(PlayerModifier.class); + + ArmourStatsComponent armourStats = testArmour.getComponent(ArmourStatsComponent.class); + PhysicalWeaponStatsComponent meleeStats = testWeapon.getComponent(PhysicalWeaponStatsComponent.class); + + inventory.addItem(wood); + assertFalse(inventory.equipItem(wood)); + inventory.removeItem(wood); + + inventory.addItem(testArmour); + inventory.equipItem(testArmour); + assertTrue(pmComponent.checkModifier(PlayerModifier.MOVESPEED, 0, false,0)); + assertEquals(expectedList, inventory.getInventory()); + + inventory.addItem(testWeapon); + inventory.equipItem(testWeapon); + assertTrue(pmComponent. + checkModifier(PlayerModifier.MOVESPEED, (float) (-meleeStats.getWeight() / 15), true, 0)); + + + assertFalse(inventory.equipItem(notAddedWeapon)); + + inventory.addItem(notAddedWeapon); + assertTrue(inventory.equipItem(notAddedWeapon)); + inventory.equipItem(testWeapon); } @Test void swapItem(){ + Entity player = PlayerFactory.createTestPlayer(); + Entity testWeapon = WeaponFactory.createTestWeapon("hera"); + Entity testArmour = ArmourFactory.createBaseArmour(); + Entity slowDiamond = ArmourFactory.createArmour(ArmourFactory.ArmourType.slowDiamond); + Entity dumbbell = WeaponFactory.createDumbbell(); + Entity wood = MaterialFactory.createWood(); + + InventoryComponent inventory = player.getComponent(InventoryComponent.class); + PlayerModifier pmComponent = player.getComponent(PlayerModifier.class); + + ArmourStatsComponent armourStats = slowDiamond.getComponent(ArmourStatsComponent.class); + PhysicalWeaponStatsComponent meleeStats = dumbbell.getComponent(PhysicalWeaponStatsComponent.class); + + inventory.addItem(testWeapon); + inventory.addItem(testArmour); + inventory.addItem(dumbbell); + + inventory.swapItem(testWeapon); + assertFalse(pmComponent. + checkModifier(PlayerModifier.MOVESPEED, (float) (-meleeStats.getWeight() / 15), true, 0)); + inventory.equipItem(dumbbell); + + assertTrue(pmComponent. + checkModifier(PlayerModifier.MOVESPEED, (float) (-meleeStats.getWeight() / 15), true, 0)); + inventory.swapItem(slowDiamond); + assertFalse(pmComponent.checkModifier(PlayerModifier.MOVESPEED, 5, true,0)); + inventory.equipItem(testArmour); + + inventory.swapItem(slowDiamond); + assertFalse(pmComponent.checkModifier(PlayerModifier.MOVESPEED, (float)-5 / 10, true,0)); } - /** Currently not working since mock is not implemented + @Test void unequip() { Entity player = PlayerFactory.createTestPlayer(); @@ -449,10 +466,46 @@ void unequip() { inventory.unequipItem(0); assertEquals(refSpeed, pmComponent.getModified(PlayerModifier.MOVESPEED)); - //Test case 5: unequip while inventory is full - //Currently unavailable since the total number of items existing in this game is < 16 + //Test case 5 unequiping slot with no item + assertFalse(inventory.unequipItem(0)); + + //Test case 6: unequip while inventory is full + Entity testSword = WeaponFactory.createSwordLvl2(); + Entity testDumbbell = WeaponFactory.createDumbbell(); + Entity testHera = WeaponFactory.createHera(); + Entity testSpeedPotion = PotionFactory.createTestSpeedPotion(); + Entity testHealthPotion = PotionFactory.createTestHealthPotion(); + Entity staminaPotion = PotionFactory.createStaminaPotion(); + Entity gold = MaterialFactory.createGold(); + Entity iron = MaterialFactory.createIron(); + Entity steel = MaterialFactory.createSteel(); + Entity wood = MaterialFactory.createWood(); + Entity plastic = MaterialFactory.createPlastic(); + Entity rubber = MaterialFactory.createRubber(); + Entity platinum = MaterialFactory.createPlatinum(); + Entity silver = MaterialFactory.createSilver(); + Entity poop = MaterialFactory.createPoop(); + Entity toiletPaper = MaterialFactory.createToiletPaper(); + inventory.addItem(testSword); + inventory.addItem(testDumbbell); + inventory.addItem(testHera); + inventory.addItem(testSpeedPotion); + inventory.addItem(testHealthPotion); + inventory.addItem(gold); + inventory.addItem(iron); + inventory.addItem(steel); + inventory.addItem(wood); + inventory.addItem(plastic); + inventory.addItem(rubber); + inventory.addItem(platinum); + inventory.addItem(silver); + inventory.addItem(poop); + inventory.addItem(toiletPaper); + inventory.equipItem(testWeapon); + inventory.addItem(staminaPotion); + inventory.unequipItem(0); } - */ + @Test void toggleInventoryDisplay() { @@ -464,26 +517,27 @@ void toggleInventoryDisplay() { InventoryComponent inventory = spy(InventoryComponent.class); inventory.toggleInventoryDisplay(); + inventory.toggleInventoryDisplay(); - verify(inventory).toggleInventoryDisplay(); + verify(inventory, times(2)).toggleInventoryDisplay(); } -// /** -// * Checks whether the quickbar items are what they are expected to be when items are added to -// * the quickbar -// */ -// @Test -// void getQuickBarItems() { -// Entity player = PlayerFactory.createTestPlayer(); -// Entity testPotion = PotionFactory.createTestSpeedPotion(); -// -// InventoryComponent inventory = player.getComponent(InventoryComponent.class); -// List expectedList = new ArrayList<>(3); -// -// inventory.addQuickBarItems(testPotion); -// -// assertNotEquals(expectedList, inventory.getQuickBarItems()); -// } + /** + * Checks whether the quickbar items are what they are expected to be when items are added to + * the quickbar + */ + @Test + void getQuickBarItems() { + Entity player = PlayerFactory.createTestPlayer(); + Entity testPotion = PotionFactory.createTestSpeedPotion(); + + InventoryComponent inventory = player.getComponent(InventoryComponent.class); + List expectedList = new ArrayList<>(3); + + inventory.addQuickBarItems(testPotion); + + assertNotEquals(expectedList, inventory.getQuickBarItems()); + } @Test void itemEquals() { @@ -498,37 +552,34 @@ void itemEquals() { assertFalse(inventory.itemEquals(testArmour, testPotion)); } -// @Test -// void disposeAnimation() { -// ServiceLocator.registerRenderService(ServiceLocator.getRenderService()); -// RenderComponent component = spy(AnimationRenderComponent.class); -// component.create(); -// component.dispose(); -// verify(ServiceLocator.getRenderService()).unregister(component); -// } - - /*private void cancelAnimation() { - if(combatAnimator == null) return; - combatAnimator.dispose(); - combatAnimator.getComponent(AnimationRenderComponent.class).stopAnimation(); - }*/ - -// /** -// * Checks that the item has correctly been added to the quickbar -// */ -// @Test -// void addQuickBarItems() { -// Entity player = PlayerFactory.createTestPlayer(); -// Entity testPotion = PotionFactory.createTestSpeedPotion(); -// -// InventoryComponent inventory = player.getComponent(InventoryComponent.class); -// List expectedList = new ArrayList<>(3); -// -// inventory.addQuickBarItems(testPotion); -// expectedList.add(testPotion); -// -// assertEquals(expectedList, inventory.getQuickBarItems()); -// } + /** + * Checks that the item has correctly been added to the quickbar + */ + @Test + void addQuickBarItems() { + Entity player = PlayerFactory.createTestPlayer(); + Entity testPotion = PotionFactory.createTestSpeedPotion(); + Entity staminaPotion = PotionFactory.createStaminaPotion(); + Entity healthPotion = PotionFactory.createHealthPotion(); + Entity defencePotion = PotionFactory.createDefencePotion(); + + InventoryComponent inventory = player.getComponent(InventoryComponent.class); + List expectedList = new ArrayList<>(3); + List expectedInventory = new ArrayList<>(16); + for (int i = 0; i < 9; ++i) inventory.addQuickBarItems(testPotion); + expectedList.add(testPotion); + + assertFalse(inventory.addQuickBarItems(testPotion)); + + assertEquals(expectedList, inventory.getQuickBarItems()); + assertEquals(expectedInventory, inventory.getInventory()); + + inventory.addQuickBarItems(staminaPotion); + + inventory.addQuickBarItems(healthPotion); + + assertFalse(inventory.addQuickBarItems(defencePotion)); + } /** * Tests whether the potion is at the correct place in the quickbar so that it may be used @@ -538,28 +589,47 @@ void itemEquals() { void getPotionIndex() { Entity player = PlayerFactory.createTestPlayer(); Entity testSpeedPotion = PotionFactory.createTestSpeedPotion(); - + Entity healthPotion = PotionFactory.createHealthPotion(); + int expectedSentinel = -1; InventoryComponent inventory = player.getComponent(InventoryComponent.class); + assertEquals(-1, inventory.getPotionIndex(testSpeedPotion)); inventory.addQuickBarItems(testSpeedPotion); int expectedIndex = 0; assertEquals(expectedIndex, inventory.getPotionIndex(testSpeedPotion)); + assertEquals(expectedSentinel, inventory.getPotionIndex(healthPotion)); } -// @Test -// void removePotion() { -// Entity player = PlayerFactory.createTestPlayer(); -// Entity testSpeedPotion = PotionFactory.createTestSpeedPotion(); -// -// InventoryComponent testInventory6 = player.getComponent(InventoryComponent.class); -// List expectedList = new ArrayList<>(3); -// -// testInventory6.addQuickBarItems(testSpeedPotion); -// -// testInventory6.removePotion(testInventory6.getPotionIndex(testSpeedPotion)); -// -// assertEquals(expectedList, testInventory6.getInventory()); -// } + @Test + void removePotion() { + Entity player = PlayerFactory.createTestPlayer(); + Entity testSpeedPotion = PotionFactory.createTestSpeedPotion(); + + InventoryComponent testInventory6 = player.getComponent(InventoryComponent.class); + List expectedList = new ArrayList<>(3); + + testInventory6.addQuickBarItems(testSpeedPotion); + + testInventory6.removePotion(testInventory6.getPotionIndex(testSpeedPotion)); + + assertEquals(expectedList, testInventory6.getInventory()); + } + + @Test + void setPotionQuantity() { + Entity player = PlayerFactory.createTestPlayer(); + Entity testPotion1 = PotionFactory.createTestSpeedPotion(); + Entity speedPotion = PotionFactory.createSpeedPotion(); + int[] expectedList = new int[3]; + int expectedQuantity = 3; + expectedList[0] = expectedQuantity; + InventoryComponent inventory = player.getComponent(InventoryComponent.class); + inventory.setPotionQuantity(0, expectedQuantity); + //Edge cases input > threshold + inventory.setPotionQuantity(0, 10); + inventory.setPotionQuantity(3, expectedQuantity); + assertArrayEquals(expectedList, inventory.getQuickBarQuantity()); + } /** * This test checks that when a potion is consumed that it is removed from the quickbar and @@ -569,7 +639,9 @@ void getPotionIndex() { void consumePotion() { Entity player = PlayerFactory.createTestPlayer(); Entity testPotion1 = PotionFactory.createTestSpeedPotion(); + Entity speedPotion = PotionFactory.createSpeedPotion(); List expectedList = new ArrayList<>(3); + int expectedQuantity = 8; InventoryComponent inventory = player.getComponent(InventoryComponent.class); PlayerModifier pmComponent = player.getComponent(PlayerModifier.class); @@ -579,8 +651,21 @@ void consumePotion() { //Tests if the potion effect is applied to the player inventory.consumePotion(1); + //Test if the function has properly ended or not + inventory.consumePotion(5); + assertTrue(pmComponent. checkModifier(PlayerModifier.MOVESPEED, 1.5f, true, 3000)); assertEquals(expectedList, inventory.getQuickBarItems()); + + for (int i = 0; i < 9; ++i) { + inventory.addItem(testPotion1); + inventory.addQuickBarItems(speedPotion); + } + + inventory.consumePotion(1); + assertEquals(expectedQuantity, inventory.getQuickBarQuantity()[inventory.getPotionIndex(speedPotion)]); + inventory.setPotionQuantity(0, -1); + inventory.consumePotion(1); } } diff --git a/source/core/src/test/com/deco2800/game/components/player/PlayerCombatAnimationControllerTest.java b/source/core/src/test/com/deco2800/game/components/player/PlayerCombatAnimationControllerTest.java index 608627431..d8de15599 100644 --- a/source/core/src/test/com/deco2800/game/components/player/PlayerCombatAnimationControllerTest.java +++ b/source/core/src/test/com/deco2800/game/components/player/PlayerCombatAnimationControllerTest.java @@ -539,5 +539,10 @@ void playPlungerBowStaticAnimation() { animator.addAnimation("plungerBowStatic", 0.1f); entity.getEvents().trigger("plungerBowStatic"); } + @Test + void playGoldenPlungerBowStaticAnimation() { + animator.addAnimation("goldenPlungerBow", 0.1f); + entity.getEvents().trigger("goldenPlungerBow"); + } } diff --git a/source/core/src/test/com/deco2800/game/components/player/PlayerSkillComponentTest.java b/source/core/src/test/com/deco2800/game/components/player/PlayerSkillComponentTest.java index 8d05218ff..3ed7578a4 100644 --- a/source/core/src/test/com/deco2800/game/components/player/PlayerSkillComponentTest.java +++ b/source/core/src/test/com/deco2800/game/components/player/PlayerSkillComponentTest.java @@ -4,9 +4,11 @@ import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.World; import com.deco2800.game.ai.tasks.AITaskComponent; +import com.deco2800.game.areas.GameArea; import com.deco2800.game.components.CombatStatsComponent; import com.deco2800.game.entities.Entity; import com.deco2800.game.entities.EntityService; +import com.deco2800.game.entities.factories.ObstacleFactory; import com.deco2800.game.extensions.GameExtension; import com.deco2800.game.physics.PhysicsEngine; import com.deco2800.game.physics.PhysicsService; @@ -59,6 +61,7 @@ void initialisation() { .addComponent(new KeyboardPlayerInputComponent()) .addComponent(new PlayerModifier()); + ServiceLocator.registerPhysicsService(new PhysicsService()); skillManager = new PlayerSkillComponent(player); skillManager.setSkillAnimator(new Entity()); @@ -355,7 +358,6 @@ void testCheckBleed() { @Test void testRoot() { - ServiceLocator.registerPhysicsService(new PhysicsService()); ServiceLocator.registerRenderService(new RenderService()); Entity enemy = new Entity() @@ -378,9 +380,18 @@ void testRoot() { @Test void testStartCharge() { - Vector2 vec = new Vector2(1f, 1f); + assertFalse(skillManager.isChargingUp()); + skillManager.startCharge(); + assertTrue(skillManager.isChargingUp()); + customWait(701); + skillManager.update(); + assertFalse(skillManager.isChargingUp()); + } + + @Test + void testChargeMove() { assertFalse(skillManager.isCharging()); - skillManager.startCharge(vec); + skillManager.chargeMove(); assertTrue(skillManager.isCharging()); customWait(301); skillManager.update(); @@ -389,9 +400,7 @@ void testStartCharge() { @Test void testChargeHit() { - Vector2 vec = new Vector2(1f, 1f); ServiceLocator.registerEntityService(new EntityService()); - ServiceLocator.registerPhysicsService(new PhysicsService()); Entity enemy = new Entity() .addComponent(new CombatStatsComponent(60, 1, 1, 1)) @@ -400,12 +409,12 @@ void testChargeHit() { enemy.create(); skillManager.chargeHit(enemy); - skillManager.startCharge(vec); + skillManager.chargeMove(); skillManager.chargeHit(enemy); assertEquals(30, enemy.getComponent(CombatStatsComponent.class).getHealth()); skillManager.chargeHit(enemy); assertEquals(30, enemy.getComponent(CombatStatsComponent.class).getHealth()); - skillManager.startCharge(vec); + skillManager.chargeMove(); skillManager.chargeHit(enemy); assertEquals(0, enemy.getComponent(CombatStatsComponent.class).getHealth()); } @@ -416,64 +425,30 @@ void testTeleportPlayer1() { Vector2 beforePos = player.getPosition(); skillManager.teleportPlayer(); Vector2 afterPos = player.getPosition(); - assertEquals(new Vector2(beforePos.x + 4.0f, beforePos.y + 4.0f), afterPos); + assertEquals(new Vector2(beforePos.x + 8.0f, beforePos.y + 8.0f), afterPos); } @Test void testTeleportPlayer2() { - player.getComponent(PlayerActions.class).walk(new Vector2(1,0)); + player.getComponent(PlayerActions.class).walk(new Vector2(0,0)); Vector2 beforePos = player.getPosition(); skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); Vector2 afterPos = player.getPosition(); - assertEquals(new Vector2(beforePos.x + 24.18f, beforePos.y + 0.11f), afterPos); + assertEquals(beforePos, afterPos); } @Test void testTeleportPlayer3() { - player.getComponent(PlayerActions.class).walk(new Vector2(-1,0)); - Vector2 beforePos = player.getPosition(); - skillManager.teleportPlayer(); - Vector2 afterPos = player.getPosition(); - assertEquals(new Vector2(beforePos.x - 0.08f, beforePos.y + 0.11f), afterPos); - } - - @Test - void testTeleportPlayer4() { - player.getComponent(PlayerActions.class).walk(new Vector2(0,1)); - Vector2 beforePos = player.getPosition(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - Vector2 afterPos = player.getPosition(); - assertEquals(new Vector2(beforePos.x, beforePos.y + 24.68f), afterPos); - } - - @Test - void testTeleportPlayer5() { - player.getComponent(PlayerActions.class).walk(new Vector2(0,-1)); + ServiceLocator.registerEntityService(new EntityService()); + GameArea ga = spy(GameArea.class); + player.getComponent(PlayerActions.class).walk(new Vector2(1,0)); Vector2 beforePos = player.getPosition(); skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); - skillManager.teleportPlayer(); + ga.spawnEntity(ObstacleFactory.createWall(5, 5)); + player.getComponent(PlayerActions.class).walk(new Vector2(-1,0)); skillManager.teleportPlayer(); Vector2 afterPos = player.getPosition(); - assertEquals(new Vector2(beforePos.x, beforePos.y + 0.11f), afterPos); + assertEquals(new Vector2(beforePos.x + 6.0f, beforePos.y), afterPos); } @Test diff --git a/source/core/src/test/com/deco2800/game/components/player/SkillsTreeDisplayTest.java b/source/core/src/test/com/deco2800/game/components/player/SkillsTreeDisplayTest.java new file mode 100644 index 000000000..6f7bd390d --- /dev/null +++ b/source/core/src/test/com/deco2800/game/components/player/SkillsTreeDisplayTest.java @@ -0,0 +1,37 @@ +package com.deco2800.game.components.player; + +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.scenes.scene2d.ui.Image; +import com.deco2800.game.SkillsTree.SkillsTreeDisplay; +import com.deco2800.game.entities.Entity; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +public class SkillsTreeDisplayTest { + + SkillsTreeDisplay skillsTreeDisplay; + CooldownBarDisplay cooldownBar; + + @BeforeEach + void init() { + skillsTreeDisplay = Mockito.mock(SkillsTreeDisplay.class); + cooldownBar = Mockito.mock(CooldownBarDisplay.class); + Entity entity = Mockito.mock(Entity.class); + when(entity.getComponent(CooldownBarDisplay.class)).thenReturn(cooldownBar); + + skillsTreeDisplay.setEntity(entity); + } + + @Test + void testCreate() { + //skillsTreeDisplay.create(); + //verify(cooldownBar).addSkillIcon(); + //verify(cooldownBar).addSkillIcon(new Image(new Texture("images/Skills/blankSkillIcon.png"))); + + } + +} diff --git a/source/core/src/test/com/deco2800/game/crafting/CraftingLogicTest.java b/source/core/src/test/com/deco2800/game/crafting/CraftingLogicTest.java index 6fd0cdcf1..42a1d1b31 100644 --- a/source/core/src/test/com/deco2800/game/crafting/CraftingLogicTest.java +++ b/source/core/src/test/com/deco2800/game/crafting/CraftingLogicTest.java @@ -1,22 +1,10 @@ package com.deco2800.game.crafting; //import com.deco2800.game.CombatItems.Weapon; -import com.badlogic.gdx.scenes.scene2d.Stage; -import com.deco2800.game.areas.ForestGameArea; -import com.deco2800.game.areas.GameArea; -import com.deco2800.game.components.gamearea.GameAreaDisplay; -import com.deco2800.game.entities.Entity; -import com.deco2800.game.entities.EntityService; -import com.deco2800.game.entities.configs.combatitemsConfig.WeaponConfig; -import com.deco2800.game.entities.configs.combatitemsConfig.WeaponConfigSetup; -import com.deco2800.game.entities.factories.EntityTypes; +import com.deco2800.game.entities.configs.combatitemsconfig.WeaponConfig; +import com.deco2800.game.entities.configs.combatitemsconfig.WeaponConfigSetup; import com.deco2800.game.extensions.GameExtension; import com.deco2800.game.files.FileLoader; -import com.deco2800.game.input.InputService; -import com.deco2800.game.physics.PhysicsService; -import com.deco2800.game.rendering.RenderService; -import com.deco2800.game.services.ResourceService; -import com.deco2800.game.services.ServiceLocator; import org.junit.Before; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -24,60 +12,13 @@ import java.util.List; import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; @ExtendWith(GameExtension.class) public class CraftingLogicTest { - Entity entity; @Before public void setup() { - ForestGameArea fga = mock(ForestGameArea.class); - ServiceLocator.registerGameArea(fga); - ServiceLocator.registerEntityService(new EntityService()); - ServiceLocator.registerPhysicsService(new PhysicsService()); - ServiceLocator.registerInputService(new InputService()); - ServiceLocator.registerRenderService(new RenderService()); - ResourceService resourceService = new ResourceService(); - ServiceLocator.registerResourceService(resourceService); - - String[] textures = { - "images/CombatItems/Sprint-1/Level 2 Dagger 1.png", - "images/CombatItems/Sprint-1/Level 2 Dagger 2png.png", - "images/CombatItems/Sprint-1/Enemy_dumbbell.png", - "images/CombatItems/Sprint-1/Sword_Lvl2.png", - "images/CombatItems/Sprint-1/trident_Lvl2.png", - "images/CombatItems/Sprint-2/H&ADagger.png", - "images/CombatItems/Sprint-2/Plunger.png", - "images/CombatItems/Sprint-2/pipe.png", - "images/CombatItems/Sprint-3/craftingTeamAssetsNoWhiteSpace/Bow.png", - "images/CombatItems/Sprint-3/craftingTeamAssetsNoWhiteSpace/goldenBowPlunger.png", - "images/Crafting-assets-sprint1/materials/gold.png", - "images/Crafting-assets-sprint1/materials/rainbow_poop.png", - "images/Crafting-assets-sprint1/materials/iron.png", - "images/Crafting-assets-sprint1/materials/toilet_paper.png", - "images/Crafting-assets-sprint1/materials/steel.png", - "images/Crafting-assets-sprint1/materials/wood.png", - "images/Crafting-assets-sprint1/materials/plastic.png", - "images/Crafting-assets-sprint1/materials/rubber.png", - "images/Crafting-assets-sprint1/materials/platinum.png", - "images/Crafting-assets-sprint1/materials/silver.png"}; - resourceService.loadTextures(textures); - String[] textureAtlases = {"images/CombatItems/animations/combatItemsAnimation.atlas"}; - resourceService.loadTextureAtlases(textureAtlases); - resourceService.loadAll(); - - GameArea gameArea = spy(GameArea.class); - RenderService renderService = new RenderService(); - renderService.setStage(mock(Stage.class)); - GameAreaDisplay crafting = new GameAreaDisplay(""); - ServiceLocator.registerGameArea(gameArea); - ServiceLocator.registerRenderService(renderService); - ServiceLocator.registerInventoryArea(crafting); - crafting.create(); - entity = new Entity(); } @Test @@ -157,11 +98,10 @@ void canBuildTest() { assertEquals(CraftingLogic.canBuild(inventoryContentsTest), buildItemsTest); } - @Test - void damageToWeaponTest() { +// @Test +// void damageToWeaponTest() { // WeaponConfigSetup configs = // FileLoader.readClass(WeaponConfigSetup.class, "configs/Weapons.json"); -// // WeaponConfig athenaDag = configs.athenaDag; // WeaponConfig heraDag = configs.heraDag; // WeaponConfig dumbbell = configs.dumbbell; @@ -172,13 +112,11 @@ void damageToWeaponTest() { // WeaponConfig pipe = configs.pipe; // WeaponConfig plungerBow = configs.plungerBow; // WeaponConfig goldenPlungerBow = configs.goldenPlungerBow; -// entity = CraftingLogic.damageToWeapon(athenaDag); -// assertTrue(entity.checkEntityType(EntityTypes.MELEE)); // assertTrue(CraftingLogic.damageToWeapon(athenaDag).checkEntityType(EntityTypes.WEAPON)); // assertEquals(WeaponFactory.createDagger() ,CraftingLogic.damageToWeapon(athenaDag)); // MeleeConfig daggerConfig = new MeleeConfig(); // daggerConfig.damage = 7; // double damage = daggerConfig.damage; // assertEquals(CraftingLogic.damageToWeapon(daggerConfig), WeaponFactory.createDagger()); - } +// } } diff --git a/source/core/src/test/com/deco2800/game/entities/configs/GymBroConfigTest.java b/source/core/src/test/com/deco2800/game/entities/configs/GymBroConfigTest.java index aa98225bd..c4f085dc8 100644 --- a/source/core/src/test/com/deco2800/game/entities/configs/GymBroConfigTest.java +++ b/source/core/src/test/com/deco2800/game/entities/configs/GymBroConfigTest.java @@ -9,8 +9,8 @@ public class GymBroConfigTest { @Test void createTest() { GymBroConfig gymBroConfig = new GymBroConfig(); - assertEquals(2f, gymBroConfig.speed); - assertEquals(5, gymBroConfig.baseAttackGymBro); - assertEquals(70, gymBroConfig.healthGymBro); + assertEquals(2f, gymBroConfig.SPEED); + assertEquals(5, gymBroConfig.BASEATTACKGYMBRO); + assertEquals(70, gymBroConfig.HEALTHGYMBRO); } } diff --git a/source/core/src/test/com/deco2800/game/entities/configs/HeraclesConfigTest.java b/source/core/src/test/com/deco2800/game/entities/configs/HeraclesConfigTest.java index 0f3ff0f1f..8dd2da64f 100644 --- a/source/core/src/test/com/deco2800/game/entities/configs/HeraclesConfigTest.java +++ b/source/core/src/test/com/deco2800/game/entities/configs/HeraclesConfigTest.java @@ -8,8 +8,8 @@ public class HeraclesConfigTest { @Test void createTest() { HeraclesConfig heraclesConfig = new HeraclesConfig(); - assertEquals(10, heraclesConfig.healthHeracles); - assertEquals(10, heraclesConfig.baseAttackHeracles); - assertEquals(2f, heraclesConfig.speed); + assertEquals(100, heraclesConfig.HEALTHHERACLES); + assertEquals(10, heraclesConfig.BASEATTACKHERACLES); + assertEquals(2f, heraclesConfig.SPEED); } } diff --git a/source/core/src/test/com/deco2800/game/entities/configs/MegaPoopConfigTest.java b/source/core/src/test/com/deco2800/game/entities/configs/MegaPoopConfigTest.java index f9d365624..58bb6f399 100644 --- a/source/core/src/test/com/deco2800/game/entities/configs/MegaPoopConfigTest.java +++ b/source/core/src/test/com/deco2800/game/entities/configs/MegaPoopConfigTest.java @@ -8,6 +8,6 @@ public class MegaPoopConfigTest { @Test void createTest() { MegaPoopConfig megaPoopConfig = new MegaPoopConfig(); - assertEquals(100f, megaPoopConfig.speed); + assertEquals(100f, megaPoopConfig.SPEED); } } diff --git a/source/core/src/test/com/deco2800/game/entities/configs/PoopsConfigTest.java b/source/core/src/test/com/deco2800/game/entities/configs/PoopsConfigTest.java index f8fc56c20..a7295e60c 100644 --- a/source/core/src/test/com/deco2800/game/entities/configs/PoopsConfigTest.java +++ b/source/core/src/test/com/deco2800/game/entities/configs/PoopsConfigTest.java @@ -8,7 +8,7 @@ public class PoopsConfigTest { @Test void createTest() { PoopsConfig poopsConfig = new PoopsConfig(); - assertEquals(1f, poopsConfig.speed); - assertEquals(60, poopsConfig.healthPoops); + assertEquals(1f, poopsConfig.SPEED); + assertEquals(60, poopsConfig.HEALTHPOOPS); } } diff --git a/source/core/src/test/com/deco2800/game/entities/factories/ArmourFactoryTest.java b/source/core/src/test/com/deco2800/game/entities/factories/ArmourFactoryTest.java index 84c231609..33a773f39 100644 --- a/source/core/src/test/com/deco2800/game/entities/factories/ArmourFactoryTest.java +++ b/source/core/src/test/com/deco2800/game/entities/factories/ArmourFactoryTest.java @@ -1,5 +1,55 @@ package com.deco2800.game.entities.factories; +import com.badlogic.gdx.graphics.glutils.ShapeRenderer; +import com.badlogic.gdx.math.Matrix4; +import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer; +import com.deco2800.game.components.player.PotionEffectComponent; +import com.deco2800.game.entities.Entity; +import com.deco2800.game.entities.EntityService; +import com.deco2800.game.extensions.GameExtension; +import com.deco2800.game.input.InputService; +import com.deco2800.game.physics.PhysicsLayer; +import com.deco2800.game.physics.PhysicsService; +import com.deco2800.game.rendering.DebugRenderer; +import com.deco2800.game.rendering.RenderService; +import com.deco2800.game.rendering.TextureRenderComponent; +import com.deco2800.game.services.ResourceService; +import com.deco2800.game.services.ServiceLocator; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +@ExtendWith(MockitoExtension.class) +@ExtendWith(GameExtension.class) public class ArmourFactoryTest { + @Mock + ShapeRenderer shapeRenderer; + @Mock + Box2DDebugRenderer physicsRenderer; + @Mock + Matrix4 projMatrix; + DebugRenderer debugRenderer; + @BeforeEach + void setUp() { + debugRenderer = new DebugRenderer(physicsRenderer, shapeRenderer); + ServiceLocator.registerEntityService(new EntityService()); + ServiceLocator.registerPhysicsService(new PhysicsService()); + ServiceLocator.registerInputService(new InputService()); + ServiceLocator.registerResourceService(new ResourceService()); + ServiceLocator.registerRenderService(new RenderService()); + } + @Test + void createArmour() { + Entity entity = ArmourFactory.createTestArmour(); + assertTrue(entity.checkEntityType(EntityTypes.ARMOUR)); + } } diff --git a/source/core/src/test/com/deco2800/game/entities/factories/PotionFactoryTest.java b/source/core/src/test/com/deco2800/game/entities/factories/PotionFactoryTest.java new file mode 100644 index 000000000..ead2f795f --- /dev/null +++ b/source/core/src/test/com/deco2800/game/entities/factories/PotionFactoryTest.java @@ -0,0 +1,67 @@ +package com.deco2800.game.entities.factories; + +import com.badlogic.gdx.graphics.glutils.ShapeRenderer; +import com.badlogic.gdx.math.Matrix4; +import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer; +import com.deco2800.game.components.player.PotionEffectComponent; +import com.deco2800.game.entities.Entity; +import com.deco2800.game.entities.EntityService; +import com.deco2800.game.extensions.GameExtension; +import com.deco2800.game.input.InputService; +import com.deco2800.game.physics.PhysicsLayer; +import com.deco2800.game.physics.PhysicsService; +import com.deco2800.game.rendering.DebugRenderer; +import com.deco2800.game.rendering.RenderService; +import com.deco2800.game.rendering.TextureRenderComponent; +import com.deco2800.game.services.ResourceService; +import com.deco2800.game.services.ServiceLocator; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +@ExtendWith(MockitoExtension.class) +@ExtendWith(GameExtension.class) + class PotionFactoryTest { + @Mock + ShapeRenderer shapeRenderer; + @Mock + Box2DDebugRenderer physicsRenderer; + @Mock + Matrix4 projMatrix; + DebugRenderer debugRenderer; + @BeforeEach + void setUp() { + debugRenderer = new DebugRenderer(physicsRenderer, shapeRenderer); + ServiceLocator.registerEntityService(new EntityService()); + ServiceLocator.registerPhysicsService(new PhysicsService()); + ServiceLocator.registerInputService(new InputService()); + ServiceLocator.registerResourceService(new ResourceService()); + ServiceLocator.registerRenderService(new RenderService()); + } + + @Test + void createSpeedPotion() { + Entity entity = PotionFactory.createTestSpeedPotion(); + assertTrue(entity.checkEntityType(EntityTypes.POTION)); + } + + @Test + void createHealthPotion() { + Entity entity = PotionFactory.createTestHealthPotion(); + assertTrue(entity.checkEntityType(EntityTypes.POTION)); + } + + @Test + void createHealthRegenPotion() { + Entity entity = PotionFactory.createTestHealthRegenPotion(); + assertTrue(entity.checkEntityType(EntityTypes.POTION)); + } +}