forked from oerkki/voxelands
some tweaks to bows and arrows
This commit is contained in:
parent
675e9f3aa3
commit
ac04c22a15
Binary file not shown.
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 335 B |
Binary file not shown.
After Width: | Height: | Size: 496 B |
Binary file not shown.
Before Width: | Height: | Size: 484 B After Width: | Height: | Size: 382 B |
|
@ -1272,7 +1272,7 @@ void content_mapnode_special(bool repeat)
|
|||
f->hardness = 1.0;
|
||||
f->pressure_type = CST_SOLID;
|
||||
f->destructive_mob_safe = true;
|
||||
crafting::setFilledRoundRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_LOCKABLE_CHEST);
|
||||
crafting::setFilledRoundRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_SAFE);
|
||||
lists::add("craftguide",i);
|
||||
lists::add("creative",i);
|
||||
|
||||
|
|
|
@ -528,8 +528,6 @@ void content_mob_init()
|
|||
f->motion = MM_THROWN;
|
||||
f->motion_type = MMT_FLY;
|
||||
f->notices_player = true;
|
||||
f->attack_player_damage = 1;
|
||||
f->attack_player_range = v3f(1,1,1);
|
||||
f->attack_mob_damage = 5;
|
||||
f->attack_mob_range = v3f(1,1,1);
|
||||
f->lifetime = 10.0;
|
||||
|
@ -541,15 +539,13 @@ void content_mob_init()
|
|||
f = &g_content_mob_features[i];
|
||||
f->content = i;
|
||||
f->level = MOB_AGGRESSIVE;
|
||||
f->setTexture("arrow.png");
|
||||
f->setTexture("mob_arrow.png");
|
||||
f->texture_display = MDT_EXTRUDED;
|
||||
f->model_offset = v3f(0,0.2,0);
|
||||
f->punch_action = MPA_IGNORE;
|
||||
f->motion = MM_THROWN;
|
||||
f->motion_type = MMT_FLY;
|
||||
f->notices_player = true;
|
||||
f->attack_player_damage = 1;
|
||||
f->attack_player_range = v3f(1,1,1);
|
||||
f->attack_mob_damage = 20;
|
||||
f->attack_mob_range = v3f(1,1,1);
|
||||
f->lifetime = 20.0;
|
||||
|
|
|
@ -549,17 +549,22 @@ void MobSAO::step(float dtime, bool send_recommended)
|
|||
// Sort them.
|
||||
// After this, the closest object is the first in the array.
|
||||
objects.sort();
|
||||
bool hit = false;
|
||||
|
||||
for (u32 i=0; i<objects.size(); i++) {
|
||||
for (u32 i=0; i<objects.size() && !hit; i++) {
|
||||
ServerActiveObject *obj = (ServerActiveObject*)objects[i].obj;
|
||||
if (obj->getId() == m_id)
|
||||
continue;
|
||||
if (obj->getType() == ACTIVEOBJECT_TYPE_MOB) {
|
||||
((MobSAO*)obj)->doDamage(m.attack_mob_damage);
|
||||
hit = true;
|
||||
}else if (obj->getType() == ACTIVEOBJECT_TYPE_ITEM) {
|
||||
((ItemSAO*)obj)->m_removed = true;
|
||||
hit = true;
|
||||
}
|
||||
}
|
||||
if (hit)
|
||||
m_removed = true;
|
||||
}
|
||||
|
||||
MobMotion mot = getMotion();
|
||||
|
@ -1122,7 +1127,7 @@ void MobSAO::stepMotionThrown(float dtime)
|
|||
m_yaw = wrapDegrees_180(180./PI*atan2(m_speed.Z, m_speed.X));
|
||||
|
||||
v3s16 pos_i = floatToInt(m_base_position, BS);
|
||||
if (!checkFreePosition(pos_i)) {
|
||||
if (!checkFreePosition(pos_i) || m_removed) {
|
||||
if (m.contact_explosion_diameter > 0)
|
||||
explodeSquare(pos_i, v3s16(m.contact_explosion_diameter,m.contact_explosion_diameter,m.contact_explosion_diameter));
|
||||
if (m.contact_place_node != CONTENT_IGNORE && checkFreeAndWalkablePosition(pos_i+v3s16(0,1,0))) {
|
||||
|
|
Loading…
Reference in New Issue