Merge pull request #482 from Ziggeh/master

Some combat stuff
This commit is contained in:
Waverunner
2014-04-22 18:09:39 -04:00
4 changed files with 64 additions and 29 deletions
@@ -26,7 +26,7 @@ import java.nio.ByteOrder;
import org.apache.mina.core.buffer.IoBuffer;
import protocol.swg.ObjControllerMessage;
import services.combat.CombatService.HitType;
import resources.datatables.HitType;
public class CombatSpam extends ObjControllerObject{
+35
View File
@@ -0,0 +1,35 @@
/*******************************************************************************
* Copyright (c) 2013 <Project SWG>
*
* This File is part of NGECore2.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.datatables;
public class HitType {
public static final byte MISS = 0;
public static final byte DODGE = 1;
public static final byte PARRY = 2;
public static final byte STRIKETHROUGH = 3;
public static final byte CRITICAL = 4;
public static final byte PUNISHING = 5;
public static final byte HIT = 6;
public static final byte BLOCK = 7;
public static final byte EVASION = 8;
public static final byte GLANCE = 9;
}
+21
View File
@@ -1,3 +1,24 @@
/*******************************************************************************
* Copyright (c) 2013 <Project SWG>
*
* This File is part of NGECore2.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.datatables;
public class Posture {
+7 -28
View File
@@ -65,6 +65,7 @@ import engine.resources.objects.SWGObject;
import engine.resources.scene.Point3D;
import engine.resources.service.INetworkDispatch;
import engine.resources.service.INetworkRemoteEvent;
import resources.datatables.HitType;
public class CombatService implements INetworkDispatch {
@@ -750,6 +751,12 @@ public class CombatService implements INetworkDispatch {
float glanceChance = (float) target.getSkillModBase("display_only_glancing_blow") / 10000;
if(weapon.isRanged())
glanceChance += target.getSkillModBase("expertise_glancing_blow_ranged");
if(weapon.isMelee())
glanceChance += target.getSkillModBase("expertise_glancing_blow_melee");
r = random.nextFloat();
if(r <= glanceChance)
return HitType.GLANCE;
@@ -1359,33 +1366,5 @@ public class CombatService implements INetworkDispatch {
defenderList.stream().forEach(attacker -> defender.removeDefender(attacker));
}
}
public enum HitType{;
public static final byte MISS = 0;
public static final byte DODGE = 1;
public static final byte PARRY = 2;
public static final byte STRIKETHROUGH = 3;
public static final byte CRITICAL = 4;
public static final byte PUNISHING = 5;
public static final byte HIT = 6;
public static final byte BLOCK = 7;
public static final byte EVASION = 8;
public static final byte GLANCE = 9;
}
public enum ElementalType {;
public static final int KINETIC = 1;
public static final int ENERGY = 2;
public static final int BLAST = 4;
public static final int STUN = 8;
public static final int HEAT = 32;
public static final int COLD = 64;
public static final int ACID = 128;
public static final int ELECTRICITY = 256;
}
}