API.CreateInfoboxSession("System compromised.","The enemy hacker has overthrown your defenses and compromised your system. You will need to wait an hour before you can start another hack battle.",infobox.InfoboxMode.Info);
lbpcinfo.Text+=Environment.NewLine+"This represents your main system. If this module is destroyed, you will automatically lose the battle. Protect it at all costs.";
API.CreateInfoboxSession("Too much deployed modules","You can have a maximum of 10 modules deployed on your network, including your main system. You will have to wait for one to be destroyed.",infobox.InfoboxMode.Info);
API.CreateInfoboxSession("Module added.","To deploy the module to the network, select 'Add Module' and choose the hostname from the menu.",infobox.InfoboxMode.Info);
pnlbuy.Hide();
if(IsTutorial)
{
if(TutorialProgress==19)
{
SetupTutorialUI(20);
}
elseif(TutorialProgress==24)
{
SetupTutorialUI(25);
}
}
}
else
{
API.CreateInfoboxSession("Please enter a unique hostname.","No two computers can share the same hostname. Please choose another.",infobox.InfoboxMode.Info);
}
}
else
{
API.CreateInfoboxSession("Please enter a hostname.","It is best to enter a hostname for your new computer so you know which one it is.",infobox.InfoboxMode.Info);
}
}
else
{
API.CreateInfoboxSession("Insufficient Codepoints","You do not have enough Codepoints to buy this module.",infobox.InfoboxMode.Info);
API.CreateInfoboxSession("Upgrade successful.","Your module has been upgraded.",infobox.InfoboxMode.Info);
}
}
}
else
{
API.CreateInfoboxSession("Insufficient funds",$"You need at least {price} CP to upgrade this module.",infobox.InfoboxMode.Info);
}
ShowPCInfo(SelectedComputer.Hostname);
}
publicintTutorialProgress=0;
publicboolIsTutorial=false;
publicvoidSetupTutorialUI(intp)
{
TutorialProgress=p;
lbtutorial.Show();
switch(p)
{
case0:
lbtutorial.Text="Welcome to the Hacker Battle tutorial. This guide will teach you the fundamentals and basics of taking part in a Hacker Battle. When you're done here, you'll have all you need for a very basic network.";
btnaddmodule.Hide();
btnnext.Show();
break;
case1:
lbtutorial.Text="When a battle commenses, you will see two windows. The one on the left, is your network. You can view information about all computers on the network, buy new systems, upgrade them and deploy them.";
break;
case2:
lbtutorial.Text="On the right is the enemy's network. This window will show you the strength (HP) of all enemy systems, and will allow you to target specific systems to take down.";
break;
case3:
lbtutorial.Text="On the top-left corner of both windows is the network health indicator. It will display a percentage of the entire network health.";
break;
case4:
lbtutorial.Text="If the enemy's total network health hits 0%, or his core's strength hits 0%, you win.";
break;
case5:
lbtutorial.Text="However, if the same happens to you, you will lose the battle.";
break;
case6:
lbtutorial.Text="You can click on your Core to view information about it.";
btnnext.Hide();
break;
case7:
lbtutorial.Text="When you click on a module, you can see information about it, such as it's grade level, HP, and type. This module is a Core, so it has no grade level. It currently has 100 HP.";
btnnext.Show();
break;
case8:
lbtutorial.Text="When a module is selected you can left-click an enemy module to target it. This will make the selected module attempt to fire at the target. Cores are very weak, but are capable of bringing a target down by 1 HP.";
break;
case9:
lbtutorial.Text="The enemy Core is attacking your Core now. Looks like it's time to fight back. Select your core, and target the enemy's Core to fight back.";
btnnext.Hide();
break;
case10:
lbtutorial.Text="Phew! He couldn't do much damage before we fought back. In a real battle, modules won't just stop fighting randomly, but for the purpose of this tutorial, your Core will stop attacking the enemy Core.";
btnnext.Show();
ThisPC.Enemies.Clear();
break;
case11:
lbtutorial.Text="Should your Core fall to a fatal state in the future, you can deploy some defenses to slow the enemy down. Any hacker knows it's best to disable defenses before attacking the main target.";
ThisPC.HP=5;
break;
case12:
lbtutorial.Text="We will look at ways of healing damaged modules now. You can add new modules to the network by clicking the [Add Module] button in the lower-left corner.";
btnaddmodule.Show();
btnnext.Hide();
break;
case13:
lbtutorial.Text="You can select a module from the list of hostnames. Only modules that are not powered on will display in the menu.";
btnnext.Show();
BuyableModules=newList<FutureModule>();
BuyableModules.Add(newFutureModule("Antivirus",0,"This module will heal any other module within it's area of effect to 10 HP. Higher grades can improve it's area of effect.",SystemType.Antivirus));
break;
case14:
lbtutorial.Text="In this demonstration, you have no other modules to deploy. You will need to buy some modules to get started. Click [Buy New Module] to continue.";
btnnext.Hide();
break;
case15:
lbtutorial.Text="Let's go over the user interface, shall we? At the top is a list of all possible module types.";
btnnext.Show();
btndonebuying.Hide();
lbgrade.Hide();
txtgrade.Hide();
txthostname.Hide();
lbhostname.Hide();
lbmoduleinfo.Hide();
break;
case16:
lbtutorial.Text="Below that, is the cost and description of the selected module type. It's invisible right now, but when you select a new module, it will populate.";
lbmoduleinfo.Show();
break;
case17:
lbtutorial.Text="We need an Antivirus module, so go ahead and select it from the menu.";
btnnext.Hide();
break;
case18:
lbtutorial.Text="Normally, an Antivirus would cost us 15 Codepoints, however since this is a tutorial, it is free.";
btnnext.Show();
break;
case19:
lbtutorial.Text="Below the description is the Hostname box. A Hostname is used to identify the new module. Pick something you'll remember as this new Antivirus, then click [Buy] to purchase it.";
btnnext.Hide();
lbhostname.Show();
txthostname.Show();
btndonebuying.Show();
break;
case20:
btnnext.Hide();
lbtutorial.Text="Now that we have an antivirus module, go ahead and deploy it by selecting [Add Module], choosing the hostname you entered, and clicking [Done].";
break;
case21:
btnnext.Hide();
lbtutorial.Text="Alrighty. Now you get to choose where you place your module. Simply left-click in a blank area where you'd like to place the module. Right-click to cancel. Oh, be sure to place close to our Core!";
break;
case22:
lbtutorial.Text="The Antivirus has been placed. You may've noticed that white dotted box around it when you placed it. If the Core is even slightly within the box, the Antivirus will heal it back to 10 HP.";
btnnext.Show();
break;
case23:
lbtutorial.Text="The higher the Antivirus' grade, the bigger this area of effect becomes. However, it will always only be able to heal modules to 10 HP.";
break;
case24:
lbtutorial.Text="A Turret has been added to the list of buyable modules. Go pick one up!";
btnnext.Hide();
BuyableModules.Clear();
BuyableModules.Add(newFutureModule("Turret",0,"It's not super-effective, but the Turret will blast through any Grade 1 defenses pretty quickly. The higher the grade, the higher the strength.",SystemType.Turret));
break;
case25:
lbtutorial.Text="Turrets can fire damaging viruses at their targets. Go ahead and place your Turret somewhere within the Antivirus's Area of Effect.";
break;
case26:
lbtutorial.Text="Notice how the Turret only has 10 HP, just like the Antivirus?";
btnnext.Show();
break;
case27:
lbtutorial.Text="This is because both the Antivirus and Turret are at Grade 1. There are four grades of modules you can get, and you can easily upgrade by selecting a module and choosing [Upgrade This Module].";
break;
case28:
lbtutorial.Text="Upgrading a module will increase it's max HP. Grade 1 is 10 HP, Grade 2 is 20 HP, Grade 3 is 40 HP, and Grade 4 is 80 HP.";
break;
case29:
lbtutorial.Text="Some modules will have a higher attack rate based on their grade. Others may throw more damaging attacks, and any module's Area of Effect (if it has one) will grow.";
break;
case30:
lbtutorial.Text="Another tip: Multiple modules can target the same module, and a module can have multiple targets. This means that you can have your Core and your Turret both attack the enemy Core.";
break;
case31:
lbtutorial.Text="Some modules do not work on a target-based system. Some may work using an area-of-effect system (like an Antivirus), and some may target the entire enemy network.";
break;
case32:
lbtutorial.Text="We have reset both your Cores' health. Go ahead and finish off the enemy Core using your newfound skills.";
ThisPC.HP=100;
EnemyScreen.ThisPC.HP=100;
btnnext.Hide();
BuyableModules=newList<FutureModule>();
BuyableModules.Add(newFutureModule("Antivirus",0,"This module will heal any other module within it's area of effect to 10 HP. Higher grades can improve it's area of effect.",SystemType.Antivirus));
BuyableModules.Add(newFutureModule("Turret",0,"It's not super-effective, but the Turret will blast through any Grade 1 defenses pretty quickly. The higher the grade, the higher the strength.",SystemType.Turret));
break;
default:
lbtutorial.Text="This concludes the Hacker Battle tutorial. Happy hunting, soldier. Just kidding. Stay safe.";