forked from Maescool/Catacomb-Snatch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed .gitignore and added melee animations
- Loading branch information
Showing
19 changed files
with
1,107 additions
and
1,096 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ build | |
*.sw? | ||
lib/.tmp/ | ||
doc/ | ||
*.db |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
package com.mojang.mojam.entity; | ||
|
||
import com.mojang.mojam.entity.mob.*; | ||
import com.mojang.mojam.screen.*; | ||
|
||
public class BulletBuckshot extends Bullet { | ||
|
||
public BulletBuckshot(Mob owner, double xa, double ya, float damage) { | ||
super(owner, ya, ya, damage); | ||
this.owner = owner; | ||
pos.set(owner.pos.x + xa * 4, owner.pos.y + ya * 4); | ||
this.xa = xa * 18; | ||
this.ya = ya * 18; | ||
this.setSize(2, 2); | ||
physicsSlide = false; | ||
duration = 20; | ||
this.damage = damage; | ||
} | ||
|
||
@Override | ||
public void tick() { | ||
if (--duration <= 0) { | ||
remove(); | ||
return; | ||
} | ||
if (!move(xa, ya)) { | ||
hit = true; | ||
} | ||
if (hit && !removed) { | ||
remove(); | ||
} | ||
if(damage > 0.5) | ||
damage -= 0.5; | ||
} | ||
|
||
@Override | ||
public void render(Screen screen) { | ||
screen.blit(Art.buckShot, pos.x - 8, pos.y - 8); | ||
} | ||
} | ||
package com.mojang.mojam.entity; | ||
|
||
import com.mojang.mojam.entity.mob.*; | ||
import com.mojang.mojam.screen.*; | ||
|
||
public class BulletBuckshot extends Bullet { | ||
|
||
public BulletBuckshot(Mob owner, double xa, double ya, float damage) { | ||
super(owner, ya, ya, damage); | ||
this.owner = owner; | ||
pos.set(owner.pos.x + xa * 4, owner.pos.y + ya * 4); | ||
this.xa = xa * 18; | ||
this.ya = ya * 18; | ||
this.setSize(2, 2); | ||
physicsSlide = false; | ||
duration = 20; | ||
this.damage = damage; | ||
} | ||
|
||
@Override | ||
public void tick() { | ||
if (--duration <= 0) { | ||
remove(); | ||
return; | ||
} | ||
if (!move(xa, ya)) { | ||
hit = true; | ||
} | ||
if (hit && !removed) { | ||
remove(); | ||
} | ||
if(damage > 0.5) | ||
damage -= 0.5; | ||
} | ||
|
||
@Override | ||
public void render(Screen screen) { | ||
screen.blit(Art.buckShot, pos.x - 8, pos.y - 8); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
package com.mojang.mojam.entity; | ||
|
||
import com.mojang.mojam.MojamComponent; | ||
import com.mojang.mojam.entity.building.Building; | ||
import com.mojang.mojam.entity.mob.Mob; | ||
import com.mojang.mojam.screen.Art; | ||
import com.mojang.mojam.screen.Screen; | ||
|
||
public class BulletPoison extends Bullet { | ||
|
||
public BulletPoison(Mob e, double xa, double ya, float damage) { | ||
super(e, xa, ya, damage); | ||
duration=80; | ||
this.xa = xa * 3; | ||
this.ya = ya * 3; | ||
|
||
} | ||
|
||
@Override | ||
public void render(Screen screen) { | ||
screen.blit(Art.bulletpoison[facing][0], pos.x - 8, pos.y - 10); | ||
} | ||
|
||
@Override | ||
public void collide(Entity entity, double xa, double ya) { | ||
if (entity instanceof Mob) { | ||
Mob mobEnt = (Mob) entity; | ||
if (mobEnt.isNotFriendOf(owner) && !(entity instanceof Building)) { | ||
mobEnt.hurt(this,damage); | ||
hit = true; | ||
} | ||
} | ||
if (hit) { | ||
MojamComponent.soundPlayer.playSound("/sound/Shot 2.wav", (float) pos.x, (float) pos.y); | ||
} | ||
} | ||
|
||
package com.mojang.mojam.entity; | ||
|
||
import com.mojang.mojam.MojamComponent; | ||
import com.mojang.mojam.entity.building.Building; | ||
import com.mojang.mojam.entity.mob.Mob; | ||
import com.mojang.mojam.screen.Art; | ||
import com.mojang.mojam.screen.Screen; | ||
|
||
public class BulletPoison extends Bullet { | ||
|
||
public BulletPoison(Mob e, double xa, double ya, float damage) { | ||
super(e, xa, ya, damage); | ||
duration=80; | ||
this.xa = xa * 3; | ||
this.ya = ya * 3; | ||
|
||
} | ||
|
||
@Override | ||
public void render(Screen screen) { | ||
screen.blit(Art.bulletpoison[facing][0], pos.x - 8, pos.y - 10); | ||
} | ||
|
||
@Override | ||
public void collide(Entity entity, double xa, double ya) { | ||
if (entity instanceof Mob) { | ||
Mob mobEnt = (Mob) entity; | ||
if (mobEnt.isNotFriendOf(owner) && !(entity instanceof Building)) { | ||
mobEnt.hurt(this,damage); | ||
hit = true; | ||
} | ||
} | ||
if (hit) { | ||
MojamComponent.soundPlayer.playSound("/sound/Shot 2.wav", (float) pos.x, (float) pos.y); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,68 @@ | ||
package com.mojang.mojam.entity; | ||
|
||
import com.mojang.mojam.entity.mob.*; | ||
import com.mojang.mojam.network.TurnSynchronizer; | ||
import com.mojang.mojam.screen.*; | ||
|
||
public class BulletRay extends Bullet { | ||
private int maxBounceNumber; | ||
private double previuosPositionX, previuosPositionY; | ||
private int frame; | ||
|
||
public BulletRay(Mob e, double xa, double ya, float damage) { | ||
super(e, ya, ya, damage); | ||
this.owner = e; | ||
pos.set(e.pos.x + xa * 4, e.pos.y + ya * 4); | ||
this.xa = xa * 5; | ||
this.ya = ya * 5; | ||
this.setSize(4, 4); | ||
physicsSlide = false; | ||
duration = 50; | ||
maxBounceNumber = 5; | ||
frame = 0; | ||
this.damage = damage; | ||
} | ||
|
||
@Override | ||
public void tick() { | ||
previuosPositionX = pos.x; | ||
previuosPositionY = pos.y; | ||
if (--duration <= 0) { | ||
remove(); | ||
return; | ||
} | ||
if (!move(xa, ya)) { | ||
if(maxBounceNumber > 0) { | ||
//Bounce | ||
if(previuosPositionX != pos.x) { | ||
ya = -ya; | ||
} | ||
if(previuosPositionY != pos.y) { | ||
xa = -xa; | ||
} | ||
if(previuosPositionY == pos.y && previuosPositionX == pos.x) { | ||
xa = -xa; | ||
ya = -ya; | ||
} | ||
|
||
//Increase the speed, duration and damage with each bounce | ||
xa *= 1.2; | ||
ya *= 1.2; | ||
duration += 5; | ||
damage *= 1.5; | ||
|
||
maxBounceNumber--; | ||
} | ||
else hit = true; | ||
} | ||
if (hit && !removed) { | ||
remove(); | ||
} | ||
frame = TurnSynchronizer.synchedRandom.nextInt(8); | ||
} | ||
|
||
@Override | ||
public void render(Screen screen) { | ||
screen.blit(Art.plasmaBall[frame][0], (int)pos.x - 8, (int)pos.y - 10); | ||
} | ||
} | ||
package com.mojang.mojam.entity; | ||
|
||
import com.mojang.mojam.entity.mob.*; | ||
import com.mojang.mojam.network.TurnSynchronizer; | ||
import com.mojang.mojam.screen.*; | ||
|
||
public class BulletRay extends Bullet { | ||
private int maxBounceNumber; | ||
private double previuosPositionX, previuosPositionY; | ||
private int frame; | ||
|
||
public BulletRay(Mob e, double xa, double ya, float damage) { | ||
super(e, ya, ya, damage); | ||
this.owner = e; | ||
pos.set(e.pos.x + xa * 4, e.pos.y + ya * 4); | ||
this.xa = xa * 5; | ||
this.ya = ya * 5; | ||
this.setSize(4, 4); | ||
physicsSlide = false; | ||
duration = 50; | ||
maxBounceNumber = 5; | ||
frame = 0; | ||
this.damage = damage; | ||
} | ||
|
||
@Override | ||
public void tick() { | ||
previuosPositionX = pos.x; | ||
previuosPositionY = pos.y; | ||
if (--duration <= 0) { | ||
remove(); | ||
return; | ||
} | ||
if (!move(xa, ya)) { | ||
if(maxBounceNumber > 0) { | ||
//Bounce | ||
if(previuosPositionX != pos.x) { | ||
ya = -ya; | ||
} | ||
if(previuosPositionY != pos.y) { | ||
xa = -xa; | ||
} | ||
if(previuosPositionY == pos.y && previuosPositionX == pos.x) { | ||
xa = -xa; | ||
ya = -ya; | ||
} | ||
|
||
//Increase the speed, duration and damage with each bounce | ||
xa *= 1.2; | ||
ya *= 1.2; | ||
duration += 5; | ||
damage *= 1.5; | ||
|
||
maxBounceNumber--; | ||
} | ||
else hit = true; | ||
} | ||
if (hit && !removed) { | ||
remove(); | ||
} | ||
frame = TurnSynchronizer.synchedRandom.nextInt(8); | ||
} | ||
|
||
@Override | ||
public void render(Screen screen) { | ||
screen.blit(Art.plasmaBall[frame][0], (int)pos.x - 8, (int)pos.y - 10); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
package com.mojang.mojam.entity.building; | ||
|
||
import com.mojang.mojam.MojamComponent; | ||
import com.mojang.mojam.entity.Player; | ||
import com.mojang.mojam.entity.weapon.Raygun; | ||
import com.mojang.mojam.gui.Notifications; | ||
import com.mojang.mojam.screen.Art; | ||
|
||
public class ShopItemRaygun extends ShopItem { | ||
|
||
public ShopItemRaygun(double x, double y, int team) { | ||
super("raygun",x, y, team, 800, 5); | ||
setSprite(Art.weaponList[2][0]); | ||
teamTooltipYOffset = (team == 2) ? 122 : -32; | ||
} | ||
|
||
public void useAction(Player player) { | ||
if(!player.weaponInventory.add(new Raygun(player))) { | ||
if(this.team == MojamComponent.localTeam) { | ||
Notifications.getInstance().add(MojamComponent.texts.getStatic("gameplay.weaponAlready")); | ||
} | ||
} | ||
} | ||
package com.mojang.mojam.entity.building; | ||
|
||
import com.mojang.mojam.MojamComponent; | ||
import com.mojang.mojam.entity.Player; | ||
import com.mojang.mojam.entity.weapon.Raygun; | ||
import com.mojang.mojam.gui.Notifications; | ||
import com.mojang.mojam.screen.Art; | ||
|
||
public class ShopItemRaygun extends ShopItem { | ||
|
||
public ShopItemRaygun(double x, double y, int team) { | ||
super("raygun",x, y, team, 800, 5); | ||
setSprite(Art.weaponList[2][0]); | ||
teamTooltipYOffset = (team == 2) ? 122 : -32; | ||
} | ||
|
||
public void useAction(Player player) { | ||
if(!player.weaponInventory.add(new Raygun(player))) { | ||
if(this.team == MojamComponent.localTeam) { | ||
Notifications.getInstance().add(MojamComponent.texts.getStatic("gameplay.weaponAlready")); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.