v0.4.0: loads of item implementation

This commit is contained in:
Evan Debenham 2016-05-22 04:52:26 -04:00
parent 751f11c502
commit 9444a033a1
14 changed files with 514 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -0,0 +1,53 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.utils.Random;
public class AssassinsBlade extends MeleeWeapon {
{
image = ItemSpriteSheet.ASSASSINS_BLADE;
tier = 4;
}
@Override
public int max(int lvl) {
return 4*(tier+1) + //20 base, down from 25
lvl*(tier+1); //scaling unchanged
}
@Override
public int damageRoll(Hero hero) {
Char enemy = hero.enemy();
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero))
//deals avg damage to max on surprise, instead of min to max.
return Random.NormalIntRange((min() + max())/2, max());
else
return super.damageRoll(hero);
}
}

View File

@ -0,0 +1,52 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.utils.Random;
public class Dirk extends MeleeWeapon {
{
image = ItemSpriteSheet.DIRK;
tier = 2;
}
@Override
public int max(int lvl) {
return 4*(tier+1) + //12 base, down from 15
lvl*(tier+1); //scaling unchanged
}
@Override
public int damageRoll(Hero hero) {
Char enemy = hero.enemy();
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero))
//deals avg damage to max on surprise, instead of min to max.
return Random.NormalIntRange((min() + max())/2, max());
else
return super.damageRoll(hero);
}
}

View File

@ -0,0 +1,45 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Flail extends MeleeWeapon {
{
image = ItemSpriteSheet.FLAIL;
tier = 4;
DLY = 1.25f; //0.8x speed
}
@Override
public int min(int lvl) {
return tier + //base unchanged
lvl*2; //+2 per level, up from +1
}
@Override
public int max(int lvl) {
return Math.round(6.33f*(tier+1)) + //32 base, up from 25
lvl*Math.round(1.2f*(tier+1)); //+6 per level, up from +5
}
}

View File

@ -0,0 +1,46 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Greataxe extends MeleeWeapon {
{
image = ItemSpriteSheet.GREATAXE;
tier = 5;
}
@Override
public int max(int lvl) {
return 5*(tier+3) + //40 base, up from 30
lvl*(tier+1); //scaling unchanged
}
@Override
public int STRReq(int lvl) {
lvl = Math.max(0, lvl);
//20 base strength req, up from 18
return (10 + tier * 2) - (int)(Math.sqrt(8 * lvl + 1) - 1)/2;
}
}

View File

@ -0,0 +1,44 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Greatshield extends MeleeWeapon {
{
image = ItemSpriteSheet.GREATSHIELD;
tier = 5;
}
@Override
public int max(int lvl) {
return 2*(tier+1) + //12 base, down from 30
lvl*(tier+1); //scaling unchanged
}
@Override
public int defenceFactor(Hero hero) {
return 10+2*level(); //10 extra defence, plus 3 per level;
}
}

View File

@ -28,7 +28,7 @@ import com.watabou.utils.Random;
public class MeleeWeapon extends Weapon {
protected int tier;
public int tier;
@Override
public int min(int lvl) {

View File

@ -0,0 +1,44 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class RoundShield extends MeleeWeapon {
{
image = ItemSpriteSheet.ROUND_SHIELD;
tier = 3;
}
@Override
public int max(int lvl) {
return 3*(tier+1) + //12 base, down from 20
lvl*(tier+1); //scaling unchanged
}
@Override
public int defenceFactor(Hero hero) {
return 6+2*level(); //6 extra defence, plus 2 per level;
}
}

View File

@ -0,0 +1,47 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class RunicBlade extends MeleeWeapon {
{
image = ItemSpriteSheet.RUNIC_BLADE;
tier = 4;
}
//Essentially it's a tier 4 weapon, with tier 3 base damage, and tier 6 scaling.
//equal to tier 4 in damage at +3, equal to tier 5 at +
@Override
public int min(int lvl) {
return tier-1 + //3 base, down from 4
lvl*2; //+2 per level, up from +1
}
@Override
public int max(int lvl) {
return 5*(tier) + //20 base, down from 25
lvl*(tier+2); //+6 per level, up from +5
}
}

View File

@ -0,0 +1,45 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Sai extends MeleeWeapon {
{
image = ItemSpriteSheet.SAI;
tier = 3;
DLY = 0.5f; //2x speed
}
@Override
public int max(int lvl) {
return Math.round(2.5f*(tier+1)) + //10 base, down from 20
lvl*Math.round(0.5f*(tier+1)); //+2 per level, down from +4
}
@Override
public int defenceFactor(Hero hero) {
return 3+level(); //3 extra defence, plus 1 per level;
}
}

View File

@ -0,0 +1,40 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Scimitar extends MeleeWeapon {
{
image = ItemSpriteSheet.SCIMITAR;
tier = 3;
DLY = 0.8f; //1.25x speed
}
@Override
public int max(int lvl) {
return 4*(tier+1) + //16 base, down from 20
lvl*(tier+1); //+1 per level, down from +2
}
}

View File

@ -0,0 +1,44 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Whip extends MeleeWeapon {
{
image = ItemSpriteSheet.WHIP;
tier = 3;
}
@Override
public int max(int lvl) {
return 3*(tier+1) + //12 base, down from 20
lvl*(tier); //+3 per level, down from +4
}
@Override
public int reachFactor(Hero hero) {
return 3; //lots of extra reach
}
}

View File

@ -681,18 +681,38 @@ items.weapon.enchantments.slow.name=chilling %s
###melee weapons
items.weapon.melee.assassinsblade.name=assassin's blade
items.weapon.melee.assassinsblade.stats_desc=This weapon is stronger against unaware enemies.
items.weapon.melee.assassinsblade.desc=TODO
items.weapon.melee.battleaxe.name=battle axe
items.weapon.melee.battleaxe.stats_desc=This is a rather accurate weapon.
items.weapon.melee.battleaxe.desc=The enormous steel head of this battle axe puts considerable heft behind each stroke.
items.weapon.melee.dagger.name=dagger
items.weapon.melee.dagger.stats_desc=This weapon is very effective against unaware enemies.
items.weapon.melee.dagger.stats_desc=This weapon is stronger against unaware enemies.
items.weapon.melee.dagger.desc=A simple iron dagger with a well worn wooden handle.
items.weapon.melee.dirk.name=dirk
items.weapon.melee.dirk.stats_desc=This weapon is stronger against unaware enemies.
items.weapon.melee.dirk.desc=TODO
items.weapon.melee.flail.name=flail
items.weapon.melee.flail.stats_desc=This is a slightly slow weapon.\nThis is a rather inaccurate weapon.
items.weapon.melee.flail.desc=TODO
items.weapon.melee.glaive.name=glaive
items.weapon.melee.glaive.stats_desc=This is a rather slow weapon.\nThis weapon has extra reach.
items.weapon.melee.glaive.desc=A massive polearm consisting of a sword blade on the end of a pole.
items.weapon.melee.greataxe.name=greataxe
items.weapon.melee.greataxe.stats_desc=This weapon is incredibly heavy.
items.weapon.melee.greataxe.desc=TODO
items.weapon.melee.greatshield.name=greatshield
items.weapon.melee.greatshield.stats_desc=This weapon grants tremendous damage absorbtion.
items.weapon.melee.greatshield.desc=TODO
items.weapon.melee.greatsword.name=greatsword
items.weapon.melee.greatsword.desc=This towering blade inflicts heavy damage by investing its heft into every swing.
@ -701,7 +721,7 @@ items.weapon.melee.handaxe.stats_desc=This is a rather accurate weapon.
items.weapon.melee.handaxe.desc=TODO
items.weapon.melee.knuckles.name=knuckleduster
items.weapon.melee.knuckles.stats_desc=This is a rather fast weapon.
items.weapon.melee.knuckles.stats_desc=This is a very fast weapon.
items.weapon.melee.knuckles.desc=A piece of iron shaped to fit around the knuckles.
items.weapon.melee.longsword.name=longsword
@ -736,9 +756,25 @@ items.weapon.melee.newshortsword.name=shortsword
items.weapon.melee.newshortsword.desc=A quite short sword, only a few inches longer than a dagger.
items.weapon.melee.quarterstaff.name=quarterstaff
items.weapon.melee.quarterstaff.stats_desc=This weapon increases your damage absorbtion.
items.weapon.melee.quarterstaff.stats_desc=This weapon grants some damage absorbtion.
items.weapon.melee.quarterstaff.desc=A staff of hardwood, its ends are shod with iron.
items.weapon.melee.roundshield.name=round shield
items.weapon.melee.roundshield.stats_desc=This weapon grants considerable damage absorbtion.
items.weapon.melee.roundshield.desc=TODO
items.weapon.melee.runicblade.name=runic blade
items.weapon.melee.runicblade.stats_desc=This weapon benefits more from upgrades.
items.weapon.melee.runicblade.desc=TODO
items.weapon.melee.sai.name=sai
items.weapon.melee.sai.stats_desc=This is a very fast weapon.\nThis weapon grants some damage absorbtion.
items.weapon.melee.sai.desc=TODO
items.weapon.melee.scimitar.name=scimitar
items.weapon.melee.scimitar.stats_desc=This is a rather fast weapon.
items.weapon.melee.scimitar.desc=TODO
items.weapon.melee.spear.name=spear
items.weapon.melee.spear.stats_desc=This is a rather slow weapon.\nThis weapon has extra reach.
items.weapon.melee.spear.desc=A slender wooden rod tipped with sharpened iron.
@ -750,6 +786,10 @@ items.weapon.melee.warhammer.name=war hammer
items.weapon.melee.warhammer.stats_desc=This is a rather accurate weapon.
items.weapon.melee.warhammer.desc=Few creatures can withstand the crushing blow of this towering mass of lead and steel, but only the strongest of adventurers can use it effectively.
items.weapon.melee.whip.name=whip
items.weapon.melee.whip.stats_desc=This weapon has tremendous reach.
items.weapon.melee.whip.desc=TODO
items.weapon.melee.wornshortsword.name=worn shortsword
items.weapon.melee.wornshortsword.desc=A quite short sword, worn down through heavy use. It is both weaker and a bit lighter than a shortsword in better condition.

View File

@ -85,19 +85,29 @@ public class ItemSpriteSheet {
public static final int HAND_AXE = WEP_TIER2+1;
public static final int SPEAR = WEP_TIER2+2;
public static final int QUARTERSTAFF = WEP_TIER2+3;
public static final int DIRK = WEP_TIER2+4;
private static final int WEP_TIER3 = xy(1, 8); //8 slots
public static final int SWORD = WEP_TIER3+0;
public static final int MACE = WEP_TIER3+1;
public static final int SCIMITAR = WEP_TIER3+2;
public static final int ROUND_SHIELD = WEP_TIER3+3;
public static final int SAI = WEP_TIER3+4;
public static final int WHIP = WEP_TIER3+5;
private static final int WEP_TIER4 = xy(9, 8); //8 slots
public static final int LONGSWORD = WEP_TIER4+0;
public static final int BATTLE_AXE = WEP_TIER4+1;
public static final int FLAIL = WEP_TIER4+2;
public static final int RUNIC_BLADE = WEP_TIER4+3;
public static final int ASSASSINS_BLADE = WEP_TIER4+4;
private static final int WEP_TIER5 = xy(1, 9); //8 slots
public static final int GREATSWORD = WEP_TIER5+0;
public static final int WAR_HAMMER = WEP_TIER5+1;
public static final int GLAIVE = WEP_TIER5+2;
public static final int GREATAXE = WEP_TIER5+3;
public static final int GREATSHIELD = WEP_TIER5+4;
//8 free slots