Skip to content

Commit

Permalink
Audio upgrades, some mobs, more ways to die
Browse files Browse the repository at this point in the history
  • Loading branch information
esapetri committed Jan 21, 2013
1 parent 5329d2d commit e92d212
Show file tree
Hide file tree
Showing 21 changed files with 1,079 additions and 26 deletions.
9 changes: 7 additions & 2 deletions mods/core/assets/prefabs/player.prefab
Expand Up @@ -31,7 +31,12 @@
"detectGroups" : ["engine:debris"]
},
"CharacterSound" : {
"footstepSounds" : ["engine:FootGrass1","engine:FootGrass2","engine:FootGrass3","engine:FootGrass4","engine:FootGrass5"]
"footstepSounds" : ["engine:FootGrass1","engine:FootGrass2","engine:FootGrass3","engine:FootGrass4","engine:FootGrass5"],
"damageSounds" : ["engine:HeartBeat"],
"landingSounds" :["engine:Land"],
"deathSounds" :["engine:Death"],
"deathVolume" : 4,
"landingVolume" : 0.2
},
"Inventory" : {
"itemSlots": [
Expand All @@ -46,7 +51,7 @@
},
"MinionController" : {},
"Spawner" : {
"types" : ["gelcube", "chromaticgelcube", "metallicgelcube"],
"types" : ["gelcube", "chromaticgelcube", "metallicgelcube","mare"],
"timeBetweenSpawns" : 10000,
"maxMobsPerSpawner" : 64,
"rangedSpawning" : true,
Expand Down
Expand Up @@ -43,4 +43,9 @@ public HungerComponent(int maxContentment, float deregenRate, float waitBeforeDe
this.deregenRate = deregenRate;
this.waitBeforeDeregen = waitBeforeDeregen;
}

public int hunger(){
return maxContentment-currentContentment;
}

}
64 changes: 64 additions & 0 deletions mods/portals/assets/prefabs/mares/grassMare.prefab
@@ -0,0 +1,64 @@
/*
* Copyright 2012 Esa-Petri Tirkkonen <esereja@yahoo.co.uk>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"Location" : {},
"Mesh" : {
"renderType" : "GelatinousCube",
"color" : [0.10, 0.80, 0.20, 1]
},
"Health" : {
"currentHealth" : 25,
"maxHealth" : 150,
"regenRate" : 5,
"waitBeforeRegen" : 2,
"excessSpeedDamageMultiplier" : 2,
"fallingDamageSpeedThreshold" : 30
},
"CharacterMovement" : {
"height" : 1,
"radius" : 0.5,
"stepHeight" : 0.4,
"faceMovementDirection" : true,
"maxGroundSpeed" : 2.5,
"groundFriction" = 16,
"jumpSpeed" = 10,
"distanceBetweenFootsteps" : 1.5
},
"HierarchicalAI" : {
"hectic" : 1,
"straightLined" : 1,
"playerdistance" : 1,
"moveUpdateTime" : 500,
"directionUpdateTime" :1500,
"idlingUpdateTime" :10,
"aggressive" : false,
"hunter": false,
"runDistance" : 60,
"panicDistance" : 4,
"attackDistance" : 1,
"damage" : 10,
"damageFrequency" : 1000
},
"CharacterSound" : {
"footstepSounds" : ["engine:FootGrass2","engine:FootGrass3","engine:FootGrass4","engine:FootGrass5"],
"damageSounds" : ["engine:HeartBeat"],
"deathSounds" :["engine:Death"],
"deathVolume" : 4
},
"Spawnable" : {
"type" : "mare"
}
}
64 changes: 64 additions & 0 deletions mods/portals/assets/prefabs/mares/herbMare.prefab
@@ -0,0 +1,64 @@
/*
* Copyright 2012 Esa-Petri Tirkkonen <esereja@yahoo.co.uk>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"Location" : {},
"Mesh" : {
"renderType" : "GelatinousCube",
"color" : [0.30, 0.60, 0.20, 1]
},
"Health" : {
"currentHealth" : 25,
"maxHealth" : 150,
"regenRate" : 5,
"waitBeforeRegen" : 2,
"excessSpeedDamageMultiplier" : 2,
"fallingDamageSpeedThreshold" : 30
},
"CharacterMovement" : {
"height" : 1,
"radius" : 0.5,
"stepHeight" : 0.4,
"faceMovementDirection" : true,
"maxGroundSpeed" : 2.5,
"groundFriction" = 16,
"jumpSpeed" = 10,
"distanceBetweenFootsteps" : 1.5
},
"HierarchicalAI" : {
"hectic" : 1,
"straightLined" : 1,
"playerdistance" : 1,
"moveUpdateTime" : 3000,
"directionUpdateTime" :1500,
"idlingUpdateTime" :3000,
"aggressive" : false,
"hunter": false,
"runDistance" : 60,
"panicDistance" : 5,
"attackDistance" : 1,
"damage" : 10,
"damageFrequency" : 1000
},
"CharacterSound" : {
"footstepSounds" : ["engine:FootGrass2","engine:FootGrass3","engine:FootGrass4","engine:FootGrass5"],
"damageSounds" : ["engine:HeartBeat"],
"deathSounds" :["engine:Death"],
"deathVolume" : 4
},
"Spawnable" : {
"type" : "mare"
}
}
Expand Up @@ -25,6 +25,7 @@
import org.terasology.entitySystem.*;
import org.terasology.game.CoreRegistry;
import org.terasology.logic.LocalPlayer;
import org.terasology.utilities.EntityTools;
import org.terasology.performanceMonitor.PerformanceMonitor;
import org.terasology.utilities.FastRandom;
import org.terasology.world.WorldProvider;
Expand All @@ -47,6 +48,7 @@ public class SpawnerSystem implements UpdateSubscriberSystem {
protected EntityManager entityManager;

private final FastRandom random = new FastRandom();
private EntityTools entityTools;
private DefaultMobFactory factory;

private long tick = 0;
Expand All @@ -63,6 +65,7 @@ public void initialise() {
factory = new DefaultMobFactory();
factory.setEntityManager(entityManager);
factory.setRandom(random);
entityTools = new EntityTools(worldProvider,entityManager);
cacheTypes();
}

Expand Down Expand Up @@ -155,7 +158,6 @@ public void update(float delta) {
Vector3f dist = new Vector3f(originPos);
dist.sub(localPlayer.getPosition());
double distanceToPlayer = dist.lengthSquared();

if (distanceToPlayer > spawnComp.playerNeedRange) {
logger.info("Spawner {} too far from player {}<{}", entity.getId(), distanceToPlayer, spawnComp.playerNeedRange);
continue;
Expand Down

0 comments on commit e92d212

Please sign in to comment.