Skip to content

Commit

Permalink
UI창 추가
Browse files Browse the repository at this point in the history
[추가 컨텐츠]
- windows
-- 몬스터 정보창
-- 퀘스트창
-- 도전과제창
-- 식물 정보창

[수정사항]
- 컨텐츠(NPC, 퀘스트, 몬스터, 맵)들이 추가됨으로써 사용하지 않던 기능 주석 해제
  • Loading branch information
gagip committed Jul 8, 2021
1 parent 7affe47 commit e97d1a8
Show file tree
Hide file tree
Showing 20 changed files with 662 additions and 200 deletions.
Original file line number Diff line number Diff line change
@@ -1,135 +1,156 @@
package com.example.pedometerpixeldungeon.mainsrc.actors.mobs;

import com.example.pedometerpixeldungeon.mainsrc.Dungeon;
import com.example.pedometerpixeldungeon.mainsrc.ResultDescriptions;
import com.example.pedometerpixeldungeon.mainsrc.actors.Actor;
import com.example.pedometerpixeldungeon.mainsrc.actors.Char;
import com.example.pedometerpixeldungeon.mainsrc.actors.buffs.Light;
import com.example.pedometerpixeldungeon.mainsrc.actors.buffs.Terror;
import com.example.pedometerpixeldungeon.mainsrc.effects.CellEmitter;
import com.example.pedometerpixeldungeon.mainsrc.effects.particles.PurpleParticle;
import com.example.pedometerpixeldungeon.mainsrc.items.Dewdrop;
import com.example.pedometerpixeldungeon.mainsrc.items.wands.WandOfDisintegration;
import com.example.pedometerpixeldungeon.mainsrc.items.weapons.enchantments.Death;
import com.example.pedometerpixeldungeon.mainsrc.items.weapons.enchantments.Leech;
import com.example.pedometerpixeldungeon.mainsrc.mechanics.Ballistica;
import com.example.pedometerpixeldungeon.mainsrc.sprites.CharSprite;
import com.example.pedometerpixeldungeon.mainsrc.sprites.mobsprites.EyeSprite;
import com.example.pedometerpixeldungeon.mainsrc.utils.GLog;
import com.example.pedometerpixeldungeon.mainsrc.utils.Utils;
import com.example.pedometerpixeldungeon.utils.Random;

import java.util.HashSet;

public class Eye extends Mob {
// private static final String TXT_DEATHGAZE_KILLED = "%s's deathgaze killed you...";
//
// {
// name = "evil eye";
// spriteClass = EyeSprite.class;
//
// HP = HT = 100;
// defenseSkill = 20;
// viewDistance = Light.DISTANCE;
//
// EXP = 13;
// maxLvl = 25;
//
// flying = true;
//
// loot = new Dewdrop();
// lootChance = 0.5f;
// }
//
// @Override
// public int dr() {
// return 10;
// }
//
// private int hitCell;
//
// @Override
// protected boolean canAttack( Char enemy ) {
//
// hitCell = Ballistica.cast( pos, enemy.pos, true, false );
//
// for (int i=1; i < Ballistica.distance; i++) {
// if (Ballistica.trace[i] == enemy.pos) {
// return true;
// }
// }
// return false;
// }
//
// @Override
// public int attackSkill( Char target ) {
// return 30;
// }
//
// @Override
// protected float attackDelay() {
// return 1.6f;
// }
//
// @Override
// protected boolean doAttack( Char enemy ) {
//
// spend( attackDelay() );
//
// boolean rayVisible = false;
//
// for (int i=0; i < Ballistica.distance; i++) {
// if (Dungeon.visible[Ballistica.trace[i]]) {
// rayVisible = true;
// }
// }
//
// if (rayVisible) {
// sprite.attack( hitCell );
// return false;
// } else {
// attack( enemy );
// return true;
// }
// }
//
// @Override
// public boolean attack( Char enemy ) {
//
// for (int i=1; i < Ballistica.distance; i++) {
//
// int pos = Ballistica.trace[i];
//
// Char ch = Actor.findChar( pos );
// if (ch == null) {
// continue;
// }
//
// if (hit( this, ch, true )) {
// ch.damage( Random.NormalIntRange( 14, 20 ), this );
//
// if (Dungeon.visible[pos]) {
// ch.sprite.flash();
// CellEmitter.center( pos ).burst( PurpleParticle.BURST, Random.IntRange( 1, 2 ) );
// }
//
// if (!ch.isAlive() && ch == Dungeon.hero) {
// Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ), Dungeon.depth ) );
// GLog.n( TXT_DEATHGAZE_KILLED, name );
// }
// } else {
// ch.sprite.showStatus( CharSprite.NEUTRAL, ch.defenseVerb() );
// }
// }
//
// return true;
// }
//
// @Override
// public String description() {
// return
// "One of this demon's other names is \"orb of hatred\", because when it sees an enemy, " +
// "it uses its deathgaze recklessly, often ignoring its allies and wounding them.";
// }
//
// private static final HashSet<Class<?>> RESISTANCES = new HashSet<Class<?>>();
// static {
// RESISTANCES.add( WandOfDisintegration.class );
// RESISTANCES.add( Death.class );
// RESISTANCES.add( Leech.class );
// }
//
// @Override
// public HashSet<Class<?>> resistances() {
// return RESISTANCES;
// }
//
// private static final HashSet<Class<?>> IMMUNITIES = new HashSet<Class<?>>();
// static {
// IMMUNITIES.add( Terror.class );
// }
//
// @Override
// public HashSet<Class<?>> immunities() {
// return IMMUNITIES;
// }
private static final String TXT_DEATHGAZE_KILLED = "%s's deathgaze killed you...";

{
name = "evil eye";
spriteClass = EyeSprite.class;

HP = HT = 100;
defenseSkill = 20;
viewDistance = Light.DISTANCE;

EXP = 13;
maxLvl = 25;

flying = true;

loot = new Dewdrop();
lootChance = 0.5f;
}

@Override
public int dr() {
return 10;
}

private int hitCell;

@Override
protected boolean canAttack( Char enemy ) {

hitCell = Ballistica.cast( pos, enemy.pos, true, false );

for (int i=1; i < Ballistica.distance; i++) {
if (Ballistica.trace[i] == enemy.pos) {
return true;
}
}
return false;
}

@Override
public int attackSkill( Char target ) {
return 30;
}

@Override
protected float attackDelay() {
return 1.6f;
}

@Override
protected boolean doAttack( Char enemy ) {

spend( attackDelay() );

boolean rayVisible = false;

for (int i=0; i < Ballistica.distance; i++) {
if (Dungeon.visible[Ballistica.trace[i]]) {
rayVisible = true;
}
}

if (rayVisible) {
sprite.attack( hitCell );
return false;
} else {
attack( enemy );
return true;
}
}

@Override
public boolean attack( Char enemy ) {

for (int i=1; i < Ballistica.distance; i++) {

int pos = Ballistica.trace[i];

Char ch = Actor.findChar( pos );
if (ch == null) {
continue;
}

if (hit( this, ch, true )) {
ch.damage( Random.NormalIntRange( 14, 20 ), this );

if (Dungeon.visible[pos]) {
ch.sprite.flash();
CellEmitter.center( pos ).burst( PurpleParticle.BURST, Random.IntRange( 1, 2 ) );
}

if (!ch.isAlive() && ch == Dungeon.hero) {
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ), Dungeon.depth ) );
GLog.n( TXT_DEATHGAZE_KILLED, name );
}
} else {
ch.sprite.showStatus( CharSprite.NEUTRAL, ch.defenseVerb() );
}
}

return true;
}

@Override
public String description() {
return
"One of this demon's other names is \"orb of hatred\", because when it sees an enemy, " +
"it uses its deathgaze recklessly, often ignoring its allies and wounding them.";
}

private static final HashSet<Class<?>> RESISTANCES = new HashSet<Class<?>>();
static {
RESISTANCES.add( WandOfDisintegration.class );
RESISTANCES.add( Death.class );
RESISTANCES.add( Leech.class );
}

@Override
public HashSet<Class<?>> resistances() {
return RESISTANCES;
}

private static final HashSet<Class<?>> IMMUNITIES = new HashSet<Class<?>>();
static {
IMMUNITIES.add( Terror.class );
}

@Override
public HashSet<Class<?>> immunities() {
return IMMUNITIES;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
import com.example.pedometerpixeldungeon.mainsrc.plants.Rotberry;
import com.example.pedometerpixeldungeon.mainsrc.scenes.GameScene;
import com.example.pedometerpixeldungeon.mainsrc.sprites.mobsprites.WandmakerSprite;
import com.example.pedometerpixeldungeon.mainsrc.ui.WndQuest;
import com.example.pedometerpixeldungeon.mainsrc.utils.Utils;
import com.example.pedometerpixeldungeon.mainsrc.windows.WndWandmaker;
import com.example.pedometerpixeldungeon.utils.Bundle;
import com.example.pedometerpixeldungeon.utils.Random;

Expand Down Expand Up @@ -93,7 +95,7 @@ public void interact() {
}

private void tell( String format, Object...args ) {
// GameScene.show( new WndQuest( this, Utils.format( format, args ) ) );
GameScene.show( new WndQuest( this, Utils.format( format, args ) ) );
}

@Override
Expand Down Expand Up @@ -269,7 +271,7 @@ public void interact( Wandmaker wandmaker ) {

Item item = checkItem();
if (item != null) {
// GameScene.show( new WndWandmaker( wandmaker, item ) );
GameScene.show( new WndWandmaker( wandmaker, item ) );
} else {
wandmaker.tell( txtQuest2, Dungeon.hero.className() );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
import com.example.pedometerpixeldungeon.mainsrc.Dungeon;
import com.example.pedometerpixeldungeon.mainsrc.actors.Actor;
import com.example.pedometerpixeldungeon.mainsrc.actors.hero.Hero;
import com.example.pedometerpixeldungeon.mainsrc.actors.mobs.npcs.Bee;
import com.example.pedometerpixeldungeon.mainsrc.effects.Pushing;
import com.example.pedometerpixeldungeon.mainsrc.effects.Splash;
import com.example.pedometerpixeldungeon.mainsrc.levels.Level;
import com.example.pedometerpixeldungeon.mainsrc.scenes.GameScene;
import com.example.pedometerpixeldungeon.mainsrc.sprites.ItemSpriteSheet;
import com.example.pedometerpixeldungeon.noosa.audio.Sample;
import com.example.pedometerpixeldungeon.noosa.tweeners.AlphaTweener;
import com.example.pedometerpixeldungeon.utils.Random;

import java.util.ArrayList;
Expand Down Expand Up @@ -94,16 +98,16 @@ private void shatter( int pos ) {
}

if (newPos != -1) {
// Bee bee = new Bee();
// bee.spawn( Dungeon.depth );
// bee.HP = bee.HT;
// bee.pos = newPos;
//
// GameScene.add( bee );
// Actor.addDelayed( new Pushing( bee, pos, newPos ), -1 );
//
// bee.sprite.alpha( 0 );
// bee.sprite.parent.add( new AlphaTweener( bee.sprite, 1, 0.15f ) );
Bee bee = new Bee();
bee.spawn( Dungeon.depth );
bee.HP = bee.HT;
bee.pos = newPos;

GameScene.add( bee );
Actor.addDelayed( new Pushing( bee, pos, newPos ), -1 );

bee.sprite.alpha( 0 );
bee.sprite.parent.add( new AlphaTweener( bee.sprite, 1, 0.15f ) );

Sample.INSTANCE.play( Assets.SND_BEE );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
import com.example.pedometerpixeldungeon.mainsrc.actors.hero.Hero;
import com.example.pedometerpixeldungeon.mainsrc.items.EquipableItem;
import com.example.pedometerpixeldungeon.mainsrc.items.Item;
import com.example.pedometerpixeldungeon.mainsrc.items.armors.glyphs.Affection;
import com.example.pedometerpixeldungeon.mainsrc.items.armors.glyphs.AntiEntropy;
import com.example.pedometerpixeldungeon.mainsrc.items.armors.glyphs.AutoRepair;
import com.example.pedometerpixeldungeon.mainsrc.items.armors.glyphs.Bounce;
import com.example.pedometerpixeldungeon.mainsrc.items.armors.glyphs.Displacement;
import com.example.pedometerpixeldungeon.mainsrc.items.armors.glyphs.Entanglement;
import com.example.pedometerpixeldungeon.mainsrc.items.armors.glyphs.Metabolism;
import com.example.pedometerpixeldungeon.mainsrc.items.armors.glyphs.Multiplicity;
import com.example.pedometerpixeldungeon.mainsrc.items.armors.glyphs.Potential;
import com.example.pedometerpixeldungeon.mainsrc.items.armors.glyphs.Stench;
import com.example.pedometerpixeldungeon.mainsrc.items.armors.glyphs.Viscosity;
import com.example.pedometerpixeldungeon.mainsrc.sprites.HeroSprite;
import com.example.pedometerpixeldungeon.mainsrc.sprites.ItemSprite;
import com.example.pedometerpixeldungeon.mainsrc.utils.GLog;
Expand Down Expand Up @@ -311,9 +322,9 @@ public ItemSprite.Glowing glowing() {
public static abstract class Glyph implements Bundlable {

private static final Class<?>[] glyphs = new Class<?>[]{
// Bounce.class, Affection.class, AntiEntropy.class, Multiplicity.class,
// Potential.class, Metabolism.class, Stench.class, Viscosity.class,
// Displacement.class, Entanglement.class, AutoRepair.class
Bounce.class, Affection.class, AntiEntropy.class, Multiplicity.class,
Potential.class, Metabolism.class, Stench.class, Viscosity.class,
Displacement.class, Entanglement.class, AutoRepair.class
};

private static final float[] chances= new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
Expand All @@ -339,7 +350,7 @@ public ItemSprite.Glowing glowing() {
public boolean checkOwner( Char owner ) {
if (!owner.isAlive() && owner instanceof Hero) {

// ((Hero)owner).killerGlyph = this;
((Hero)owner).killerGlyph = this;
// Badges.validateDeathFromGlyph();
return true;

Expand Down
Loading

0 comments on commit e97d1a8

Please sign in to comment.