Examples of Monster


Examples of beans.serializable.Monster

        final int lifeMax = Integer.parseInt(fields.get("life"));
        final int manaMax = Integer.parseInt(fields.get("mana"));
        final int attaque = Integer.parseInt(fields.get("attaque"));
        final int defense = Integer.parseInt(fields.get("defense"));
        final Objet loot = (Objet) GeneralConstant.deSerialize(GeneralConstant.SAVE_OBJECT_PATH + fields.get("loot"));
        final Monster monster = new Monster(name, 10, imagePath, lifeMax, manaMax, attaque, defense, loot);
        GeneralConstant.serialize(GeneralConstant.SAVE_MONSTER_PATH + name, monster);
    }
View Full Code Here

Examples of catchemrpg.gameobjects.Monster

          {
            for (int i = 0; i < 5; i++)
              {
                //Get creature ID, for use with language queries for Monster metadata.
                int ID = Integer.parseInt(properties.getProperty("monsters$current$" + (i + 1) + "$id", "0"));
                CharacterData.monsterList[i] = new Monster();

                CharacterData.monsterList[i].NAME = BaseVars.lang.monsterNames.get(ID);
                CharacterData.monsterList[i].imagePath = properties.getProperty("monsters$current$" + (i + 1) + "$imgpath", "");
                CharacterData.monsterList[i].CATEGORY1 = BaseVars.lang.monsterCat1s.get(ID);
                CharacterData.monsterList[i].CATEGORY2 = BaseVars.lang.monsterCat2s.get(ID);
View Full Code Here

Examples of net.myexperiments.viciouscycle.model.Monster

    case DRAGON:
      Dragon dr = new Dragon(gos.world, this, name, number);
      break;
    case MONSTER:
      Monster mn = new Monster(gos.world, this, name, number);
      break;
    }

  }
View Full Code Here

Examples of org.bat.client.model.Monster

    Session session = HibernateUtil.getSessionFactory().openSession();
   
    MonsterHibernateDAO myDAO = new MonsterHibernateDAO();
    myDAO.setSession(session);
    Transaction tx = session.beginTransaction();
    Monster myMonster = myDAO.getMonsterByShortDesc(mobName);
    tx.commit();
    if (myMonster == null) {
      myHandler.debugInfo("New monster: "+mobName);
      tx = session.beginTransaction();
      myMonster = new Monster();
      myMonster.setShortDescription(mobName);
     
      session.save(myMonster);
      tx.commit();
      myHandler.debugInfo(".. added to the database with id: "+myMonster.getId());
    }
    tx = session.beginTransaction();
    KilledMonster myKill = new KilledMonster();
    myKill.setMonster(myMonster);
    myKill.setExpWorth(new Integer(expGained));
View Full Code Here

Examples of org.gbcpainter.game.model.Monster

      Iterator<Map.Entry<Monster, Integer>> monstersIterator = roundRobin.entrySet()
                                                                         .iterator();
      while ( monstersIterator.hasNext() ) {
        final Map.Entry<Monster, Integer> monsterWithSpeed = monstersIterator.next();
        final int remainingMonsterSpeed = monsterWithSpeed.getValue();
        final Monster mob = monsterWithSpeed.getKey();
        if ( remainingMonsterSpeed > 0 ) {
          monsterWithSpeed.setValue( remainingMonsterSpeed - 1 );


          final Point monsterPosition = mob.getPosition();

          if ( actualPlayerPosition.equals( monsterPosition ) ) {
            deadMan = true;
          }
          final PathAnimation mobAnimation;

          @Nullable
          PERPENDICULAR_DIRECTION monsterDirection;
          if this.firstStep ) {
            monsterDirection = null;
          } else {
            monsterDirection = mob.getActualDirection();
          }

          MapGridElement monsterFooting = this.monstersPosition.get( mob );
          assert monsterFooting != null;

          if ( monsterFooting instanceof Junction || monsterDirection == null ) {
            //Monster is in a junction, must change direction
            monsterDirection = mob.getNewDirection( monsterDirection, false );

          }

          if ( mob instanceof AnimatedElement ) {
            //This is an animated monster, an animations must be applied
            PathAnimation animation =  this.monstersAndAnimations.get( mob );
            if ( animation == null ) {
              //If the animations wasn't created yet, create it
              animation = new PathAnimationImpl();
              animation.startNewPart( monsterDirection );
              animation.addPoint( monsterPosition );
              this.monstersAndAnimations.put( ( (AnimatedElement) mob ), animation );
              if ( mob.modifiesColor() ) {
                utilPushAnimation( entitiesColoringTrace,
                                   monsterFooting,
                                   animation,
                                   mob.isColoring(),
                                   animation.getNewPart() );
              }
            } else if ( monsterDirection != animation.getNewPartDirection() ) {
              animation.startNewPart( monsterDirection );
              animation.addPoint( monsterPosition );
              if ( mob.modifiesColor() ) {
                utilPushAnimation( entitiesColoringTrace,
                                   monsterFooting,
                                   animation,
                                   mob.isColoring(),
                                   animation.getNewPart() );
              }
            }
            mobAnimation = animation;
          } else {
            mobAnimation = null;
          }

          switch ( monsterDirection ) {
            case LEFT:
              monsterPosition.x--;
              break;
            case RIGHT:
              monsterPosition.x++;
              break;
            case UP:
              monsterPosition.y--;
              break;
            case DOWN:
              monsterPosition.y++;
              break;
          }

          mob.setPosition( monsterPosition );
          if ( mobAnimation != null ) {
            mobAnimation.addPoint( monsterPosition );
          }


          if ( ! monsterFooting.contains( monsterPosition ) ) {
            //The monster changed grid element, the animations must be applied to this element too
            monsterFooting = findElementRelativeTo( this.levelGraph,
                                                    monsterFooting,
                                                    monsterDirection );
            this.monstersPosition.put( mob, monsterFooting );

            if ( mob.modifiesColor() && mobAnimation != null ) {
              utilPushAnimation( entitiesColoringTrace,
                                 monsterFooting,
                                 mobAnimation,
                                 mob.isColoring(),
                                 mobAnimation.getNewPart() );
            }
          }

          if ( mob.modifiesColor() ) {
            //(De)Colors this part of the grid
            final boolean isMobColoring = mob.isColoring();
            final boolean wasColoredHere =  monsterFooting.isColoredAt( monsterPosition );

            if ( wasColoredHere != isMobColoring ) {
              if ( wasColoredHere ) {
                this.addScore( - COLORING_SCORE );
              } else {
                this.addScore( COLORING_SCORE );
              }
            }

            this.utilColorGridElementAndUpdateChanges( monsterFooting, monsterPosition,
                                                  isMobColoring );

          }


          if ( actualPlayerPosition.equals( monsterPosition ) ) {
            deadMan = true;
          }

        } else {
          //Monster remaining speed is 0, remove it from the moving monsters
          stillMonsters.add( mob );
          monstersIterator.remove();
        }
      }
    }

    //Computes the end time of all the animations
    final long scheduledAnimationEndTime = millisCallTime + GameSettings.getInstance()
                                                                        .getValue( GameSettings.INTEGER_SETTINGS_TYPE.MOVE_MILLIS_TIMEOUT );

    if ( playerPath != null && player instanceof AnimatedElement ) {
      //Applies the previously computed path animations to the Player entity as an entity animations
      playerPath.startAnimation( millisCallTime, scheduledAnimationEndTime );
      ( (AnimatedElement) player )
          .applyAnimation( new PathBasedMovementAnimation( playerPath ) );
    }

    for (Map.Entry<AnimatedElement, PathAnimation> animatedEntry :  this.monstersAndAnimations
        .entrySet()) {
      //Applies the previously computed path animations to the Monster entity as an entity animations
      final PathAnimation entryAnimation = animatedEntry.getValue();
      if ( entryAnimation != null ) {
        entryAnimation.startAnimation( millisCallTime, scheduledAnimationEndTime );
        animatedEntry.getKey()
                     .applyAnimation( new PathBasedMovementAnimation( entryAnimation ) );
      }
    }

    for (Map.Entry<MapGridElement, Map<PathAnimation, Pair<Boolean, Collection<Segment>>>> mapGridElementEntry : entitiesColoringTrace
        .entrySet()) {
      //The key of the outer map keeps the grid element the animations refer to
      final MapGridElement mapElement = mapGridElementEntry.getKey();
      if ( mapElement instanceof Pipe ) {

        final Collection<PipeColoringAnimation> resultElementAnimations = new LinkedList<>();

        for (Map.Entry<PathAnimation, Pair<Boolean, Collection<Segment>>> pathAnimationEntry : mapGridElementEntry
            .getValue().entrySet()) {
          /*
            The inner map keeps the mapping path animations: <coloring/decoloring flag; list of segments>.

            The list of segments usually keeps only one segment because entities speeds are in the range 0-3 so
            the same entity can't enter and, exit and then enter another time the same grid element is a single step
           */

          final PathAnimation animation = pathAnimationEntry.getKey();
          final boolean isColoring = pathAnimationEntry.getValue().getFirst();

          for (Segment segment : pathAnimationEntry.getValue().getSecond()) {
            resultElementAnimations.add( new PathBasedPipeColoringAnimation( animation,
                                                                             segment,
                                                                             ( (Pipe) mapElement )
                                                                                 .getSegment(),
                                                                             isColoring ) );
          }
        }
        ( (Pipe) mapElement ).applyAnimations( resultElementAnimations );
      } else /*if ( mapElement instanceof Junction )*/ {
        final Collection<JunctionColoringAnimation> resultElementAnimations = new LinkedList<>();

        for (Map.Entry<PathAnimation, Pair<Boolean, Collection<Segment>>> pathAnimationEntry : mapGridElementEntry
            .getValue().entrySet()) {
          final PathAnimation animation = pathAnimationEntry.getKey();
          final boolean isColoring = pathAnimationEntry.getValue().getFirst();

          //Segment list is not needed when creating the JunctionColoringAnimation
          resultElementAnimations.add( new PathBasedJunctionColoringAnimation( animation,
                                                                               ( (Junction) mapElement )
                                                                                   .getPosition(),
                                                                               isColoring ) );
        }
        ( (Junction) mapElement ).applyAnimations( resultElementAnimations );
      }
    }


    if ( ! this.playerHitted ) {
      if ( deadMan ) {
        this.hitPlayer();
      } else if ( this.checkWinCondition(this.modifiedMapElements) ) {
        this.state = LEVEL_STATE.LEVEL_WIN;
      }
    }

    if ( this.coloredFaces > previousColoredFacesNumber ) {
      final int coloredFacesThisStep = this.coloredFaces - previousColoredFacesNumber;
      this.addScore( FACE_COLORING_SCORE * ( 2 * coloredFacesThisStep - 1 ) );
    }

    for (Monster mob : levelMonsters) {
      mob.startStep();
    }

    player.startStep();

    this.firstStep = false;
View Full Code Here

Examples of org.gbcpainter.game.model.Monster

  }

  @NotNull
  @Override
  public Monster createMonster( @NonNls final String name, final Point position, final PERPENDICULAR_DIRECTION direction ) throws IllegalArgumentException {
    final Monster mob = createMonster( name, position );
    mob.setDirection( direction );
    return mob;
  }
View Full Code Here

Examples of ru.vagrant_ai.questionmarkgame.obj.mob.Monster

    if (bullet.intersects(GameplayState.border))
      return 0;
    boolean crit = false;
    for (int i = 0; i < MonsterHandler.monster_array.size(); ++i)
    {
      Monster monster = MonsterHandler.monster_array.get(i);
      if (monster.state != MS.NULL && monster.state != MS.DEAD && mobNotPierced(monster))
      {
        if (bullet.intersects(monster.hitbox) || bullet.intersects(monster.hitbox_crit))
        {
          if (bullet.intersects(monster.hitbox_crit))
            crit = true;
          if (GameplayState.player.gun.opt_poison)
            monster.addPoison((byte) ((crit?7:5)+Elements.extractLevel(ITEM.P_GUN_POISON_BULLET)*(crit?2:1)), (byte) (power/((crit?1.12f:0.9f)+Elements.extractLevel(ITEM.P_GUN_POISON_BULLET)*(0.15f+(crit?0.1f:0)))));
          int damage = (int) (power + power_add); //calculate damage
          damage = (short) (power * ((crit?2.4f:1) + (GameplayState.player.gun.opt_crit_up && crit?0.5f+Elements.extractLevel(ITEM.P_GUN_CRIT_UP)*0.24f:0)));
          damage /= (pierced.size()>0?pierced.size()+1-Elements.extractLevel(ITEM.P_GUN_PIERCE)*0.65f:1);
          monster.onDamage(damage, true);
          if (pierce > 0)
          {
            pierce--;
            pierced.add(monster);
            return 1;
View Full Code Here

Examples of ru.vagrant_ai.questionmarkgame.obj.mob.Monster

  private boolean checkCollision()
  {
    if (bullet.intersects(GameplayState.border)) return true;
    for (int i = 0; i < MonsterHandler.Monster_array.size(); ++i)
    {
      Monster monster = MonsterHandler.Monster_array.get(i);
      if (bullet.intersects(monster.hitbox) && monster.state != MS.NULL && monster.state != MS.DEAD)
        {
          monster.onDamage(GameplayState.player.gun.opt_power);     
          return true;
        }
    }
    return false;
  }
View Full Code Here

Examples of ru.vagrant_ai.questionmarkgame.obj.mob.Monster

  private boolean checkCollision()
  {
    if (bullet.intersects(GameplayState.border)) return true;
    for (int i = 0; i < MonsterHandler.monster_array.size(); ++i)
    {
      Monster monster = MonsterHandler.monster_array.get(i);
      if (monster.state != MS.NULL && monster.state != MS.DEAD)
      {
        if (bullet.intersects(monster.hitbox_crit))
        {
          monster.onDamage((int) ((float)GameplayState.player.gun.opt_power/6*2.8f), true);     
          return true;
        }
        else if (bullet.intersects(monster.hitbox))
          {
            monster.onDamage((int)((float)(GameplayState.player.gun.opt_power/6)*1.6f), false);     
            return true;
          }
      }
    }
    return false;
View Full Code Here

Examples of ru.vagrant_ai.questionmarkgame.obj.mob.Monster

    if (util_speed < 0+add*2)
    {
      util_speed = speed;
      for (int i = 0; i < MonsterHandler.monster_array.size(); ++i)
      {
        Monster monster = MonsterHandler.monster_array.get(i);
        MS state = monster.state;
        if ((zone.intersects(monster.hitbox) || zone.contains(monster.hitbox)) && state != MS.NULL && state != MS.DEAD)
        {
          monster.onDamage(damage+(type == 1?(int) (Elements.extractLevel(ITEM.P_UPG_SMALL_LIGHT)*2):0)+(type == 2?Elements.extractLevel(ITEM.P_UPG_LIGHT)*2:0)+(type == 3?(int) (Elements.extractLevel(ITEM.P_UPG_STRONG_LIGHT)*2.5f):0), false, false);
        }
       
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.