Skip to content

Loading…

[feature] added pharao mob #775

Merged
merged 3 commits into from

5 participants

@Elosanda

high health and high damage

thx Caberas @ http://forum.catacombsnatch.net/thread-170.html

@master-lincoln
Collaborator

+1 awesome...

@Elosanda

when you open the treasure chamber of mojam level the next time, you will encounter a deadly surprise, muharharhar

@master-lincoln
Collaborator

BTW: If this gets merged someone should add it to the reference for map colors I added to the wiki

@Elosanda

i will do it

@runonce86

Awesome indeed!

@xDreamCoding

+1 nice work both artwork and coding

@Maescool Maescool merged commit 678b53f into Maescool:develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
View
BIN res/art/mob/enemy_pharao_anim_48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/levels/DevMap.bmp
Binary file not shown.
View
BIN res/levels/level1.bmp
Binary file not shown.
View
BIN res/sound/pharao_dies.wav
Binary file not shown.
View
75 src/com/mojang/mojam/entity/mob/Pharao.java
@@ -0,0 +1,75 @@
+package com.mojang.mojam.entity.mob;
+
+import com.mojang.mojam.entity.Player;
+import com.mojang.mojam.level.tile.Tile;
+import com.mojang.mojam.network.TurnSynchronizer;
+import com.mojang.mojam.screen.Art;
+import com.mojang.mojam.screen.Bitmap;
+
+public class Pharao extends HostileMob {
+
+ private int tick = 0;
+ public static double ATTACK_RADIUS = 5 * Tile.WIDTH;
+
+ public static final int COLOR = 0xffffdd00;
+
+ public Pharao(double x, double y) {
+ super(x, y, Team.Neutral);
+ setPos(x, y);
+ setStartHealth(40);
+ dir = TurnSynchronizer.synchedRandom.nextDouble() * Math.PI * 2;
+ yOffs = 10;
+ facing = TurnSynchronizer.synchedRandom.nextInt(4);
+ deathPoints = 30;
+ strength = 3;
+ speed = 1.0;
+ limp = 3;
+ REGEN_INTERVAL = 15;
+ }
+
+ public void tick() {
+ super.tick();
+ if (freezeTime > 0) {
+ return;
+ }
+ tick++;
+ if (tick >= 20) {
+ tick = 0;
+ facing = faceEntity(pos.x, pos.y, ATTACK_RADIUS, Player.class, facing);
+ }
+ walk();
+ }
+
+ public void die() {
+ super.die();
+ }
+
+ public Bitmap getSprite() {
+ return Art.pharao[((stepTime / 6) & 3)][(facing + 1) & 3];
+ }
+
+ @Override
+ public String getDeathSound() {
+ return "/sound/pharao_dies.wav";
+ }
+
+ @Override
+ public int getColor() {
+ return COLOR;
+ }
+
+ @Override
+ public int getMiniMapColor() {
+ return COLOR;
+ }
+
+ @Override
+ public String getName() {
+ return "PHARAO";
+ }
+
+ @Override
+ public Bitmap getBitMapForEditor() {
+ return Art.pharao[0][0];
+ }
+}
View
5 src/com/mojang/mojam/gui/LevelEditorMenu.java
@@ -23,6 +23,7 @@
import com.mojang.mojam.entity.building.TurretTeamTwo;
import com.mojang.mojam.entity.mob.Bat;
import com.mojang.mojam.entity.mob.Mummy;
+import com.mojang.mojam.entity.mob.Pharao;
import com.mojang.mojam.entity.mob.Scarab;
import com.mojang.mojam.entity.mob.Snake;
import com.mojang.mojam.entity.mob.SpikeTrap;
@@ -84,8 +85,8 @@
new Bat(0,0),
new Snake(0,0),
new Mummy(0,0),
- new Scarab(0,0)
-
+ new Scarab(0,0),
+ new Pharao(0,0)
};
private final int buttonsPerPage = 12;
View
6 src/com/mojang/mojam/level/LevelUtils.java
@@ -13,6 +13,7 @@
import com.mojang.mojam.entity.mob.Bat;
import com.mojang.mojam.entity.mob.DropTrap;
import com.mojang.mojam.entity.mob.Mummy;
+import com.mojang.mojam.entity.mob.Pharao;
import com.mojang.mojam.entity.mob.Scarab;
import com.mojang.mojam.entity.mob.Snake;
import com.mojang.mojam.entity.mob.SpikeTrap;
@@ -92,7 +93,10 @@ public static Entity getNewEntityFromColor(int color, int x, int y) {
case Mummy.COLOR:
entity = new Mummy(x * Tile.WIDTH+Tile.WIDTH/2,y * Tile.HEIGHT+Tile.HEIGHT/2);
break;
- case Scarab.COLOR:
+ case Pharao.COLOR:
+ entity = new Pharao(x * Tile.WIDTH+Tile.WIDTH/2,y * Tile.HEIGHT+Tile.HEIGHT/2);
+ break;
+ case Scarab.COLOR:
entity = new Scarab(x * Tile.WIDTH+Tile.WIDTH/2,y * Tile.HEIGHT+Tile.HEIGHT/2);
break;
case Turret.COLOR:
View
3 src/com/mojang/mojam/screen/Art.java
@@ -137,7 +137,8 @@
// Mob
public static Bitmap[][] raildroid = cut("/art/mob/raildroid.png", 32, 32);
public static Bitmap[][] mummy = cut("/art/mob/enemy_mummy_anim_48.png", 48, 48);
- public static Bitmap[][] snake = cut("/art/mob/enemy_snake_anim_48.png", 48, 48);
+ public static Bitmap[][] pharao = cut("/art/mob/enemy_pharao_anim_48.png", 48, 48);
+ public static Bitmap[][] snake = cut("/art/mob/enemy_snake_anim_48.png", 48, 48);
public static Bitmap[][] scarab = cut("/art/mob/enemy_scarab_anim_48.png", 48, 48);
public static Bitmap[][] bat = cut("/art/mob/enemy_bat_32.png", 32, 32);
public static Bitmap batShadow = load("/art/shadows/shadow_bat.png");
Something went wrong with that request. Please try again.