Skip to content

Commit

Permalink
Discourage AIs from using EyeCandy engine
Browse files Browse the repository at this point in the history
  • Loading branch information
audigex committed Aug 11, 2024
1 parent 7407f9a commit 6a3cb2c
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 9 deletions.
2 changes: 2 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- Added LNER J70
- Added Class 58
- Added Class 68 + Mk3 rake
- Adjusted EyeCandy engine to hopefully discourage AI use
- Fixed some animated pixels on HST rear power car

# v2.12 (2024-08-08)
- Added LMS Black 5
Expand Down
3 changes: 2 additions & 1 deletion lang/english.lng
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ STR_NAME_Utility32pxOLD :DEBUG UNIT 32px alignment/test unit (OL
STR_DESC_Utility :This unit is used to debug alignment and scale issues with the set, and is only visible with the Developer Mode parameter enabled. It is not intended for gameplay use

STR_NAME_EyeCandy :Invisible Locomotive (Eyecandy)
STR_DESC_EyeCandy :An invisible locomotive intended for use for eyecandy (eg putting freight wagons in a siding)
STR_DESC_EyeCandy :An invisible locomotive intended for use for eyecandy (eg putting freight wagons in a siding).{}VERY expensive to run when moving, free when stationary
STR_EyeCandy_NoAttachedUnit :Cannot start Eye Candy locomotive without an attached unit
STR_EyeCandy_AI :AI companies cannot use the Eye Candy locomotive (if this is not an AI company please contact the BRTrains developer on Discord or TT-Forums)

# TRAM NAMES
STR_NAME_GlasgowWooden :Glasgow Corporation Wooden Classic (Double Decker)
Expand Down
71 changes: 63 additions & 8 deletions src/trains/utility_development_and_debug/EyeCandyLocomotive.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,67 @@ spriteset(spriteset_EyeCandy_Depot, "gfx/EyeCandy.png") {
template_train20px(0, 33)
}

switch(FEAT_TRAINS, SELF, sw_EyeCandy_AllowMove, num_vehs_in_consist)
switch(FEAT_TRAINS, SELF, sw_EyeCandy_AllowMove_Length, num_vehs_in_consist)
{
1: return(string(STR_EyeCandy_NoAttachedUnit));
CB_RESULT_NO_TEXT;
}

switch(FEAT_TRAINS, SELF, sw_EyeCandy_AllowMove, company_type)
{
PLAYERTYPE_AI: return(string(STR_EyeCandy_AI));
sw_EyeCandy_AllowMove_Length;
}

switch(FEAT_TRAINS,SELF,sw_EyeCandy_Sprites, vehicle_is_in_depot)
{
0: spriteset_EyeCandy;
1: spriteset_EyeCandy_Depot;
}

switch(FEAT_TRAINS, SELF, sw_EyeCandy_RunningCost_Movement, vehicle_is_stopped)
{
0: 255;
1: 0;
}

switch(FEAT_TRAINS, SELF, sw_EyeCandy_RunningCost, company_type)
{
PLAYERTYPE_AI: 255;
sw_EyeCandy_RunningCost_Movement;
}

switch(FEAT_TRAINS, SELF, sw_EyeCandy_PurchaseCost, company_type)
{
PLAYERTYPE_AI: 255;
PLAYERTYPE_HUMAN: 0;
}

switch(FEAT_TRAINS, SELF, sw_EyeCandy_Power, company_type)
{
PLAYERTYPE_AI: 0;
PLAYERTYPE_HUMAN: 10000;
}

// km/h
switch(FEAT_TRAINS, SELF, sw_EyeCandy_Speed, company_type)
{
PLAYERTYPE_AI: 1;
PLAYERTYPE_HUMAN: 80;
}

switch(FEAT_TRAINS, SELF, sw_EyeCandy_Weight, company_type)
{
PLAYERTYPE_AI: 10000;
PLAYERTYPE_HUMAN: 30;
}

switch(FEAT_TRAINS, SELF, sw_EyeCandy_TE, company_type)
{
PLAYERTYPE_AI: 0;
PLAYERTYPE_HUMAN: 255;
}

item (FEAT_TRAINS, item_EyeCandy, 578) {
property {
name: string(STR_NAME_EyeCandy);
Expand All @@ -33,22 +82,23 @@ item (FEAT_TRAINS, item_EyeCandy, 578) {
refittable_cargo_classes: 0;
cargo_allow_refit: [GOOD, FOOD];
loading_speed: 3;
cost_factor: 1;
running_cost_factor: 1;
cost_factor: 255;
running_cost_factor: 255;
sprite_id: SPRITE_ID_NEW_TRAIN;
speed: 50 mph;
speed: 1 mph;
misc_flags: TRAIN_FLAG_NO_BREAKDOWN_SMOKE;
refit_cost: 0;
track_type: RAIL;
ai_special_flag: AI_FLAG_CARGO;
power: 5000 hp;
power: 1 hp;
running_cost_base: RUNNING_COST_STEAM;
running_cost_factor: 255;
dual_headed: 0;
default_cargo_type: GOOD;
cargo_capacity: 1;
weight: 1 ton;
engine_class: ENGINE_CLASS_STEAM;
tractive_effort_coefficient: 1;
tractive_effort_coefficient: 0.1;
air_drag_coefficient: 0.1;
length: 6;
effect_spawn_model_and_powered: EFFECT_SPAWN_MODEL_STEAM;
Expand All @@ -63,7 +113,12 @@ item (FEAT_TRAINS, item_EyeCandy, 578) {
purchase: spriteset_EyeCandy_Purchase;
colour_mapping: return PALETTE_CC_FIRST;
start_stop: sw_EyeCandy_AllowMove;
cost_factor: return 1;
running_cost_factor: return 1;
cost_factor: sw_EyeCandy_PurchaseCost;
running_cost_factor: sw_EyeCandy_RunningCost;
purchase_running_cost_factor: sw_EyeCandy_RunningCost;
power: sw_EyeCandy_Power;
speed: sw_EyeCandy_Speed;
weight: sw_EyeCandy_Weight;
tractive_effort_coefficient: sw_EyeCandy_TE;
}
}

0 comments on commit 6a3cb2c

Please sign in to comment.