Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBigEye committed Jun 7, 2020
1 parent 7ff96ef commit cefa7d1
Show file tree
Hide file tree
Showing 35 changed files with 723 additions and 5 deletions.
Binary file added build/Discs/Disc 1.wav
Binary file not shown.
Binary file added build/Discs/Disc 2.wav
Binary file not shown.
Binary file added build/Discs/Disc 3.wav
Binary file not shown.
Binary file added build/Discs/Disc 4.wav
Binary file not shown.
Binary file added build/Discs/Disc 5.wav
Binary file not shown.
Binary file added build/Discs/Disc 6.wav
Binary file not shown.
Binary file added build/Discs/Disc 7.wav
Binary file not shown.
Binary file added build/Discs/Disc 8.wav
Binary file not shown.
Binary file added build/Icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/monsterhurt.wav
Binary file not shown.
Binary file added build/pickup.wav
Binary file not shown.
Binary file added build/playerhurt.wav
Binary file not shown.
Binary file added build/test.wav
Binary file not shown.
8 changes: 8 additions & 0 deletions src/minicraft/entity/AirWizard.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import minicraft.gfx.Font;
import minicraft.gfx.MobSprite;
import minicraft.gfx.Screen;
import minicraft.item.Items;
import minicraft.screen.OptionsMenu;
import minicraft.Sound;

Expand Down Expand Up @@ -179,6 +180,13 @@ protected void die() {
if (players.length > 0) { // if the player is still here
for(Entity p: players)
((Player)p).score += (secondform ? 500000 : 100000); // give the player 100K or 500K points.

int min = 0, max = 0;
if (OptionsMenu.diff == OptionsMenu.easy) {min = 0; max = 0;}
if (OptionsMenu.diff == OptionsMenu.norm) {min = 1; max = 1;}
if (OptionsMenu.diff == OptionsMenu.hard) {min = 1; max = 1;}

dropItem(min, max, Items.get("Eye"));
}

Sound.bossdeath.play(); // play boss-death sound.
Expand Down
1 change: 1 addition & 0 deletions src/minicraft/entity/Demon.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public Demon(int lvl) {
*/
}


public void tick() {
super.tick();
}
Expand Down
9 changes: 9 additions & 0 deletions src/minicraft/entity/DungeonChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ private void populateInv() {
inv.tryAdd(7, Items.get("lava potion"));
inv.tryAdd(5, Items.get("haste potion"), 3);

inv.tryAdd(4, Items.get("Disc 1"), 1);
inv.tryAdd(4, Items.get("Disc 2"), 1);
inv.tryAdd(3, Items.get("Disc 3"), 1);
inv.tryAdd(3, Items.get("Disc 4"), 1);
inv.tryAdd(2, Items.get("Disc 5"), 1);
inv.tryAdd(2, Items.get("Disc 6"), 1);
inv.tryAdd(1, Items.get("Disc 7"), 1);
inv.tryAdd(1, Items.get("Disc 8"), 1);

inv.tryAdd(6, Items.get("Gold Bow"));
inv.tryAdd(7, Items.get("Gem Bow"));
inv.tryAdd(4, Items.get("Gold Sword"));
Expand Down
108 changes: 108 additions & 0 deletions src/minicraft/entity/Eye.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package minicraft.entity;

import minicraft.gfx.Color;
import minicraft.gfx.MobSprite;
import minicraft.gfx.Screen;
import minicraft.item.Items;
import minicraft.screen.OptionsMenu;

public class Eye extends EnemyMob {
private static final MobSprite[][] sprites;
private static final MobSprite[] walking, standing;
static {
MobSprite[] list = MobSprite.compileSpriteList(4, 20, 2, 2, 0, 3);
walking = new MobSprite[] {list[1], list[2]};
standing = new MobSprite[] {list[0], list[0]};
sprites = new MobSprite[1][2];
sprites[0] = standing;
}
private static int[] lvlcols = {
Color.get(-1, 100, 321, 550),
Color.get(-1, 100, 200, 500),

};


private int fuseTime = 0;
private boolean fuseLit = false;

public Eye(int lvl) {
super(lvl, sprites, lvlcols, 10, 100);
}

public boolean move(int xa, int ya) {
boolean result = super.move(xa, ya);
dir = 0;
if (xa == 0 && ya == 0) walkDist = 0;
return result;
}

public void tick() {
super.tick();
}
public void render(Screen screen) {
if (fuseLit && fuseTime % 6 == 0) {
super.lvlcols[lvl-1] = Color.get(-1, 252);
}
else
super.lvlcols[lvl-1] = Eye.lvlcols[lvl-1];

this.sprites[0] = walkDist == 0 ? standing : walking;

super.render(screen);
}
/*
public void render(Screen screen) {
col0 = Color.get(-1, 10, 152, 40);
col1 = Color.get(-1, 20, 252, 50);
col2 = Color.get(-1, 10, 152, 40);
col3 = Color.get(-1, 0, 30, 20);
col4 = Color.get(-1, 10, 152, 40);
if (isLight()) {
col0 = col1 = col2 = col3 = col4 = Color.get(-1, 20, 252, 50);
}
if (lvl == 2) col = Color.get(-1, 100, 522, 050);
else if (lvl == 3) col = Color.get(-1, 111, 444, 050),
;
else if (lvl == 4) col = Color.get(-1, 000, 111, 020);
else if (level.dirtColor == 322) {
if (Game.time == 0) col = col0;
if (Game.time == 1) col = col1;
if (Game.time == 2) col = col2;
if (Game.time == 3) col = col3;
} else col = col4;
super.render(screen);
}
*/

public boolean canSwim() {
return true;
}

protected void die() {
if (OptionsMenu.diff == OptionsMenu.easy) dropItem(2, 2, Items.get("Eye Orb"));
if (OptionsMenu.diff == OptionsMenu.norm) dropItem(1, 1, Items.get("Eye Orb"));
if (OptionsMenu.diff == OptionsMenu.hard) dropItem(0, 1, Items.get("Eye Orb"));

if(random.nextInt(60) == 2) {
level.dropItem(x, y, Items.get("iron"));
}

if(random.nextInt(40) == 19) {
int rand = random.nextInt(3);
if(rand == 0) {
level.dropItem(x, y, Items.get("Eye Orb"));
} else if(rand == 1) {
level.dropItem(x, y, Items.get("Eye Orb"));
} else if(rand == 2) {
level.dropItem(x, y, Items.get("Eye Orb"));
}
}

super.die();
}
}
17 changes: 17 additions & 0 deletions src/minicraft/entity/FriendlyMob.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
public class FriendlyMob extends MobAi {

protected int color;
public int lvl;

public FriendlyMob(MobSprite[][] sprites, int color) {this(sprites, color, 3);}
public FriendlyMob(MobSprite[][] sprites, int color, int healthFactor) {
Expand All @@ -26,6 +27,8 @@ public FriendlyMob(MobSprite[][] sprites, int color, int healthFactor) {
col = color;
}



public void tick() {
super.tick();

Expand Down Expand Up @@ -53,6 +56,20 @@ public void render(Screen screen) {
super.render(screen);
}

protected void touchedBy(Entity entity) { // if the entity touches the mob
super.touchedBy(entity);
// hurts the player, damage is based on lvl.
if(entity instanceof EnemyMob) {
if (OptionsMenu.diff != OptionsMenu.easy)
entity.hurt(this, lvl, dir);
else entity.hurt(this, lvl * 2, dir);
}
}

public boolean canAttack() {
return true;
}

protected void die() {
super.die(15);
}
Expand Down
7 changes: 7 additions & 0 deletions src/minicraft/entity/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -791,4 +791,11 @@ public void hurt(int damage, int attackDir2) {
// TODO Auto-generated method stub

}

public int getLevel() {
level.game.getLocation();
level.getTile(homeSetX, homeSetY);
return acs;

}
}
50 changes: 48 additions & 2 deletions src/minicraft/item/AmuletItem.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
package minicraft.item;

public class AmuletItem {

}
import java.util.ArrayList;

import minicraft.entity.Player;
import minicraft.gfx.Color;
import minicraft.gfx.Sprite;
import minicraft.level.Level;
import minicraft.level.tile.Tile;
import minicraft.screen.BookMenu;



public class AmuletItem extends Item {

protected static ArrayList<Item> getAllInstances() {
ArrayList<Item> items = new ArrayList<Item>();
items.add(new AmuletItem("Eye", Color.get(-1, 100, 321, 550), BookMenu.eyeBook));

return items;
}

protected String book; // TODO this is not saved yet; it could be, for editable books.

private AmuletItem(String title, int color, String book) {
super(title, new Sprite(28, 4, color));
this.book = book;
}



public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, int attackDir) {
player.game.setMenu(new BookMenu(book));
return true;
}


public AmuletItem clone() {
return new AmuletItem(name, sprite.color, book);
}

public boolean canAttack() {
return true;

}

public boolean canLight() {
return true;
}
}
4 changes: 4 additions & 0 deletions src/minicraft/item/BookItem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package minicraft.item;

import java.util.ArrayList;

import minicraft.entity.EnemyMob;
import minicraft.entity.Player;
import minicraft.gfx.Color;
import minicraft.gfx.Sprite;
Expand All @@ -14,6 +16,7 @@ protected static ArrayList<Item> getAllInstances() {
ArrayList<Item> items = new ArrayList<Item>();
items.add(new BookItem("Book", Color.get(-1, 200, 531, 430), BookMenu.defaultBook));
items.add(new BookItem("Antidious", Color.get(-1, 100, 300, 500), BookMenu.antVenomBook));

return items;
}

Expand All @@ -32,4 +35,5 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player,
public BookItem clone() {
return new BookItem(name, sprite.color, book);
}

}
1 change: 1 addition & 0 deletions src/minicraft/item/FurnitureItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ protected static ArrayList<Item> getAllInstances() {
items.add(new FurnitureItem(new Spawner(new Slime(1))));
items.add(new FurnitureItem(new Spawner(new Zombie(1))));
items.add(new FurnitureItem(new Spawner(new Demon(2))));
items.add(new FurnitureItem(new Spawner(new Eye(1))));
items.add(new FurnitureItem(new Spawner(new Creeper(1))));
items.add(new FurnitureItem(new Spawner(new Skeleton(1))));
items.add(new FurnitureItem(new Spawner(new Snake(1))));
Expand Down
21 changes: 21 additions & 0 deletions src/minicraft/item/Items.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;


import minicraft.entity.Inventory;
import minicraft.item.discs.DiscEight;
import minicraft.item.discs.DiscFive;
import minicraft.item.discs.DiscFour;
import minicraft.item.discs.DiscOne;
import minicraft.item.discs.DiscSeven;
import minicraft.item.discs.DiscSix;
import minicraft.item.discs.DiscThree;
import minicraft.item.discs.DiscTwo;
// import java.io.File;
// import java.net.URL;
// import java.net.URI;
Expand Down Expand Up @@ -75,6 +85,7 @@ public boolean accept(File file, String name) {
ex.printStackTrace();
}*/
addAll(PowerGloveItem.getAllInstances());
addAll(AmuletItem.getAllInstances());
addAll(FurnitureItem.getAllInstances());
addAll(TorchItem.getAllInstances());
addAll(BucketItem.getAllInstances());
Expand All @@ -85,6 +96,16 @@ public boolean accept(File file, String name) {
addAll(StackableItem.getAllInstances());
addAll(ClothingItem.getAllInstances());
addAll(ArmorItem.getAllInstances());

addAll(DiscOne.getAllInstances());
addAll(DiscTwo.getAllInstances());
addAll(DiscThree.getAllInstances());
addAll(DiscFour.getAllInstances());
addAll(DiscFive.getAllInstances());
addAll(DiscSix.getAllInstances());
addAll(DiscSeven.getAllInstances());
addAll(DiscEight.getAllInstances());

addAll(PotionItem.getAllInstances());
}

Expand Down
Loading

0 comments on commit cefa7d1

Please sign in to comment.