Meridius_IX

Glitchy Drone

Sep 2nd, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 17.49 KB | None | 0 0
  1. //Meridius_IX's Pirate AI Systems
  2.  
  3. double player_detect_range = 20000; //If player is further than this value from drone, it will not execute any behavioral scripting.
  4.  
  5. //////////////////////////////////////////////////////
  6. //Do Not Touch Anything Below Here
  7. //////////////////////////////////////////////////////
  8.  
  9. double player_drone_distance = 0;
  10. double player_origin_distance = 0;
  11. double drone_origin_distance = 0;
  12.  
  13. IMyRemoteControl remote_control;
  14. IMyTextPanel face_panel;
  15. IMyTextPanel rear_panel;
  16. IMyWarhead warhead;
  17. IMyRadioAntenna antenna;
  18. IMyShipConnector connector;
  19. IMyGyro gyro;
  20.  
  21. void Main(string argument){
  22.    
  23.     Vector3D world_center = new Vector3D(0,0,0);
  24.     Vector3D player_coords = new Vector3D(0,0,0);
  25.     Vector3D drone_coords = new Vector3D(0,0,0);
  26.     Vector3D origin_coords = new Vector3D(0,0,0);
  27.    
  28.     //Find Remote Control Block(s)
  29.     List<IMyTerminalBlock> remote_control_list = new List<IMyTerminalBlock>();
  30.     GridTerminalSystem.GetBlocksOfType<IMyRemoteControl>(remote_control_list);
  31.    
  32.     if(remote_control_list.Count != 0){
  33.        
  34.         for(int i = 0; i < remote_control_list.Count; i++){
  35.            
  36.             if(remote_control_list[i].IsFunctional == true){
  37.                
  38.                 remote_control = remote_control_list[i] as IMyRemoteControl;
  39.                 break;
  40.                
  41.             }
  42.            
  43.         }
  44.        
  45.     }else{
  46.        
  47.         Echo("No Remote Control Block Found. Script Cannot Execute.");
  48.         return;
  49.        
  50.     }
  51.    
  52.     //Check If Drone is NPC Owned
  53.     remote_control.GetNearestPlayer(out player_coords);
  54.    
  55.     if(player_coords == world_center){
  56.        
  57.         Echo("Drone is not owned by Hostile NPC. Script Cannot Continue.");
  58.         return;
  59.        
  60.     }
  61.    
  62.     drone_coords = remote_control.GetPosition();
  63.    
  64.     //Get & Set Origin Coords
  65.     if(this.Storage == null || this.Storage == ""){
  66.        
  67.         this.Storage = drone_coords.ToString();
  68.         origin_coords = drone_coords;
  69.        
  70.     }else{
  71.        
  72.         Vector3D.TryParse(this.Storage, out origin_coords);
  73.        
  74.     }
  75.    
  76.     //Calculate Distances
  77.     player_drone_distance = MeasureDistance(player_coords, drone_coords);
  78.     player_origin_distance = MeasureDistance(player_coords, origin_coords);
  79.     drone_origin_distance = MeasureDistance(drone_coords, origin_coords);
  80.  
  81.     if(player_drone_distance > player_detect_range){
  82.        
  83.         Echo("No Player Detected. Aborting Script Execution.");
  84.        
  85.     }
  86.    
  87.     //////////////////////////////////////////////////////
  88.     //Pirate Behavior Start
  89.     //////////////////////////////////////////////////////
  90.    
  91.     //Setup Lists / Blocks
  92.    
  93.     List<IMyTerminalBlock> antenna_list = new List<IMyTerminalBlock>();
  94.     GridTerminalSystem.GetBlocksOfType<IMyRadioAntenna>(antenna_list);
  95.    
  96.     face_panel = null;
  97.    
  98.     face_panel = GridTerminalSystem.GetBlockWithName("LCD Face") as IMyTextPanel;
  99.     rear_panel = GridTerminalSystem.GetBlockWithName("LCD Rear") as IMyTextPanel;
  100.    
  101.     if(antenna_list.Count != 0){
  102.        
  103.         for(int i = 0; i < antenna_list.Count; i++){
  104.            
  105.             if(antenna_list[i].IsFunctional == true){
  106.                
  107.                 antenna = antenna_list[i] as IMyRadioAntenna;
  108.                 break;
  109.                
  110.             }
  111.            
  112.         }
  113.        
  114.     }
  115.    
  116.     //Special Variables
  117.     Random rnd = new Random();
  118.     string [] attacked_msg = {"Why are you trying to hurt me?", "I thought we were friends...", "Did I do something to upset you?", "I only wanted to help you...", "You don't like me anymore?", "Please don't be mad at me..."};
  119.     string [] retreat_msg = {"Oowww!", "That hurts!", "Leave me alone!", "Please stop!", "No more!", "Help me!"};
  120.     int random_msg_index = rnd.Next(0, 6);
  121.     string selected_msg = attacked_msg[random_msg_index];
  122.    
  123.     string [] button_action = {"ActionDead", "ActionEnemies", "ActionExplode", "ActionGift", "ActionGyro"};
  124.     int [] action_timer = {5, 10, 3, 30, 15};
  125.     int random_action_index = rnd.Next(0, 5);
  126.    
  127.     string current_mode = "ApproachPlayer";
  128.     int special_timer = 0;
  129.     int previous_block_count = 0;
  130.     int previous_functional_blocks = 0;
  131.    
  132.     int current_block_count = CheckBlockCount();
  133.     int current_functional_blocks = CheckFunctionalBlockCount();
  134.     bool getting_hacked = HackingDetection();
  135.    
  136.     //Get-Init CustomData
  137.    
  138.     if(remote_control.CustomData == ""){
  139.        
  140.         previous_block_count = current_block_count;
  141.         previous_functional_blocks = current_functional_blocks;
  142.        
  143.         remote_control.CustomData = current_mode + "\n";
  144.         remote_control.CustomData += special_timer.ToString() + "\n";
  145.         remote_control.CustomData += current_block_count.ToString() + "\n";
  146.         remote_control.CustomData += current_functional_blocks.ToString() + "\n";
  147.         remote_control.CustomData += selected_msg;
  148.  
  149.     }else{
  150.        
  151.         string [] data_split = remote_control.CustomData.Split('\n');
  152.         current_mode = data_split[0];
  153.         Int32.TryParse(data_split[1], out special_timer);
  154.         Int32.TryParse(data_split[2], out previous_block_count);
  155.         Int32.TryParse(data_split[3], out previous_functional_blocks);
  156.         selected_msg = data_split[4];
  157.        
  158.     }
  159.    
  160.     //Check for Hostility
  161.     bool interruptable_mode = true;
  162.     string [] exception_modes = {"ActionExplode", "Offended", "BeingHacked", "BeingDamaged", "Betrayed", "RetreatExplode"};
  163.     for(int i = 0; i < exception_modes.Length; i++){
  164.        
  165.         if(current_mode == exception_modes[i]){
  166.            
  167.             interruptable_mode = false;
  168.             break;
  169.            
  170.         }
  171.        
  172.     }
  173.    
  174.  
  175.     Vector3D rear_position = new Vector3D(0,0,0);
  176.     double player_rear_distance = 0;
  177.     if(rear_panel != null){
  178.        
  179.         rear_position = rear_panel.GetPosition();
  180.         player_rear_distance = MeasureDistance(player_coords, rear_position);
  181.        
  182.     }
  183.    
  184.     if(face_panel != null){
  185.        
  186.         if(face_panel.IsFunctional == false){
  187.            
  188.             interruptable_mode = false;
  189.             BlockActivation("Warheads");
  190.             current_mode = "RetreatExplode";
  191.            
  192.         }
  193.        
  194.     }else{
  195.        
  196.         interruptable_mode = false;
  197.         BlockActivation("Warheads");
  198.         current_mode = "RetreatExplode";
  199.        
  200.     }
  201.    
  202.     if(player_rear_distance <= 2 && player_rear_distance != 0 && interruptable_mode == true){
  203.        
  204.         interruptable_mode = false;
  205.         current_mode = "Offended";
  206.         face_panel.ClearImagesFromSelection();
  207.         face_panel.AddImageToSelection("CPC-DroneFaceMad1", false);
  208.         antenna.CustomName = "HEY!";
  209.         remote_control.ClearWaypoints();
  210.         remote_control.AddWaypoint(player_coords, "Player");
  211.         remote_control.SetAutoPilotEnabled(true);
  212.         special_timer = 16;
  213.        
  214.     }
  215.    
  216.     if(getting_hacked == true && interruptable_mode == true){
  217.        
  218.         selected_msg = attacked_msg[random_msg_index];
  219.         face_panel.ClearImagesFromSelection();
  220.         face_panel.AddImageToSelection("CPC-DroneFacePain", false);
  221.         antenna.CustomName = "Ooowwwww!";
  222.         current_mode = "BeingHacked";
  223.         interruptable_mode = false;
  224.         special_timer = 12;
  225.        
  226.     }
  227.    
  228.     if(interruptable_mode == true){
  229.        
  230.         if(current_block_count < previous_block_count || current_functional_blocks < previous_functional_blocks){
  231.            
  232.             selected_msg = attacked_msg[random_msg_index];
  233.             face_panel.ClearImagesFromSelection();
  234.             face_panel.AddImageToSelection("CPC-DroneFacePain", false);
  235.             antenna.CustomName = "Ooowwwww!";
  236.             current_mode = "BeingDamaged";
  237.             interruptable_mode = false;
  238.             special_timer = 12;
  239.            
  240.         }
  241.        
  242.     }
  243.    
  244.    
  245.     //Mode: ApproachPlayer
  246.     if(current_mode == "ApproachPlayer"){
  247.        
  248.         remote_control.ClearWaypoints();
  249.         remote_control.AddWaypoint(player_coords, "Player");
  250.         remote_control.SetAutoPilotEnabled(true);
  251.        
  252.         if(player_drone_distance < 3500){
  253.            
  254.             remote_control.SetAutoPilotEnabled(false);
  255.             antenna.CustomName = "Hi! I'm here to help! Please don't attack!";
  256.             antenna.ApplyAction("OnOff_On");
  257.             antenna.SetValueBool("EnableBroadCast", true);
  258.            
  259.             face_panel.ClearImagesFromSelection();
  260.             face_panel.AddImageToSelection("CPC-DroneFaceNormal", false);
  261.             current_mode = "FirstBroadcast";
  262.             special_timer = 300;
  263.            
  264.         }
  265.        
  266.     }
  267.    
  268.     //Mode: FirstBroadcast
  269.     if(current_mode == "FirstBroadcast"){
  270.        
  271.         if(player_drone_distance < 60){
  272.            
  273.             antenna.CustomName = "I'll do what I can to help! Just press the button!";
  274.             current_mode = "MeetPlayer";
  275.            
  276.         }
  277.        
  278.     }
  279.    
  280.     //Mode: MeetPlayer
  281.     if(current_mode == "MeetPlayer"){
  282.        
  283.         if(argument == "ButtonPress"){
  284.            
  285.             antenna.CustomName = "Ok, here we go!";
  286.             face_panel.ClearImagesFromSelection();
  287.             face_panel.AddImageToSelection("CPC-DroneFaceWorking", false);
  288.             current_mode = "ButtonPress";
  289.             special_timer = 4;
  290.            
  291.         }
  292.        
  293.         if(player_drone_distance < 60 && current_mode != "ButtonPress"){
  294.            
  295.             if(special_timer <= 300 && special_timer >= 241 && current_mode != "ButtonPress"){
  296.                
  297.                 antenna.CustomName = "I'll do what I can to help! Just press the button!";
  298.                
  299.             }
  300.            
  301.             if(special_timer <= 240 && special_timer >= 181 && current_mode != "ButtonPress"){
  302.                
  303.                 antenna.CustomName = "The button is below my face panel. Go ahead and press it!";
  304.                
  305.             }
  306.            
  307.             if(special_timer <= 180 && special_timer >= 121 && current_mode != "ButtonPress"){
  308.                
  309.                 antenna.CustomName = "I'll do my best if you give me a chance!";
  310.                
  311.             }
  312.            
  313.             if(special_timer <= 120 && special_timer >= 61 && current_mode != "ButtonPress"){
  314.                
  315.                 face_panel.ClearImagesFromSelection();
  316.                 face_panel.AddImageToSelection("CPC-DroneFaceBored", false);
  317.                 antenna.CustomName = "Maybe you don't want my help after all...";
  318.                
  319.             }
  320.            
  321.             if(special_timer <= 60 && special_timer >= 6 && current_mode != "ButtonPress"){
  322.                
  323.                 antenna.CustomName = "I'm going to leave soon...";
  324.                
  325.             }
  326.            
  327.             if(special_timer <= 5 && current_mode != "ButtonPress"){
  328.                
  329.                 antenna.CustomName = "I get it, you don't want my help. I'll go away...";
  330.                
  331.             }
  332.            
  333.             if(special_timer <= 0 && current_mode != "ButtonPress"){
  334.                
  335.                 current_mode = "RetreatExplode";
  336.                
  337.             }
  338.            
  339.            
  340.            
  341.         }else{
  342.            
  343.             if(special_timer >= 121){
  344.                
  345.                 antenna.CustomName = "Wait! Come back!";
  346.                
  347.             }
  348.            
  349.         }
  350.        
  351.         special_timer -= 1;
  352.        
  353.        
  354.     }
  355.    
  356.     IMyButtonPanel button_panel = GridTerminalSystem.GetBlockWithName("Button Panel") as IMyButtonPanel;
  357.     if(current_mode == "MeetPlayer"){
  358.        
  359.         button_panel?.ApplyAction("OnOff_On");
  360.        
  361.     }else{
  362.        
  363.         button_panel?.ApplyAction("OnOff_Off");
  364.        
  365.     }
  366.    
  367.     //Mode: ButtonPress
  368.     if(current_mode == "ButtonPress"){
  369.        
  370.         if(special_timer <= 0){
  371.            
  372.             current_mode = button_action[random_action_index];
  373.             special_timer = action_timer[random_action_index] + 1;
  374.            
  375.         }
  376.        
  377.         special_timer -= 1;
  378.        
  379.     }
  380.    
  381.     //Mode: ActionGyro
  382.     if(current_mode == "ActionGyro"){
  383.        
  384.         BlockActivation("Gyros");
  385.         if(special_timer <= 15 && special_timer >= 10){
  386.            
  387.             face_panel.ClearImagesFromSelection();
  388.             face_panel.AddImageToSelection("CPC-DroneFaceDizzy", false);
  389.             antenna.CustomName = "Whaaa! What's going on!?";
  390.            
  391.         }
  392.        
  393.         if(special_timer <= 9 && special_timer >= 4){
  394.            
  395.             antenna.CustomName = "I can't stop it!";
  396.            
  397.         }
  398.        
  399.         if(special_timer <= 3 && special_timer >= 1){
  400.            
  401.             antenna.CustomName = "I think I'm going to...";
  402.            
  403.         }
  404.        
  405.         if(special_timer <= 0){
  406.            
  407.             BlockActivation("Warheads");
  408.            
  409.         }
  410.        
  411.         special_timer -= 1;
  412.        
  413.     }
  414.    
  415.     //Mode: ActionExplode
  416.     if(current_mode == "ActionExplode"){
  417.        
  418.         if(special_timer <= 2 && special_timer >= 1){
  419.            
  420.             face_panel.ClearImagesFromSelection();
  421.             face_panel.AddImageToSelection("CPC-DroneFaceExplode", false);
  422.             antenna.CustomName = "Umm.. I think I accidentally...";
  423.            
  424.         }
  425.        
  426.         if(special_timer <= 0){
  427.            
  428.             BlockActivation("Warheads");
  429.            
  430.         }
  431.        
  432.         special_timer -= 1;
  433.        
  434.     }
  435.    
  436.     //Mode: ActionGift
  437.     if(current_mode == "ActionGift"){
  438.        
  439.         if(special_timer <= 30 && special_timer >= 6){
  440.            
  441.             BlockActivation("Connectors");
  442.             face_panel.ClearImagesFromSelection();
  443.             face_panel.AddImageToSelection("CPC-DroneFaceHappy", false);
  444.             antenna.CustomName = "I brought you some supplies! I hope you like them!";
  445.            
  446.         }
  447.        
  448.         if(special_timer <= 5 && special_timer >= 1){
  449.            
  450.             antenna.CustomName = "I'm glad I could help! Bye!";
  451.            
  452.         }
  453.        
  454.         if(special_timer <= 0){
  455.            
  456.             current_mode = "RetreatExplode";
  457.            
  458.         }
  459.        
  460.         special_timer -= 1;
  461.        
  462.     }
  463.    
  464.     //Mode: ActionEnemies
  465.     if(current_mode == "ActionEnemies"){
  466.        
  467.         if(special_timer <= 10 && special_timer >= 5){
  468.            
  469.             face_panel.ClearImagesFromSelection();
  470.             face_panel.AddImageToSelection("CPC-DroneFaceWorried", false);
  471.             antenna.CustomName = "Uh oh.. I think I dialed the wrong number...";
  472.            
  473.         }
  474.        
  475.         if(special_timer <= 4 && special_timer >= 1){
  476.            
  477.             antenna.CustomName = "I'm sorry if I caused you any trouble...";
  478.            
  479.         }
  480.        
  481.         if(special_timer <= 0){
  482.            
  483.             current_mode = "RetreatExplode";
  484.            
  485.         }
  486.        
  487.         special_timer -= 1;
  488.        
  489.     }
  490.    
  491.     //Mode: ActionDead
  492.     if(current_mode == "ActionDead"){
  493.        
  494.         if(special_timer <= 5 && special_timer >= 3){
  495.            
  496.             antenna.CustomName = "I'm trying really hard!";
  497.            
  498.         }
  499.        
  500.         if(special_timer <= 2 && special_timer >= 1){
  501.            
  502.             antenna.CustomName = "Almost got it!";
  503.            
  504.         }
  505.        
  506.         if(special_timer <= 0){
  507.            
  508.             antenna.CustomName = ">System.Error //CPU Overload";
  509.             face_panel.ClearImagesFromSelection();
  510.             face_panel.AddImageToSelection("CPC-DroneFaceDead", false);
  511.             IMyTimerBlock timer = GridTerminalSystem.GetBlockWithName("Timer") as IMyTimerBlock;
  512.             timer?.ApplyAction("Stop");
  513.            
  514.         }
  515.        
  516.         special_timer -= 1;
  517.        
  518.     }
  519.    
  520.     //Mode: Offended
  521.     if(current_mode == "Offended"){
  522.        
  523.         if(special_timer <= 12 && special_timer >= 6){
  524.            
  525.             remote_control.SetAutoPilotEnabled(false);
  526.             antenna.CustomName = "You're not supposed to look at my Private Hardware!";
  527.            
  528.         }
  529.        
  530.         if(special_timer <= 5 && special_timer >= 1){
  531.            
  532.             face_panel.ClearImagesFromSelection();
  533.             face_panel.AddImageToSelection("CPC-DroneFaceMad2", false);
  534.             antenna.CustomName = "You're really weird.. I think I should leave.";
  535.            
  536.         }
  537.        
  538.         if(special_timer <= 0){
  539.            
  540.             current_mode = "RetreatExplode";
  541.            
  542.         }
  543.        
  544.         special_timer -= 1;
  545.        
  546.     }
  547.  
  548.     //Mode: BeingDamaged
  549.     if(current_mode == "BeingDamaged"){
  550.        
  551.         if(current_block_count == previous_block_count){
  552.            
  553.             current_mode = "Betrayed";
  554.            
  555.         }
  556.        
  557.     }
  558.    
  559.     //Mode: BeingHacked
  560.     if(current_mode == "BeingHacked"){
  561.        
  562.         if(getting_hacked == false){
  563.            
  564.             current_mode = "Betrayed";
  565.            
  566.         }
  567.        
  568.     }
  569.    
  570.     //Mode: Betrayed
  571.     if(current_mode == "Betrayed"){
  572.        
  573.         if(special_timer <= 10 && special_timer >= 1){
  574.            
  575.             antenna.CustomName = selected_msg;
  576.             face_panel.ClearImagesFromSelection();
  577.             face_panel.AddImageToSelection("CPC-DroneFaceSad1", false);
  578.            
  579.         }
  580.        
  581.        
  582.         if(special_timer <= 0){
  583.            
  584.             face_panel.ClearImagesFromSelection();
  585.             face_panel.AddImageToSelection("CPC-DroneFaceSad2", false);
  586.             current_mode = "RetreatExplode";
  587.            
  588.         }
  589.        
  590.         special_timer -= 1;
  591.        
  592.     }
  593.  
  594.     //Mode: RetreatExplode
  595.     if(current_mode == "RetreatExplode"){
  596.        
  597.         remote_control.ClearWaypoints();
  598.         remote_control.AddWaypoint(origin_coords, "Origin");
  599.         remote_control.SetAutoPilotEnabled(true);
  600.        
  601.         if(drone_origin_distance < 150){
  602.            
  603.             BlockActivation("Warheads");
  604.            
  605.         }
  606.        
  607.         if(getting_hacked == true || current_block_count < previous_block_count || current_functional_blocks < previous_functional_blocks){
  608.            
  609.             face_panel.ClearImagesFromSelection();
  610.             face_panel.AddImageToSelection("CPC-DroneFaceSad2", false);
  611.             antenna.CustomName = retreat_msg[random_msg_index];
  612.            
  613.         }else{
  614.            
  615.             antenna.CustomName = "";
  616.            
  617.         }
  618.        
  619.     }
  620.    
  621.     //Set CustomData
  622.     remote_control.CustomData = current_mode + "\n";
  623.     remote_control.CustomData += special_timer.ToString() + "\n";
  624.     remote_control.CustomData += current_block_count.ToString() + "\n";
  625.     remote_control.CustomData += current_functional_blocks.ToString() + "\n";
  626.     remote_control.CustomData += selected_msg;
  627.    
  628.     //////////////////////////////////////////////////////
  629.     //Pirate Behavior End
  630.     //////////////////////////////////////////////////////
  631.    
  632. }
  633.  
  634. void BlockActivation(string blocks){
  635.    
  636.     if(blocks == "Warheads"){
  637.        
  638.         List<IMyTerminalBlock> warhead_list = new List<IMyTerminalBlock>();
  639.         GridTerminalSystem.GetBlocksOfType<IMyWarhead>(warhead_list);
  640.         for(int i = 0; i < warhead_list.Count; i++){
  641.            
  642.             warhead = warhead_list[i] as IMyWarhead;
  643.             warhead.ApplyAction("Detonate");
  644.            
  645.         }
  646.        
  647.     }
  648.    
  649.     if(blocks == "Connectors"){
  650.        
  651.         List<IMyTerminalBlock> connector_list = new List<IMyTerminalBlock>();
  652.         GridTerminalSystem.GetBlocksOfType<IMyShipConnector>(connector_list);
  653.         for(int i = 0; i < connector_list.Count; i++){
  654.            
  655.             connector = connector_list[i] as IMyShipConnector;
  656.             connector.ApplyAction("OnOff_On");
  657.            
  658.         }
  659.        
  660.     }
  661.    
  662.     if(blocks == "Gyros"){
  663.        
  664.         List<IMyTerminalBlock> gyro_list = new List<IMyTerminalBlock>();
  665.         GridTerminalSystem.GetBlocksOfType<IMyGyro>(gyro_list);
  666.         for(int i = 0; i < gyro_list.Count; i++){
  667.            
  668.             gyro = gyro_list[i] as IMyGyro;
  669.             gyro.SetValueBool("Override", true);
  670.            
  671.         }
  672.        
  673.     }
  674.    
  675.    
  676.    
  677. }
  678.  
  679. int CheckBlockCount(){
  680.    
  681.     List<IMyTerminalBlock> all_blocks = new List<IMyTerminalBlock>();
  682.     GridTerminalSystem.GetBlocksOfType<IMyTerminalBlock>(all_blocks);
  683.    
  684.     return all_blocks.Count;
  685.    
  686. }
  687.  
  688. int CheckFunctionalBlockCount(){
  689.    
  690.     List<IMyTerminalBlock> all_blocks = new List<IMyTerminalBlock>();
  691.     GridTerminalSystem.GetBlocksOfType<IMyTerminalBlock>(all_blocks);
  692.     int block_counter = 0;
  693.     for(int i = 0; i < all_blocks.Count; i++){
  694.        
  695.         if(all_blocks[i].IsFunctional == true && all_blocks[i].DisassembleRatio == 1){
  696.            
  697.             block_counter++;
  698.            
  699.         }
  700.        
  701.     }
  702.    
  703.     return block_counter;
  704.    
  705. }
  706.  
  707. bool HackingDetection(){
  708.    
  709.     List<IMyTerminalBlock> all_blocks = new List<IMyTerminalBlock>();
  710.     GridTerminalSystem.GetBlocksOfType<IMyTerminalBlock>(all_blocks);
  711.     for(int i = 0; i < all_blocks.Count; i++){
  712.        
  713.         if(all_blocks[i].IsBeingHacked == true){
  714.            
  715.             return true;
  716.            
  717.         }
  718.        
  719.     }
  720.    
  721.     return false;
  722.  
  723. }
  724.  
  725. double MeasureDistance(Vector3D point_a, Vector3D point_b){
  726.    
  727.     double result = Math.Round( Vector3D.Distance( point_a, point_b ), 2 );
  728.     return result;
  729.    
  730. }
Advertisement
Add Comment
Please, Sign In to add comment