-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweakHealCantrip.cs
114 lines (85 loc) · 3.07 KB
/
weakHealCantrip.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
103
104
105
106
107
108
109
110
111
112
113
114
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace monowizard
{
internal class weakHealCantrip : Cantrip
{
Texture2D fireballTexture;
int spellframe;
Player player;
public bool isfiring;
public int casts = 0;
int manasucktime = 0;
bool sucking = true;
int spawnoffsety = 0;
int spawnoffsetx = 0;
int partsize = 32;
public weakHealCantrip(Player player)
{
this.player = player;
id = 7;
pushonhit = 4;
manacost = 0.025f;
symbcroprect = new Rectangle(256, 256, 128, 128);
cantripnum = 7;
}
public override void cast()
{
// player.throwitem();'
// if (player.mana > 0.025)
// {
sucking = true;
// player.changeMana(-0.025f);
manasucktime += 1;
spawnoffsetx = player.mm.particleManager.rnd.Next(10, 60);
spawnoffsetx = player.mm.particleManager.rnd.Next(10, 60);
partsize = player.mm.particleManager.rnd.Next(16, 48);
player.mm.particleManager.addHealSmall(player.hitbox.X + spawnoffsetx, player.hitbox.Y + spawnoffsety, 0, -8, partsize, 0.1f);
// Debug.WriteLine("heal");
if (manasucktime == 200)
{
player.changeHealth(1);
manasucktime = 0;
}
// }
}
public override void update()
{
if (sucking)//sucking
{
//Debug.WriteLine(manasucktime);
//Console.WriteLine(manasucktime);
//Debug.WriteLine(manasucktime);
if (player.mana > 0.025)
{
if (player.frameCounter.frame % 5 == 0)
{
spawnoffsetx = player.mm.particleManager.rnd.Next(10, 60);
spawnoffsetx = player.mm.particleManager.rnd.Next(10, 60);
partsize = player.mm.particleManager.rnd.Next(16, 48);
player.mm.particleManager.addHealSmall(player.hitbox.X + spawnoffsetx, player.hitbox.Y + spawnoffsety, 0, -8, partsize, 0.1f);
}
//sucking = true;
player.changeMana(-0.025f);
manasucktime += 1;
if (manasucktime == 200)
{
player.changeHealth(1);
manasucktime=0;
}
if(keyrelease == true)
{
keyrelease = false;
sucking = false;
}
}
}
}
}
}