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
@@ -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);
}
}
@@ -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);
}
}
@@ -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
}
}
@@ -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;
}
}
@@ -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;
}
}
@@ -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) {
@@ -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;
}
}
@@ -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
}
}
@@ -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;
}
}
@@ -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
}
}
@@ -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
}
}