home *** CD-ROM | disk | FTP | other *** search
/ Level 2000 August / Level_2000-08_cd1.bin / Demos / Vampire / Vampire_Demo.exe / Codex.nob / DisciplineDrawingOutBeast.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-22  |  2.0 KB  |  47 lines

  1. public class DisciplineDrawingOutBeast extends Discipline {
  2.    private static final String DISCIPLINE_NAME = "DrawingOutBeast";
  3.  
  4.    public boolean cancast(int level, int casterGuid, int targetGuid, float x, float y, float z, boolean bIsPos) {
  5.       if (!((Discipline)this).CheckCastParameters(level, casterGuid, "DrawingOutBeast")) {
  6.          return false;
  7.       } else if (!((Discipline)this).CheckCastTarget(targetGuid, "DrawingOutBeast")) {
  8.          return false;
  9.       } else if (super.targetThing.GetActorType() != 2 && super.targetThing.GetActorType() != 3) {
  10.          return true;
  11.       } else {
  12.          ((Discipline)this).DisplayNoCast("RPG_DISC_NODRAWINGOUTTHEBEAST");
  13.          return false;
  14.       }
  15.    }
  16.  
  17.    public int cast(int level, int casterGuid, int targetGuid) {
  18.       if (!((Discipline)this).CheckCastParameters(level, casterGuid, "DrawingOutBeast")) {
  19.          return 0;
  20.       } else if (!((Discipline)this).CheckCastTarget(targetGuid, "DrawingOutBeast")) {
  21.          return 0;
  22.       } else if (((Discipline)this).Fizzled(level)) {
  23.          ((Discipline)this).DisplayFizzle("DrawingOutBeast", level);
  24.          super.casterThing.AddActorEffectByLevel("ef_disc_drawingoutbeast", 2000, level, casterGuid, 4);
  25.          return 0;
  26.       } else {
  27.          try {
  28.             ((Discipline)this).DisplayCast("DrawingOutBeast", level);
  29.             if (super.targetThing.GetActorType() != 0 && super.targetThing.GetActorType() != 1) {
  30.                ((Discipline)this).DisplayResist("DrawingOutBeast", level);
  31.             } else {
  32.                super.casterThing.AddActorEffectByLevel("ef_disc_quellbeast", 2000, level, casterGuid, 4);
  33.                super.targetThing.AddActorEffectByLevel("ef_disc_drawingoutbeast", 2000, level, casterGuid, 4);
  34.             }
  35.  
  36.             return 1;
  37.          } catch (Exception var6) {
  38.             CodexConsole.PrintException(((Throwable)var6).getMessage() + " in " + "DrawingOutBeast" + " [cast]");
  39.             return 0;
  40.          } catch (Error var7) {
  41.             CodexConsole.PrintError(((Throwable)var7).getMessage() + " in " + "DrawingOutBeast" + " [cast]");
  42.             return 0;
  43.          }
  44.       }
  45.    }
  46. }
  47.