Skip to content

Commit

Permalink
Added the Hero's Sword.
Browse files Browse the repository at this point in the history
  • Loading branch information
Smujb committed Dec 19, 2020
1 parent a94726c commit aa53fe6
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 3 deletions.
4 changes: 4 additions & 0 deletions core/src/main/assets/messages/items/items.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,10 @@ items.weapon.melee.shield.desc=More like a mobile wall than a shield, this gigan
items.weapon.melee.sword.name=longsword
items.weapon.melee.sword.desc=This sword's long razor-sharp steel blade shines reassuringly, though its size does make it quite heavy.

items.weapon.melee.herosword.name=Hero's Sword
items.weapon.melee.herosword.desc="A sword wields no strength unless the hand that holds it has courage."\nSaid to be a gift from the gods, this sword gains power from their blessings.
items.weapon.melee.herosword.bless_bonus=This weapon deals +_100%_ damage when the user is _blessed_.

items.weapon.melee.axe.name=hand axe
items.weapon.melee.axe.desc=A light axe, most commonly used for felling trees. The wide blade works well against foes as well.

Expand Down
Binary file modified core/src/main/assets/sprites/items.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified core/src/main/assets/sprites/items.xcf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public static void initTest(Hero hero) {
new WandOfVoltage().identify().collect();
new WandOfDarkness().identify().collect();

for (Class<?> itemClass : Generator.Category.SHIELD.classes) {
for (Class<?> itemClass : Generator.Category.WEAPON.classes) {
Item item = (Item) Reflection.newInstance(itemClass);
if (item != null) {
item.random();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
import com.shatteredpixel.yasd.general.items.weapon.melee.Flail;
import com.shatteredpixel.yasd.general.items.weapon.melee.Glove;
import com.shatteredpixel.yasd.general.items.weapon.melee.Greataxe;
import com.shatteredpixel.yasd.general.items.weapon.melee.HeroSword;
import com.shatteredpixel.yasd.general.items.weapon.melee.Hoe;
import com.shatteredpixel.yasd.general.items.weapon.melee.Katana;
import com.shatteredpixel.yasd.general.items.weapon.melee.Mace;
Expand Down Expand Up @@ -567,10 +568,11 @@ public static int order( Item item ) {
Rapier.class,
RoyalHalberd.class,
PlainSword.class,
Pitchfork.class
Pitchfork.class,
HeroSword.class

};
WEAPON.probs = new float[]{ 1, 1, 0, 4, 4, 4, 6, 5, 5, 4, 4, 6, 4, 3, 3, 2, 2, 3, 1, 1, 4, 2 };
WEAPON.probs = new float[]{ 1, 1, 0, 4, 4, 4, 6, 5, 5, 4, 4, 6, 4, 3, 3, 2, 2, 3, 1, 1, 4, 2, 2 };

SHIELD.classes = new Class<?>[] {
RoundShield.class,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.shatteredpixel.yasd.general.items.weapon.melee;

import com.shatteredpixel.yasd.general.actors.Char;
import com.shatteredpixel.yasd.general.actors.buffs.Bless;
import com.shatteredpixel.yasd.general.messages.Messages;
import com.shatteredpixel.yasd.general.sprites.ItemSpriteSheet;

public class HeroSword extends MeleeWeapon {

{
image = ItemSpriteSheet.Weapons.HERO_SWORD;

damageFactor = 2/3f;
}

@Override
public int proc(Char attacker, Char defender, int damage) {
if (attacker.buff(Bless.class) != null) damage *= 2;
return super.proc(attacker, defender, damage);
}

@Override
protected boolean hasProperties() {
return true;
}

@Override
protected String propsDesc() {
return super.propsDesc() + Messages.get(this, "bless_bonus");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ public static class Weapons {
public static final int HOE = WEAPON+22;
public static final int RAPIER = WEAPON+23;
public static final int BUTCHER_KNIFE = WEAPON+24;
public static final int HERO_SWORD = WEAPON+25;
}

public static class Shields {
Expand Down

0 comments on commit aa53fe6

Please sign in to comment.