Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add some flavor to the bolt. mmmmmmmm, lightning
- if(!IS_VEC_NULL_SQ_SAFE(&Storm->flavor)){
- // start with your basic hot sauce. measure how much you have
- vec3d your_basic_hot_sauce;
- vm_vec_sub(&your_basic_hot_sauce, &strike, &start);
- float how_much_hot_sauce = vm_vec_normalize(&your_basic_hot_sauce);
- // now figure out how much of that good wing sauce to add
- vec3d wing_sauce = Storm->flavor;
- if(frand_range(0.0, 1.0f) < 0.5f){
- vm_vec_scale(&wing_sauce, -1.0f);
- }
- float how_much_of_that_good_wing_sauce_to_add = vm_vec_normalize(&wing_sauce);
- // mix the two together, taking care not to add too much
- vec3d the_mixture;
- if(how_much_of_that_good_wing_sauce_to_add > 1000.0f){
- how_much_of_that_good_wing_sauce_to_add = 1000.0f;
- }
- vm_vec_interp_constant(&the_mixture, &your_basic_hot_sauce, &wing_sauce, how_much_of_that_good_wing_sauce_to_add / 1000.0f);
- // take the final sauce and store it in the proper container
- vm_vec_scale(&the_mixture, how_much_hot_sauce);
- // make sure to put it on everything! whee!
- vm_vec_add(&strike, &start, &the_mixture);
- }
Advertisement
Add Comment
Please, Sign In to add comment