#!/usr/bin/toribash
#test bow and arrow
######################################

gamerule
ed 1450
mf 500
tf 30
dt 600

#bow 1
env_obj 1
    shape box
    pos 1.04 6 2.375
    color 0.4 0.4 0.2 1
    rot 0 0 0
    sides 0.02 0.05 1.75
    material steel
    mass 0.001
friction 0
    flag 0
#END 1

env_obj 2
    shape box
    pos 1 6 2.375
    color 0.4 0.4 0.2 1
    rot 0 0 0
    sides 0.02 0.05 1.75
    material steel
    mass 0.001
friction 0
    flag 0
#END 1

env_obj 3
    shape box
    pos 1.02 6 1.93
    color 0.3 0.3 0.3 1
    rot 0 0 0
    sides 0.02 0.05 0.865
    material steel
    mass 0.001
friction 0
    flag 16
#END 1


env_obj 4
    shape box
    pos 1.02 6 2.82
    color 0.3 0.3 0.3 1
    rot 0 0 0
    sides 0.02 0.05 0.865
    material steel
    mass 0.001
friction 0
    flag 16
#END 1

#end bow 1

#arrow shaft
env_obj 5
    shape box
    pos 1.02 6.2 2.375
    color 0.3 0.3 0.3 1
    rot 0 0 0
    sides 0.02 1 0.02
    material steel
    mass 0.001
friction 0
    flag 0
#END 1


#strings
env_obj 6
    shape box
    pos 1.02 6.3125 1.9375
    color 0 0 0 1
    rot 39 0 0
    sides 0.0125 0.0125 1.0625
    material steel
    mass 0.001
friction 0
    flag 16
#END 1

env_obj 7
    shape box
    pos 1.02 6.3125 2.8125
    color 0 0 0 1
    rot -39 0 0
    sides 0.0125 0.0125 1.0625
    material steel
    mass 0.001
friction 0
    flag 16
#END 2


#arrow tip
env_obj 8
    shape sphere
    pos 1.02 5.6875 2.375
    color 0.8 0 -0.1 1
    rot 0 0 0
    sides 0.0625 0.0625 1.0625
    material steel
    mass 0.001
friction 0
    flag 6
thrust 1 0 -0.2 0
#END 3

env_obj_joint 1 1 3
    pos 1.04 6 2.375

env_obj_joint 2 1 4
    pos 1.04 6 2.375

env_obj_joint 3 2 3
    pos 1.04 6 2.375

env_obj_joint 4 2 4
    pos 1.04 6 2.375

env_obj_joint 5 3 6
    pos 1.04 6 2.375

env_obj_joint 6 4 7
    pos 1.04 6 2.375

env_obj_joint 7 5 8
    pos 1.02 5.6875 2.375


env_obj 9
    shape box
    pos 1.04 -6 2.375
    color 0.4 0.4 0.2 1
    rot 0 0 0
    sides 0.02 0.05 1.75
    material steel
    mass 0.001
friction 0
    flag 0
#END 1

env_obj 10
    shape box
    pos 1 -6 2.375
    color 0.4 0.4 0.2 1
    rot 0 0 0
    sides 0.02 0.05 1.75
    material steel
    mass 0.001
friction 0
    flag 0
#END 1

env_obj 11
    shape box
    pos 1.02 -6 1.93
    color 0.3 0.3 0.3 1
    rot 0 0 0
    sides 0.02 0.05 0.865
    material steel
    mass 0.001
friction 0
    flag 16
#END 1


env_obj 12
    shape box
    pos 1.02 -6 2.82
    color 0.3 0.3 0.3 1
    rot 0 0 0
    sides 0.02 0.05 0.865
    material steel
    mass 0.001
friction 0
    flag 16
#END 1

env_obj 13
    shape box
    pos 1.02 -6.2 2.375
    color 0.3 0.3 0.3 1
    rot 0 0 0
    sides 0.02 1 0.02
    material steel
    mass 0.001
friction 0
    flag 0
#END 1

env_obj 14
    shape box
    pos 1.02 -6.3125 1.9375
    color 0 0 0 1
    rot -39 0 0
    sides 0.0125 0.0125 1.0625
    material steel
    mass 0.001
friction 0
    flag 16
#END 1

env_obj 15
    shape box
    pos 1.02 -6.3125 2.8125
    color 0 0 0 1
    rot 39 0 0
    sides 0.0125 0.0125 1.0625
    material steel
    mass 0.001
friction 0
    flag 16
#END 2

env_obj 16
    shape sphere
    pos 1.02 -5.6875 2.375
    color 0.8 0 -0.1 1
    rot 0 0 0
    sides 0.0625 0.0625 1.0625
    material steel
    mass 0.001
friction 0
    flag 6
thrust 1 0 0.2 0
#END 3

env_obj_joint 8 9 11
    pos 1.04 -6 2.375

env_obj_joint 9 9 12
    pos 1.04 -6 2.375

env_obj_joint 10 10 11
    pos 1.04 -6 2.375

env_obj_joint 11 10 12
    pos 1.04 -6 2.375

env_obj_joint 12 11 14
    pos 1.04 -6 2.375

env_obj_joint 13 12 15
    pos 1.04 -6 2.375

env_obj_joint 14 13 16
    pos 1.02 -5.6875 2.375

body l_biceps
sides 0.2 0.4 0.2
pos 1.35 0.7 2.3

body r_biceps
shape box
sides 0.2 0.4 0.2
pos 0.65 0.7 2.3

body r_triceps
shape box
pos 0.65 0.14 2.3
sides 0.1 0.4 0.1

body r_hand
shape box
pos 0.9 -0.2 2.1

joint l_elbow
pos 1.35 0.5 2.3
axis 1 0 0
range 0.2 0.0
velocity 20

joint r_elbow
pos 0.65 0.5 2.3


joint l_shoulder
axis 1 0 0
strength 0.3
velocity 5


body l_triceps
pos 1.3 0.17 2.3
sides 0.1 0.4 0.1

joint l_wrist
pos 1.2 0.0025 2.3
range 0.1 -0.1
axis 1 0 0 

joint r_wrist
pos 0.65 0.0025 2.3
 

joint r_pecs
range 1.5 -0.7

body l_hand
pos 1.05 0.0025 2.35

joint neck
axis 0 1 0 

joint chest
range 0.05 -0.05
strength 4.0
velocity 5.0

joint l_pecs
axis 0 0 1
rot 0 0 0
range 0.02 -0.02

joint abs
axis 1 0 0
rot 0 0 0
range 0.1 -0.15
strength 3.0
velocity 5.0

joint lumbar
range 0.1 -0.1
strength 3.0
velocity 5.0

body l_foot
density 50
body r_foot
density 50