1package com.runehive.util.parser.impl;
3import com.google.gson.JsonObject;
4import com.runehive.game.Animation;
5import com.runehive.game.Graphic;
6import com.runehive.game.Projectile;
7import com.runehive.game.world.entity.combat.CombatImpact;
8import com.runehive.game.world.entity.combat.magic.MagicImpact;
9import com.runehive.game.world.entity.combat.projectile.CombatProjectile;
10import com.runehive.game.world.entity.combat.ranged.RangedEffects;
11import com.runehive.util.parser.GsonParser;
16 super(
"def/combat/projectile_definitions",
false);
20 public void parse(JsonObject reader){
21 String name = reader.get(
"name").getAsString();
24 if (reader.has(
"hit-delay")) {
25 hitDelay = reader.get(
"hit-delay").getAsInt();
28 int hitsplatDelay = -1;
29 if (reader.has(
"hitsplat-delay")) {
30 hitsplatDelay = reader.get(
"hitsplat-delay").getAsInt();
34 if (reader.has(
"max-hit")) {
35 maxHit = reader.get(
"max-hit").getAsInt();
39 if (reader.has(
"magic-effect")) {
40 String effectName = reader.get(
"magic-effect").getAsString();
42 }
else if (reader.has(
"ranged-effect")) {
43 String effectName = reader.get(
"ranged-effect").getAsString();
48 if (reader.has(
"animation")) {
53 if (reader.has(
"start")) {
58 if (reader.has(
"end")) {
63 if (reader.has(
"projectile")) {
Class that models a single animation used by an entity.
Represents a single graphic that can be used by entities.
static final Map< String, CombatProjectile > definitions
GsonParser(String path)
Creates a new GsonParser.
transient Gson builder
The Gson object.
void parse(JsonObject reader)
The method allows a user to modify the data as its being parsed.
Represents a combat impact hit effect.