Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .vs/CSharpMainProjectMyFork/v18/.suo
Binary file not shown.
12 changes: 12 additions & 0 deletions .vs/CSharpMainProjectMyFork/v18/DocumentLayout.backup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Version": 1,
"WorkspaceRootPath": "D:\\Soft\\GitHub\\CSharpMainProjectMyFork\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": []
}
]
}
12 changes: 12 additions & 0 deletions .vs/CSharpMainProjectMyFork/v18/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Version": 1,
"WorkspaceRootPath": "D:\\Soft\\GitHub\\CSharpMainProjectMyFork\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": []
}
]
}
4 changes: 2 additions & 2 deletions Assets/Scripts/Controller/BotController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
using Model.Config;
using UnityEngine;
using Utilities;
//hello
//Hello
//How are you?
//i'm fine
//I'm fine
namespace Controller
{
public class BotController
Expand Down
4 changes: 3 additions & 1 deletion Assets/Scripts/EnterPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ public class EnterPoint : MonoBehaviour
[SerializeField] private Settings _settings;
[SerializeField] private Canvas _targetCanvas;
private float _timeScale = 1;



//Проверочный коммит
void Start()
{
Time.timeScale = _timeScale;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ protected override void UpdateImpl(float deltaTime, float time)
// Insert you code here
///////////////////////////////////////

float maxHeight = totalDistance * 0.6f;
localHeight = maxHeight * (-(t * 2 - 1) * (t * 2 - 1) + 1) + localHeight;

///////////////////////////////////////
// End of the code to insert
///////////////////////////////////////

Height = localHeight;
if (time > StartTime + _timeToTarget)
Hit(_target);
Expand Down
72 changes: 65 additions & 7 deletions Assets/Scripts/UnitBrains/Player/SecondUnitBrain.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System.Collections.Generic;
using System.Linq;
using Model;
using Model.Runtime.Projectiles;
using UnityEngine;
using Utilities;

namespace UnitBrains.Player
{
Expand All @@ -12,33 +15,88 @@ public class SecondUnitBrain : DefaultPlayerUnitBrain
private float _temperature = 0f;
private float _cooldownTime = 0f;
private bool _overheated;


private Vector2Int _targetToChase = new Vector2Int(-1, -1);

protected override void GenerateProjectiles(Vector2Int forTarget, List<BaseProjectile> intoList)
{
float overheatTemperature = OverheatTemperature;
///////////////////////////////////////
// Homework 1.3 (1st block, 3rd module)
///////////////////////////////////////
var projectile = CreateProjectile(forTarget);
AddProjectileToList(projectile, intoList);
if (GetTemperature() >= overheatTemperature)
{
return;
}
for (int i = 0; i < _temperature+1; i++)
{
var projectile = CreateProjectile(forTarget);
AddProjectileToList(projectile, intoList);
}
//Debug.Log(intoList.Count);
IncreaseTemperature();
///////////////////////////////////////
}

public override Vector2Int GetNextStep()
{
return base.GetNextStep();
Vector2Int currentPos = unit.Pos;

if (_targetToChase.x == -1 && _targetToChase.y == -1)
{
return currentPos;
}

if (IsTargetInRange(_targetToChase))
{
_targetToChase = new Vector2Int(-1, -1);
return currentPos;
}

Vector2Int nestStep = currentPos.CalcNextStepTowards(_targetToChase);
return nestStep;
}

protected override List<Vector2Int> SelectTargets()
{
///////////////////////////////////////
// Homework 1.4 (1st block, 4rd module)
///////////////////////////////////////
List<Vector2Int> result = GetReachableTargets();
while (result.Count > 1)
List<Vector2Int> allTargets = GetAllTargets().ToList();

if (allTargets.Count == 0)
{
result.RemoveAt(result.Count - 1);
int enemyBaseId = IsPlayerUnitBrain ? RuntimeModel.BotPlayerId : RuntimeModel.PlayerId;
Vector2Int enemyBasePos = runtimeModel.RoMap.Bases[enemyBaseId];
allTargets.Add(enemyBasePos);
}

Vector2Int choseTarget = allTargets[0];
float minDistToOwnBase = DistanceToOwnBase(choseTarget);
foreach (Vector2Int target in allTargets)
{
float dist = DistanceToOwnBase(target);
if (dist < minDistToOwnBase)
{
minDistToOwnBase = dist;
choseTarget = target;
}
}

bool inAttackRange = IsTargetInRange(choseTarget);

List<Vector2Int> result = new List<Vector2Int>();

if (inAttackRange)
{
result.Add(choseTarget);
_targetToChase = new Vector2Int(-1, -1);
}
else
{
_targetToChase = choseTarget;
}

return result;
///////////////////////////////////////
}
Expand Down
12 changes: 12 additions & 0 deletions CSharpMainProjectMyFork.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-Editor", "Assembly-CSharp-Editor.csproj", "{F7B17844-74ED-8CA8-ACA8-8F693CF5DE56}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Root", "Root.csproj", "{C12C09C7-888C-7364-148B-3BC33A05AB3F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests.csproj", "{A49BA194-5C47-A0B3-F237-E5A208BF7BB2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -19,6 +23,14 @@ Global
{F7B17844-74ED-8CA8-ACA8-8F693CF5DE56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7B17844-74ED-8CA8-ACA8-8F693CF5DE56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7B17844-74ED-8CA8-ACA8-8F693CF5DE56}.Release|Any CPU.Build.0 = Release|Any CPU
{C12C09C7-888C-7364-148B-3BC33A05AB3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C12C09C7-888C-7364-148B-3BC33A05AB3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C12C09C7-888C-7364-148B-3BC33A05AB3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C12C09C7-888C-7364-148B-3BC33A05AB3F}.Release|Any CPU.Build.0 = Release|Any CPU
{A49BA194-5C47-A0B3-F237-E5A208BF7BB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A49BA194-5C47-A0B3-F237-E5A208BF7BB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A49BA194-5C47-A0B3-F237-E5A208BF7BB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A49BA194-5C47-A0B3-F237-E5A208BF7BB2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading