Basis for the job system (#434)

* Add basic yaml Jobs file

* Add Job Prototype

* Rename Jobs to Job

* Remove BaseJob

* Add the Job class child of Role

* Add code for spawning as an assistant. Not actually working, the job prototype can't be found.

* Fix role instead of job left in yaml

* Add starting gear support for job and the starting gear for assistant as an exemple

* Link job with starting gear in yaml

* Better naming and some error handling

* Tweak error handling
This commit is contained in:
ZelteHonor
2019-11-17 11:18:39 -05:00
committed by Pieter-Jan Briers
parent 480d3b26c4
commit 447db2e458
8 changed files with 376 additions and 74 deletions

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using Content.Server.Interfaces.Chat;
using Content.Shared.Jobs;
using Robust.Shared.IoC;
namespace Content.Server.Mobs.Roles
{
public class Job : Role
{
private readonly JobPrototype _jobPrototype;
public override string Name { get; }
public String StartingGear => _jobPrototype.StartingGear;
public Job(Mind mind, JobPrototype jobPrototype) : base(mind)
{
_jobPrototype = jobPrototype;
Name = jobPrototype.Name;
}
public override void Greet()
{
base.Greet();
var chat = IoCManager.Resolve<IChatManager>();
chat.DispatchServerMessage(
Mind.Session,
String.Format("You're a new {0}. Do your best!", Name));
}
}
}