Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop

This commit is contained in:
Michael
2020-06-23 18:58:43 +02:00
3 changed files with 23 additions and 18 deletions

View File

@@ -19,6 +19,8 @@ namespace ReallifeGamemode.Database.Entities
[StringLength(32)] [StringLength(32)]
public string Name { get; set; } public string Name { get; set; }
public bool StateOwned { get; set; } public bool StateOwned { get; set; }
public bool GangOwned { get; set; }
public int WeaponDealTime { get; set; } = 60; public int WeaponDealTime { get; set; } = 60;
public override string BankAccountName => Name; public override string BankAccountName => Name;

View File

@@ -53,7 +53,10 @@ namespace ReallifeGamemode.Server.Commands
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", ""); message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
string broadcastMessage = "!{FF0000}** " + player.GetUser().GetFactionRank().RankName + " " + player.Name + ": " + message + " )) **"; string broadcastMessage = "!{FF0000}** " + player.GetUser().GetFactionRank().RankName + " " + player.Name + ": " + message + " )) **";
ChatService.BroadcastFaction(broadcastMessage, f); using (var context = new DatabaseContext())
{
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned));
}
} }
else else
{ {

View File

@@ -40,8 +40,8 @@ namespace ReallifeGamemode.Server.Gangwar
this.maxValue = maxValue; this.maxValue = maxValue;
this.surplus = surplus; this.surplus = surplus;
this.Attacker = null; this.Attacker = null;
this.Att_Score = 50; this.Att_Score = 1;
this.Def_Score = 50; this.Def_Score = 0;
this.status = "normal"; this.status = "normal";
this.timer = null; this.timer = null;
this.playerInside = new List<Player>(); this.playerInside = new List<Player>();
@@ -154,27 +154,18 @@ namespace ReallifeGamemode.Server.Gangwar
{ {
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score); gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score);
} }
if (this.Def_Score <= 0) if (this.Att_Score >= 5)
{ {
this.takeOver(this.Attacker); this.takeOver(this.Attacker);
} }
else if (this.Att_Score <= 0) else if (this.Def_Score >= 5)
{ {
this.takeOver(this.Owner); this.takeOver(this.Owner);
} }
timerCount += 1; timerCount += 1;
if (timerCount >= 900) //change to 900 (seconds) before release for testing reasons change to whatever you like if (timerCount >= 900) //change to 900 (seconds) before release for testing reasons change to whatever you like
{ {
if (this.Def_Score > this.Att_Score) if (this.Att_Score > this.Def_Score)
{
foreach (Player gangwarPlayer in this.playerInGangwar)
{
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0);
}
this.takeOver(this.Owner);
this.Att_Score = 0;
}
else if (this.Def_Score < this.Att_Score)
{ {
foreach (Player gangwarPlayer in this.playerInGangwar) foreach (Player gangwarPlayer in this.playerInGangwar)
{ {
@@ -182,6 +173,15 @@ namespace ReallifeGamemode.Server.Gangwar
} }
this.takeOver(this.Attacker); this.takeOver(this.Attacker);
this.Def_Score = 0; this.Def_Score = 0;
}
else if (this.Att_Score < this.Def_Score)
{
foreach (Player gangwarPlayer in this.playerInGangwar)
{
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0);
}
this.takeOver(this.Owner);
this.Att_Score = 0;
return; return;
} }
else if (this.Def_Score == this.Att_Score) else if (this.Def_Score == this.Att_Score)
@@ -190,7 +190,7 @@ namespace ReallifeGamemode.Server.Gangwar
{ {
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0);
} }
this.takeOver(this.Attacker); this.takeOver(this.Owner);
this.Def_Score = 0; this.Def_Score = 0;
return; return;
@@ -341,11 +341,11 @@ namespace ReallifeGamemode.Server.Gangwar
{ {
if (getOwner() == FactionName) if (getOwner() == FactionName)
{ {
Def_Score -= 1; Att_Score += 1;
} }
else if (getAttacker() == FactionName) else if (getAttacker() == FactionName)
{ {
Att_Score -= 1; Def_Score += 1;
} }
} }
} }