Java MeleeWeapon类代码示例(javameleeweapon类代码示例汇总)

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


Java MeleeWeapon类代码示例(javameleeweapon类代码示例汇总)

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

示例1: damageRoll

import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; //导入依赖的package包/类
@Override
public int damageRoll( Char owner ) {
	
	int damage = super.damageRoll( owner );
	
	if (owner instanceof Hero &&
			(this instanceof MeleeWeapon
			|| (this instanceof MissileWeapon && ((Hero)owner).heroClass == HeroClass.HUNTRESS))) {
		int exStr = ((Hero)owner).STR() - STRReq();
		if (exStr > 0) {
			damage += Random.IntRange( 0, exStr );
		}
	}
	
	return imbue.damageFactor(damage);
} 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:17,代码来源:Weapon.java

示例2: attackProc

import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; //导入依赖的package包/类
@Override
public int attackProc( Char enemy, int damage ) {
       KindOfWeapon wep = rangedWeapon != null ? rangedWeapon : belongings.weapon;

	if (wep != null)  wep.proc( this, enemy, damage );
		
	switch (subClass) {
	case GLADIATOR:
		if (wep instanceof MeleeWeapon || wep == null) {
			damage += Buff.affect( this, Combo.class ).hit( enemy, damage );
		}
		break;
	case BATTLEMAGE:
		if (wep instanceof Wand) {
			Wand wand = (Wand)wep;
			if (wand.curCharges < wand.maxCharges && damage > 0) {

				wand.curCharges++;
				if (Dungeon.quickslot.contains(wand)) {
					QuickSlotButton.refresh();
				}

				ScrollOfRecharging.charge( this );
			}
			damage += wand.curCharges;
		}
	case SNIPER:
		if (rangedWeapon != null) {
			Buff.prolong( enemy, SnipersMark.class, attackDelay() * 1.1f );
		}
		break;
	default:
	}

	
	return damage;
} 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:38,代码来源:Hero.java

示例3: Statue

import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; //导入依赖的package包/类
public Statue() {
	super();
	
	do {
		weapon = (Weapon)Generator.random( Generator.Category.WEAPON );
	} while (!(weapon instanceof MeleeWeapon) || weapon.level < 0);
	
	weapon.identify();
	weapon.enchant( Enchantment.random() );
	
	HP = HT = 15 + Dungeon.depth * 5;
	defenseSkill = 4 + Dungeon.depth;
} 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:14,代码来源:Statue.java

示例4: affectItem

import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; //导入依赖的package包/类
@Override
protected Item affectItem( Item item ) {
	
	if (item instanceof MagesStaff) {
		item = changeStaff( (MagesStaff)item );
	} else if (item instanceof MeleeWeapon) {
		item = changeWeapon( (MeleeWeapon)item );
	} else if (item instanceof Scroll) {
		item = changeScroll( (Scroll)item );
	} else if (item instanceof Potion) {
		item = changePotion( (Potion)item );
	} else if (item instanceof Ring) {
		item = changeRing( (Ring)item );
	} else if (item instanceof Wand) {
		item = changeWand( (Wand)item );
	} else if (item instanceof Plant.Seed) {
		item = changeSeed( (Plant.Seed)item );
	} else if (item instanceof Artifact) {
		item = changeArtifact( (Artifact)item );
	} else {
		item = null;
	}
	
	//incase a never-seen item pops out
	if (item != null&& item.isIdentified()){
		Catalog.setSeen(item.getClass());
	}

	return item;

} 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:32,代码来源:WaterOfTransmutation.java

示例5: Statue

import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; //导入依赖的package包/类
public Statue() {
	super();
	
	do {
		weapon = (Weapon)Generator.random( Generator.Category.WEAPON );
	} while (!(weapon instanceof MeleeWeapon) || weapon.cursed);
	
	weapon.enchant( Enchantment.random() );
	
	HP = HT = 15 + Dungeon.depth * 5;
	defenseSkill = 4 + Dungeon.depth;
} 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:13,代码来源:Statue.java

示例6: createLoot

import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; //导入依赖的package包/类
@Override
protected Item createLoot() {
	Item loot;
	do {
		loot = Generator.random(Generator.Category.WEAPON);
		//50% chance of re-rolling tier 4 or 5 items
	} while (loot instanceof MeleeWeapon && ((MeleeWeapon) loot).tier >= 4 && Random.Int(2) == 0);
	loot.level(0);
	return loot;
} 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:11,代码来源:Skeleton.java

示例7: restoreFromBundle

import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; //导入依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle(bundle);

	talkedTo = bundle.getBoolean( TALKEDTO );
	firstSummon = bundle.getBoolean( FIRSTSUMMON );
	ghostID = bundle.getInt( GHOSTID );
	droppedPetals = bundle.getInt( PETALS );
	
	if (bundle.contains(WEAPON)) weapon = (MeleeWeapon)bundle.get( WEAPON );
	if (bundle.contains(ARMOR))  armor = (Armor)bundle.get( ARMOR );
} 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:13,代码来源:DriedRose.java

示例8: updateText

import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; //导入依赖的package包/类
private void updateText(){

		if (bottomRightIcon != null){
			remove(bottomRightIcon);
			bottomRightIcon = null;
		}

		if (item == null){
			topLeft.visible = topRight.visible = bottomRight.visible = false;
			return;
		} else {
			topLeft.visible = topRight.visible = bottomRight.visible = true;
		}

		topLeft.text( item.status() );

		boolean isArmor = item instanceof Armor;
		boolean isWeapon = item instanceof Weapon;
		if (isArmor || isWeapon) {

			if (item.levelKnown || (isWeapon && !(item instanceof MeleeWeapon))) {

				int str = isArmor ? ((Armor)item).STRReq() : ((Weapon)item).STRReq();
				topRight.text( Messages.format( TXT_STRENGTH, str ) );
				if (str > Dungeon.hero.STR()) {
					topRight.hardlight( DEGRADED );
				} else {
					topRight.resetColor();
				}

			} else {

				topRight.text( Messages.format( TXT_TYPICAL_STR, isArmor ?
						((Armor)item).STRReq(0) :
						((Weapon)item).STRReq(0) ) );
				topRight.hardlight( WARNING );

			}
			topRight.measure();

		} else if (item instanceof Key && !(item instanceof SkeletonKey)) {
			topRight.text(Messages.format(TXT_KEY_DEPTH, ((Key) item).depth));
			topRight.measure();
		} else {

			topRight.text( null );

		}

		int level = item.visiblyUpgraded();

		if (level != 0) {
			bottomRight.text( item.levelKnown ? Messages.format( TXT_LEVEL, level ) : TXT_CURSED );
			bottomRight.measure();
			bottomRight.hardlight( level > 0 ? UPGRADED : DEGRADED );
		} else if (item instanceof Scroll || item instanceof Potion) {
			bottomRight.text( null );

			Integer iconInt;
			if (item instanceof Scroll){
				iconInt = ((Scroll) item).initials();
			} else {
				iconInt = ((Potion) item).initials();
			}
			if (iconInt != null && iconVisible) {
				bottomRightIcon = new Image(Assets.CONS_ICONS);
				int left = iconInt*7;
				int top = item instanceof Potion ? 0 : 8;
				bottomRightIcon.frame(left, top, 7, 8);
				add(bottomRightIcon);
			}

		} else {
			bottomRight.text( null );
		}

		layout();
	} 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:79,代码来源:ItemSlot.java

本文标签属性:

示例:示例志愿表

代码:代码零九

java:javascript18岁

MeleeWeapon:MeleeWeapon

上一篇:名词解释自首(自首名词解释)(【自首是什么意思是什么意思自首是什么意思)
下一篇:31岁博士坠亡(31岁博士坠亡有前途吗?)

为您推荐