Package org.terasology.logic.health

Examples of org.terasology.logic.health.DoDamageEvent


            if (ai.aggressive) {
                // TODO fix this to proper attacking
                if (distanceToPlayer <= ai.attackDistance) {
                    if (tempTime - lastAttack > ai.damageFrequency) {
                        localPlayer.getCharacterEntity().send(
                                new DoDamageEvent(ai.damage, EngineDamageTypes.PHYSICAL.get(), entity));
                        lastAttack = CoreRegistry.get(Time.class).getGameTimeInMs();
                    }
                }
            }
View Full Code Here


        boolean debugEnabled = config.getSystem().isDebugEnabled();
        // Features for debug mode only
        if (debugEnabled) {
            switch (event.getKey().getId()) {
                case Keyboard.KeyId.K:
                    entity.send(new DoDamageEvent(9999, null));
                    break;
                case Keyboard.KeyId.F6:
                    config.getRendering().getDebug().setEnabled(!config.getRendering().getDebug().isEnabled());
                    event.consume();
                    break;
View Full Code Here

                blockPos.set((int) target.x, (int) target.y, (int) target.z);
                Block currentBlock = worldProvider.getBlock(blockPos);

                /* PHYSICS */
                if (currentBlock.isDestructible()) {
                    blockEntityRegistry.getEntityAt(blockPos).send(new DoDamageEvent(1000, EngineDamageTypes.EXPLOSIVE.get()));
                }
            }
        }
    }
View Full Code Here

                            builder.build();
                            particleEffects++;
                        }
                        if (random.nextInt(4) == 0) {
                            EntityRef blockEntity = blockEntityRegistry.getEntityAt(blockPos);
                            blockEntity.send(new DoDamageEvent(1000, EngineDamageTypes.EXPLOSIVE.get()));
                        }

                        blockCounter--;
                    }
View Full Code Here

                if (item.damageType != null) {
                    damageType = item.damageType;
                }
            }

            result.getEntity().send(new DoDamageEvent(damage, damageType, character, event.getItem()));
        }
    }
View Full Code Here

TOP

Related Classes of org.terasology.logic.health.DoDamageEvent

Copyright © 2018 www.massapicom. 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.