-
Notifications
You must be signed in to change notification settings - Fork 0
/
Biome.cs
102 lines (95 loc) · 2.84 KB
/
Biome.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Limestone.Utility;
using Limestone.Entities;
namespace Limestone
{
public enum Biomes
{
Sea,
Beach,
LowLands,
MidLands,
HighLands,
AncientLands,
Rock
}
public static class Biome
{
public static int GetSpawners(Biomes biome)
{
switch(biome)
{
case Biomes.Sea:
return 0;
default:
return 0;
}
}
public static Texture2D GetBiomeGrassTexture(Biomes biome)
{
switch(biome)
{
case Biomes.Sea:
return Assets.GetTexture("water1");
case Biomes.Beach:
return Assets.GetTexture("beach1");
case Biomes.LowLands:
return Assets.GetTexture("grassLowlands1");
case Biomes.MidLands:
return Assets.GetTexture("grassMidlands1");
case Biomes.HighLands:
return Assets.GetTexture("grassHighlands1");
case Biomes.AncientLands:
return Assets.GetTexture("grassAncientlands1");
default:
return Assets.GetTexture("water1");
}
}
public static Texture2D GetBiomeRockTexture(Biomes biome)
{
int r = Main.rand.Next(0, 100);
switch (biome)
{
case Biomes.Sea:
return null;
case Biomes.Beach:
return null;
case Biomes.LowLands:
return Assets.GetTexture("rocksLowlands1");
case Biomes.MidLands:
if (r < 50)
return Assets.GetTexture("rocksMidlands1");
else
return Assets.GetTexture("rocksMidlands2");
case Biomes.HighLands:
return Assets.GetTexture("rocksHighlands1");
case Biomes.AncientLands:
if (r < 80)
return Assets.GetTexture("rocksAncientlands1");
else
return Assets.GetTexture("rocksAncientlands3");
default:
return null;
}
}
public static int GetSpawnChance(Biomes biome, int enemyindex)
{
if (biome == Biomes.Sea)
{
return 1;
}
else if (biome == Biomes.Beach)
{
return 1;
}
else
{
return 0;
}
}
}
}