• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java HeroSubClass类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.watabou.pixeldungeon.actors.hero.HeroSubClass的典型用法代码示例。如果您正苦于以下问题:Java HeroSubClass类的具体用法?Java HeroSubClass怎么用?Java HeroSubClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

HeroSubClass类属于com.watabou.pixeldungeon.actors.hero包,在下文中一共展示了HeroSubClass类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: wither

点赞 3

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
public void wither() {
	Dungeon.level.uproot( pos );
	
	sprite.kill();
	if (Dungeon.visible[pos]) {
		CellEmitter.get( pos ).burst( LeafParticle.GENERAL, 6 );
	}
	
	if (Dungeon.hero.subClass == HeroSubClass.WARDEN) {
		if (Random.Int( 5 ) == 0) {
			Dungeon.level.drop( Generator.random( Generator.Category.SEED ), pos ).sprite.drop();
		}
		if (Random.Int( 5 ) == 0) {
			Dungeon.level.drop( new Dewdrop(), pos ).sprite.drop();
		}
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:18,
代码来源:Plant.java

示例2: choose

点赞 3

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
public void choose( HeroSubClass way ) {
	
	detach( curUser.belongings.backpack );
	
	curUser.spend( TomeOfMastery.TIME_TO_READ );
	curUser.busy();
	
	curUser.subClass = way;
	
	curUser.sprite.operate( curUser.pos );
	Sample.INSTANCE.play( Assets.SND_MASTERY );
	
	SpellSprite.show( curUser, SpellSprite.MASTERY );
	curUser.sprite.emitter().burst( Speck.factory( Speck.MASTERY ), 12 );
	GLog.w( "You have chosen the way of the %s!", Utils.capitalize( way.title() ) );
	
	if (way == HeroSubClass.BERSERKER && curUser.HP <= curUser.HT * Fury.LEVEL) {
		Buff.affect( curUser, Fury.class );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:21,
代码来源:TomeOfMastery.java

示例3: execute

点赞 3

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	if (action.equals( AC_NECROMANCY )) {

		setCurUser(hero);
		
		HeroSubClass way;

		switch (hero.heroClass) {
		default:
			GLog.w("Error: How did you get this item?! You're not supposed to be able to obtain it!!");
			return;
		case NECROMANCER:
			way = HeroSubClass.LICH;
			hero.setMaxSoulPoints(hero.getSoulPointsMax() * 2);
			break;
		}
		GameScene.show( new WndChooseWay( this, way ) );
	} else {
		super.execute( hero, action );
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:23,
代码来源:BlackSkullOfMastery.java

示例4: choose

点赞 3

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
public void choose( HeroSubClass way ) {
	detach( getCurUser().belongings.backpack );

	getCurUser().subClass = way;

	getCurUser().getSprite().operate( getCurUser().getPos() );
	Sample.INSTANCE.play( Assets.SND_MASTERY );

	SpellSprite.show( getCurUser(), SpellSprite.MASTERY );
	getCurUser().getSprite().emitter().burst( Speck.factory( Speck.MASTERY ), 12 );
	if (way == HeroSubClass.LICH){
		int penalty = 2;
		specialChooseMessage(penalty);
		getCurUser().STR(getCurUser().STR() - penalty);
	}

	GLog.w(Game.getVar(R.string.TomeOfMastery_Choose), Utils.capitalize( way.title() ) );

	getCurUser().checkIfFurious();
	getCurUser().updateLook();

	getCurUser().spendAndNext( TIME_TO_READ );
	getCurUser().busy();
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:25,
代码来源:MasteryItem.java

示例5: baseChance

点赞 3

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
private double baseChance(Hero hero) {
	double armorPenalty = 1;
	
	if(hero.belongings.armor != null) {
		armorPenalty += hero.belongings.armor.tier;
	}
	
	double classBonus = 1;
	if(hero.subClass == HeroSubClass.WARDEN ) {
		classBonus = 1.5;
	}
	
	if(hero.subClass == HeroSubClass.SHAMAN) {
		classBonus = 2.0;
	}

	if(hero.heroClass == HeroClass.NECROMANCER) {
		classBonus = 3.0;
	}

	return (0.25 + (hero.lvl() * 4 + Math.pow(level(),2)) * 0.01) * classBonus / armorPenalty;
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:23,
代码来源:SacrificialSword.java

示例6: bodyDescriptor

点赞 3

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
private String bodyDescriptor(Hero hero) {
	String descriptor = "man";

	if(hero.getGender()== Utils.FEMININE) {
		descriptor = "woman";
	}

	if(hero.subClass.equals(HeroSubClass.WARLOCK)) {
		descriptor = "warlock";
	}

	if(hero.subClass.equals(HeroSubClass.LICH)) {
		descriptor = "lich";
	}

	if(hero.heroClass == HeroClass.GNOLL) {
		descriptor = "gnoll";
	}

	return "hero/body/"+descriptor+".png";
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:22,
代码来源:HeroSpriteDef.java

示例7: defenseProc

点赞 3

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
@Override
public int defenseProc(Char enemy, int damage) {
	if (!enemySeen && enemy == Dungeon.hero
			&& ((Hero) enemy).subClass == HeroSubClass.ASSASSIN) {
		damage += Random.Int(1, damage);
		Wound.hit(this);
	}

	setEnemy(enemy);

	runMobScript("onDefenceProc", enemy, damage);

	if(scriptResult.isnumber()) {
		return scriptResult.checknumber().toint();
	}

	return damage;
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:19,
代码来源:Mob.java

示例8: wither

点赞 3

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
public void wither() {
	Dungeon.level.uproot(pos);

	sprite.kill();
	if (Dungeon.visible[pos]) {
		CellEmitter.get(pos).burst(LeafParticle.GENERAL, 6);
	}

	if (Dungeon.hero.subClass == HeroSubClass.WARDEN) {
		if (Random.Int(5) == 0) {
			Dungeon.level.drop(Generator.random(Generator.Category.SEED),
					pos).sprite.drop();
		}
		if (Random.Int(5) == 0) {
			Dungeon.level.drop(new Dewdrop(), pos).sprite.drop();
		}
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:19,
代码来源:Plant.java

示例9: upgrade

点赞 3

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
public static Armor upgrade ( Hero owner, Armor armor ) {

		ClassArmor classArmor;
		if(owner.subClass == HeroSubClass.NONE) {
			classArmor = owner.heroClass.classArmor();
		} else {
			classArmor = owner.subClass.classArmor();
		}

		classArmor.STR = armor.STR;
		classArmor.DR  = armor.DR;
		
		classArmor.inscribe( armor.glyph );
		
		return classArmor;
	}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:17,
代码来源:ClassArmor.java

示例10: defenseProc

点赞 2

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
@Override
public int defenseProc( Char enemy, int damage ) {
	if (!enemySeen && enemy == Dungeon.hero && ((Hero)enemy).subClass == HeroSubClass.ASSASSIN) {
		damage += Random.Int( 1, damage );
		Wound.hit( this );
	}
	return damage;
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:9,
代码来源:Mob.java

示例11: die

点赞 2

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
@Override
public void die( Object cause ) {
	
	Badges.Badge badgeToCheck = null;
	switch (Dungeon.hero.heroClass) {
	case WARRIOR:
		badgeToCheck = Badge.MASTERY_WARRIOR;
		break;
	case MAGE:
		badgeToCheck = Badge.MASTERY_MAGE;
		break;
	case ROGUE:
		badgeToCheck = Badge.MASTERY_ROGUE;
		break;
	case HUNTRESS:
		badgeToCheck = Badge.MASTERY_HUNTRESS;
		break;
	}
	if (!Badges.isUnlocked( badgeToCheck ) || Dungeon.hero.subClass != HeroSubClass.NONE) {
		Dungeon.level.drop( new TomeOfMastery(), pos ).sprite.drop();
	}
	
	GameScene.bossSlain();
	Dungeon.level.drop( new SkeletonKey(), pos ).sprite.drop();
	super.die( cause );
	
	Badges.validateBossSlain();
	
	yell( "Free at last..." );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:31,
代码来源:Tengu.java

示例12: MasteryTab

点赞 2

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
public MasteryTab() {
	super();
	
	String message = null;
	switch (cl) {
	case WARRIOR:
		message = HeroSubClass.GLADIATOR.desc() + "\n\n" + HeroSubClass.BERSERKER.desc();
		break;
	case MAGE:
		message = HeroSubClass.BATTLEMAGE.desc() + "\n\n" + HeroSubClass.WARLOCK.desc();
		break;
	case ROGUE:
		message = HeroSubClass.FREERUNNER.desc() + "\n\n" + HeroSubClass.ASSASSIN.desc();
		break;
	case HUNTRESS:
		message = HeroSubClass.SNIPER.desc() + "\n\n" + HeroSubClass.WARDEN.desc();
		break;
	}

	HighlightedText text = new HighlightedText( 6 );
	text.text( message, WIDTH - MARGIN * 2 );
	text.setPos( MARGIN, MARGIN );
	add( text );
	
	height = text.bottom() + MARGIN;
	width = text.right() + MARGIN;
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:28,
代码来源:WndClass.java

示例13: WndChooseWay

点赞 2

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
public WndChooseWay( final TomeOfMastery tome, final HeroSubClass way1, final HeroSubClass way2 ) {
	
	super();
	
	final String TXT_MASTERY	= "Which way will you follow?";
	final String TXT_CANCEL		= "I'll decide later";
	
	float bottom = createCommonStuff( tome, way1.desc() + "\n\n" + way2.desc() + "\n\n" + TXT_MASTERY );
	
	RedButton btnWay1 = new RedButton( Utils.capitalize( way1.title() ) ) {
		@Override
		protected void onClick() {
			hide();
			tome.choose( way1 );
		}
	};
	btnWay1.setRect( 0, bottom + GAP, (WIDTH - GAP) / 2, BTN_HEIGHT );
	add( btnWay1 );
	
	RedButton btnWay2 = new RedButton( Utils.capitalize( way2.title() ) ) {
		@Override
		protected void onClick() {
			hide();
			tome.choose( way2 );
		}
	};
	btnWay2.setRect( btnWay1.right() + GAP, btnWay1.top(), btnWay1.width(), BTN_HEIGHT );
	add( btnWay2 );
	
	RedButton btnCancel = new RedButton( TXT_CANCEL ) {
		@Override
		protected void onClick() {
			hide();
		}
	};
	btnCancel.setRect( 0, btnWay2.bottom() + GAP, WIDTH, BTN_HEIGHT );
	add( btnCancel );
	
	resize( WIDTH, (int)btnCancel.bottom() );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:41,
代码来源:WndChooseWay.java

示例14: trample

点赞 2

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
public static void trample( Level level, int pos, Char ch ) {
	
	Level.set( pos, Terrain.GRASS );
	GameScene.updateMap( pos );
	
	if (!Dungeon.isChallenged( Challenges.NO_HERBALISM )) {
		int herbalismLevel = 0;
		if (ch != null) {
			Herbalism herbalism = ch.buff( Herbalism.class );
			if (herbalism != null) {
				herbalismLevel = herbalism.level;
			}
		}
		// Seed
		if (herbalismLevel >= 0 && Random.Int( 18 ) <= Random.Int( herbalismLevel + 1 )) {
			level.drop( Generator.random( Generator.Category.SEED ), pos ).sprite.drop();
		}
		
		// Dew
		if (herbalismLevel >= 0 && Random.Int( 6 ) <= Random.Int( herbalismLevel + 1 )) {
			level.drop( new Dewdrop(), pos ).sprite.drop();
		}
	}
	
	int leaves = 4;
	
	// Warlock's barkskin
	if (ch instanceof Hero && ((Hero)ch).subClass == HeroSubClass.WARDEN) {
		Buff.affect( ch, Barkskin.class ).level( ch.HT / 3 );
		leaves = 8;
	}
	
	CellEmitter.get( pos ).burst( LeafParticle.LEVEL_SPECIFIC, leaves );
	Dungeon.observe();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:36,
代码来源:HighGrass.java

示例15: activate

点赞 2

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
public void activate( Char ch ) {
	
	if (ch instanceof Hero && ((Hero)ch).subClass == HeroSubClass.WARDEN) {
		Buff.affect( ch, Barkskin.class ).level( ch.HT / 3 );
	}
	
	wither();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:9,
代码来源:Plant.java

示例16: onSelect

点赞 2

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
@Override
public void onSelect( Integer target ) {
	if (target != null && target != curUser.pos) {
		
		int cell = Ballistica.cast( curUser.pos, target, false, true );
		if (Actor.findChar( cell ) != null && cell != curUser.pos) {
			cell = Ballistica.trace[Ballistica.distance - 2];
		}
		
		curUser.HP -= (curUser.HP / 3);
		if (curUser.subClass == HeroSubClass.BERSERKER && curUser.HP <= curUser.HT * Fury.LEVEL) {
			Buff.affect( curUser, Fury.class );
		}
		
		Invisibility.dispel();
		
		final int dest = cell;
		curUser.busy();
		curUser.sprite.jump( curUser.pos, cell, new Callback() {
			@Override
			public void call() {
				curUser.move( dest );
				Dungeon.level.press( dest, curUser );
				Dungeon.observe();
				
				for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
					Char mob = Actor.findChar( curUser.pos + Level.NEIGHBOURS8[i] );
					if (mob != null && mob != curUser) {
						Buff.prolong( mob, Paralysis.class, SHOCK_TIME );
					}
				}
				
				CellEmitter.center( dest ).burst( Speck.factory( Speck.DUST ), 10 );
				Camera.main.shake( 2, 0.5f );
				
				curUser.spendAndNext( LEAP_TIME );
			}
		} );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:41,
代码来源:WarriorArmor.java

示例17: execute

点赞 2

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	if (action.equals( AC_READ )) {
		
		if (hero.buff( Blindness.class ) != null) {
			GLog.w( TXT_BLINDED );
			return;
		}
		
		curUser = hero;
		
		switch (hero.heroClass) {
		case WARRIOR:
			read( hero, HeroSubClass.GLADIATOR, HeroSubClass.BERSERKER );
			break;
		case MAGE:
			read( hero, HeroSubClass.BATTLEMAGE, HeroSubClass.WARLOCK );
			break;
		case ROGUE:
			read( hero, HeroSubClass.ASSASSIN, HeroSubClass.FREERUNNER );
			break;
		case HUNTRESS:
			read( hero, HeroSubClass.SNIPER, HeroSubClass.WARDEN );
			break;
		}
		
	} else {			
		super.execute( hero, action );		
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:31,
代码来源:TomeOfMastery.java

示例18: read

点赞 2

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
private void read( Hero hero, HeroSubClass sc1, HeroSubClass sc2 ) {
	if (hero.subClass == sc1) {
		GameScene.show( new WndChooseWay( this, sc2 ) );
	} else if (hero.subClass == sc2) {
		GameScene.show( new WndChooseWay( this, sc1 ) );
	} else {
		GameScene.show( new WndChooseWay( this, sc1, sc2 ) );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:10,
代码来源:TomeOfMastery.java

示例19: execute

点赞 2

import com.watabou.pixeldungeon.actors.hero.HeroSubClass; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	if (action.equals( AC_READ )) {
		
		if (hero.buff( Blindness.class ) != null) {
			GLog.w( TXT_BLINDED );
			return;
		}
		
		curUser = hero;
		
		HeroSubClass way1 = null;
		HeroSubClass way2 = null;
		switch (hero.heroClass) {
		case WARRIOR:
			way1 = HeroSubClass.GLADIATOR;
			way2 = HeroSubClass.BERSERKER;
			break;
		case MAGE:
			way1 = HeroSubClass.BATTLEMAGE;
			way2 = HeroSubClass.WARLOCK;
			break;
		case ROGUE:
			way1 = HeroSubClass.FREERUNNER;
			way2 = HeroSubClass.ASSASSIN;
			break;
		case HUNTRESS:
			way1 = HeroSubClass.SNIPER;
			way2 = HeroSubClass.WARDEN;
			break;
		}
		GameScene.show( new WndChooseWay( this, way1, way2 ) );
		
	} else {
		
		super.execute( hero, action );
		
	}
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:40,
代码来源:TomeOfMastery.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)