From 5f1158289bb0ce019cc282cfca331cec9765d192 Mon Sep 17 00:00:00 2001 From: Tristan Rhodes Date: Sat, 5 Aug 2023 23:22:07 -0600 Subject: [PATCH] [Flash object] Add ability to flash color tint, object effect, and opacity (fade) (#955) * Updating Flash extension (thanks Entropy!) - Replaces deprecated functions - Added "seconds" time unit to parameters - Added FlashColor, FlashEffect, and FlashOpacity behaviors - When "Flash object" action is used during a pre-existing flash, simply extend the duration of the flashing - Previously, it always performed "hide object", potentially causing the object to be hidden too much --- extensions/reviewed/Flash.json | 2607 +++++++++++++++++- scripts/lib/ExtensionsValidatorExceptions.js | 6 + 2 files changed, 2478 insertions(+), 135 deletions(-) diff --git a/extensions/reviewed/Flash.json b/extensions/reviewed/Flash.json index d44700a2a..fd12fbd9f 100644 --- a/extensions/reviewed/Flash.json +++ b/extensions/reviewed/Flash.json @@ -1,46 +1,2158 @@ { - "author": "@4ian", - "category": "Visual effect", + "author": "@4ian, Entropy, VegeTato", + "category": "", "extensionNamespace": "", - "fullName": "Flash (blink)", + "fullName": "Flash object", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZsYXNoLW91dGxpbmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNywySDE3TDEzLjUsOUgxN0wxMCwyMlYxNEg3VjJNOSw0VjEySDEyVjE0LjY2TDE0LDExSDEwLjI0TDEzLjc2LDRIOVoiIC8+PC9zdmc+", "name": "Flash", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/flash-outline.svg", - "shortDescription": "Make objects flash (alternately visible and invisible) for a period of time.", - "version": "1.0.1", + "shortDescription": "Make an object flash visibility (blink), color tint, object effect, or opacity (fade).", + "version": "1.1.0", "description": [ - "Make objects flash (alternately visible and invisible) for a period of time.", + "Make an object flash for a period of time so that it alternates between two different states.", + "Includes the ability to flash visibility (blink), color tint, object effect, or opacity (fade).", "", - "It can be used to:", + "After adding a behavior to an object, you **trigger the effect** by using the **Flash action**.", + "", + "This can be used to:", "- Let players know they are invincible after being hit", "- Catch player attention on the interface (for instance a \"press start\" text)", - "", "" ], - "origin": { - "identifier": "Flash", - "name": "gdevelop-extension-store" - }, "tags": [ "flash", "blink", "visible", "invisible", "hit", - "damage" + "damage", + "fade", + "effect", + "color", + "tint" ], "authorIds": [ - "wWP8BSlAW0UP4NeaHa2LcmmDzmH2" + "wWP8BSlAW0UP4NeaHa2LcmmDzmH2", + "q8ubdigLvIRXLxsJDDTaokO41mc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" ], "dependencies": [], - "eventsFunctions": [], + "eventsFunctions": [ + { + "description": "Color tint applied to an object.", + "fullName": "Color tint applied to an object", + "functionType": "ExpressionAndCondition", + "name": "ColorTint", + "sentence": "Color tint applied to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Return the color string for the tint applied to the object" + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.SpriteRuntimeObject} */\r", + "const tintedObject = objects[0];\r", + "const tint = tintedObject.getColor();\r", + "eventsFunctionContext.returnValue = tint;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a color tint is applied to an object.", + "fullName": "Is a color tint applied to an object", + "functionType": "StringExpression", + "name": "IsTinted", + "sentence": "_PARAM1_ is color tinted", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::ColorTint" + }, + "parameters": [ + "", + "=", + "\"255;255;255\"", + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Toggle an object effect.", + "fullName": "Toggle an object effect", + "functionType": "Action", + "name": "ToggleEffect", + "sentence": "Toggle effect _PARAM2_ on _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IsEffectEnabled" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"EffectName\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "EnableEffect" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"EffectName\")", + "" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "False" + ] + }, + { + "type": { + "inverted": true, + "value": "IsEffectEnabled" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"EffectName\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "EnableEffect" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"EffectName\")", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Effect name to toggle", + "name": "EffectName", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Toggle color tint between the starting tint and a given value.", + "fullName": "Toggle a color tint", + "functionType": "Action", + "name": "ToggleColorTint", + "private": true, + "sentence": "Toggle color tint _PARAM2_ on _PARAM1_", + "events": [ + { + "colorB": 35, + "colorG": 166, + "colorR": 245, + "creationTime": 0, + "name": "Note: This function cannot be \"public\" until it properly handles objects without a starting color tint variable (NULL)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Swap between the starting tint and the given value", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_ColorTintToggled", + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::ColorTint" + }, + "parameters": [ + "", + "=", + "Object.VariableString(__FlashColor_StartingTint)", + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Object", + "GetArgumentAsString(\"ColorTint\")" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_ColorTintToggled", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_ColorTintToggled", + "False" + ] + }, + { + "type": { + "inverted": true, + "value": "Flash::ColorTint" + }, + "parameters": [ + "", + "=", + "Object.VariableString(__FlashColor_StartingTint)", + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Object", + "Object.VariableString(__FlashColor_StartingTint)" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Color tint", + "name": "ColorTint", + "type": "color" + } + ], + "objectGroups": [] + }, + { + "description": "Toggle object visibility.", + "fullName": "Toggle object visibility", + "functionType": "Action", + "name": "ToggleVisibility", + "sentence": "Toggle visibility of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_VisibilityToggled", + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Visible" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_VisibilityToggled", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_VisibilityToggled", + "False" + ] + }, + { + "type": { + "inverted": true, + "value": "Visible" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], "eventsBasedBehaviors": [ { - "description": "Make the object flash (blink) for a period of time, so that it is alternately visible and invisible.\nTrigger the effect by using the Flash action.", - "fullName": "Flash (blink)", - "name": "Flash", - "objectType": "", + "description": "Make the object flash (blink) for a period of time so it alternates between visible and invisible.", + "fullName": "Flash visibility (blink)", + "name": "Flash", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::Flash::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Timer\"", + ">", + "Object.Behavior::PropertyHalfPeriodTime()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::ToggleVisibility" + }, + "parameters": [ + "", + "Object", + "" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Timer\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::Flash::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Duration_Timer\"", + ">", + "Object.Behavior::PropertyFlashDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::Flash::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::Flash", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Make an object flash (blink) visibility for a period of time.", + "fullName": "Flash visibility (blink)", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash (blink) for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::Flash::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::ToggleVisibility" + }, + "parameters": [ + "", + "Object", + "" + ] + }, + { + "type": { + "value": "Flash::Flash::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Timer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Flash::Flash::SetPropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"FlashDuration\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::Flash", + "type": "behavior" + }, + { + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "FlashDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if an object is flashing visibility.", + "fullName": "Is object flashing visibility", + "functionType": "Condition", + "name": "IsFlashing", + "sentence": "_PARAM0_ is flashing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::Flash::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::Flash", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onOwnerRemovedFromScene", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Flash::Flash::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::Flash", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Flash::Flash::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::Flash", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stop flashing visibility (blink) of an object.", + "fullName": "Stop flashing visibility (blink)", + "functionType": "Action", + "name": "Stop", + "sentence": "Stop flashing visibility of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::Flash::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "Flash::Flash::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Timer\"" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Duration_Timer\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::Flash", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Half period (time during which object is invisible)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "HalfPeriodTime" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsFlashing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "FlashDuration" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Make an object flash a color tint for a period of time.", + "fullName": "Flash color tint", + "name": "FlashColor", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"", + ">", + "Object.Behavior::PropertyHalfPeriodTime()" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"" + ] + }, + { + "type": { + "value": "Flash::ToggleColorTint" + }, + "parameters": [ + "", + "Object", + "Object.Behavior::PropertyTintColor()", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"", + ">", + "Object.Behavior::PropertyFlashDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashColor::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Make an object flash a color tint for a period of time.", + "fullName": "Flash color tint", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash the color tint _PARAM3_ for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::FlashColor::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjetTxt" + }, + "parameters": [ + "Object", + "__FlashColor_StartingTint", + "=", + "Flash::ColorTint(Object)" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"" + ] + }, + { + "type": { + "value": "Flash::ToggleColorTint" + }, + "parameters": [ + "", + "Object", + "GetArgumentAsString(\"ColorTint\")", + "" + ] + }, + { + "type": { + "value": "Flash::FlashColor::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Flash::FlashColor::SetPropertyTintColor" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"ColorTint\")" + ] + }, + { + "type": { + "value": "Flash::FlashColor::SetPropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"FlashDuration\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + }, + { + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "FlashDuration", + "type": "expression" + }, + { + "description": "Color tint", + "name": "ColorTint", + "type": "color" + } + ], + "objectGroups": [] + }, + { + "description": "Check if an object is flashing a color tint.", + "fullName": "Is object flashing a color tint", + "functionType": "Condition", + "name": "IsFlashing", + "sentence": "_PARAM0_ is flashing a color tint", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onOwnerRemovedFromScene", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Flash::FlashColor::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Flash::FlashColor::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stop flashing a color tint on an object.", + "fullName": "Stop flashing color tint", + "functionType": "Action", + "name": "Stop", + "sentence": "Stop flashing color tint _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashColor::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Object", + "Object.VariableString(__FlashColor_StartingTint)" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Half period (time between flashes)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "HalfPeriodTime" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsFlashing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "FlashDuration" + }, + { + "value": "\"255;255;255\"", + "type": "String", + "label": "Tint color", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TintColor" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Flash opacity smoothly (fade) in a repeating loop.", + "fullName": "Flash opacity smothly (fade)", + "name": "FlashOpacity", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashOpacity::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"", + "Object.Behavior::PropertyStartingOpacity()", + "\"easeInOutCubic\"", + "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"", + "Object.Behavior::PropertyTargetOpacity()", + "\"easeInOutCubic\"", + "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashOpacity::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Opacity_Duration_Timer\"", + ">", + "Object.Behavior::PropertyFlashDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Make an object flash opacity smoothly (fade) in a repeating loop.", + "fullName": "Flash opacity (fade)", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash opacity smoothly to _PARAM4_ in a loop for _PARAM3_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::FlashOpacity::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyStartingOpacity" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Opacity()" + ] + }, + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"", + "GetArgumentAsNumber(\"TargetOpacity\")", + "\"easeInOutCubic\"", + "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "" + ] + }, + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Opacity_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"FlashDuration\")" + ] + }, + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyTargetOpacity" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"TargetOpacity\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + }, + { + "description": "Tween behavior (required)", + "name": "TweenBehavior", + "supplementaryInformation": "Tween::TweenBehavior", + "type": "behavior" + }, + { + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "FlashDuration", + "type": "expression" + }, + { + "description": "Target opacity", + "name": "TargetOpacity", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if an object is flashing opacity.", + "fullName": "Is object flashing opacity", + "functionType": "Condition", + "name": "IsFlashing", + "sentence": "_PARAM0_ is flashing opacity", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onOwnerRemovedFromScene", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stop flashing opacity of an object.", + "fullName": "Stop flashing opacity", + "functionType": "Action", + "name": "Stop", + "sentence": "Stop flashing opacity of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashOpacity::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"" + ] + }, + { + "type": { + "value": "Opacity" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::PropertyStartingOpacity()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Tween Behavior (required)", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "hidden": false, + "name": "TweenBehavior" + }, + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Half period (time between flashes), in seconds", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "HalfPeriodTime" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsFlashing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "FlashDuration" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Target opacity (Range: 0 - 255)", + "description": "Opacity will fade between the starting value and a target value", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TargetOpacity" + }, + { + "value": "", + "type": "Number", + "unit": "Dimensionless", + "label": "Starting opacity", + "description": "Opacity will fade between the starting value and a target value", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "StartingOpacity" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Make the object flash an effect for a period of time.", + "fullName": "Flash effect", + "name": "FlashEffect", + "objectType": "Sprite", "eventsFunctions": [ { "fullName": "", @@ -53,54 +2165,233 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "Flash::FlashEffect::IsFlashing" }, "parameters": [ "Object", - "Behavior" + "Behavior", + "" ] } ], "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "ObjectTimer" - }, - "parameters": [ - "Object", - "\"FlashTimer\"", - "Object.Behavior::PropertyHalfPeriodTime()" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Timer\"", + ">", + "Object.Behavior::PropertyHalfPeriodTime()" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Timer\"" + ] + }, + { + "type": { + "value": "Flash::ToggleEffect" + }, + "parameters": [ + "", + "Object", + "Object.Behavior::PropertyEffectName()", + "" + ] + } ] - }, + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "Visible" - }, - "parameters": [ - "Object" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashEffect::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Duration_Timer\"", + ">", + "Object.Behavior::PropertyFlashDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashEffect::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } ] } ], - "actions": [ + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashEffect", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Make an object flash an effect for a period of time.", + "fullName": "Flash effect", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash the effect _PARAM3_ for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Stop flashing existing effects if the effect name changed" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashEffect::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Flash::FlashEffect::PropertyEffectName" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "GetArgumentAsString(\"EffectName\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashEffect::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::FlashEffect::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "Cache" + "value": "IsEffectEnabled" }, "parameters": [ - "Object" + "Object", + "GetArgumentAsString(\"EffectName\")" ] - }, + } + ], + "actions": [ { "type": { - "value": "ResetObjectTimer" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Object", - "\"FlashTimer\"" + "__FlashColor_StartingState", + "True" ] } ] @@ -110,31 +2401,40 @@ "conditions": [ { "type": { - "value": "ObjectTimer" + "inverted": true, + "value": "IsEffectEnabled" }, "parameters": [ "Object", - "\"FlashTimer\"", - "Object.Behavior::PropertyHalfPeriodTime()" + "GetArgumentAsString(\"EffectName\")" ] - }, + } + ], + "actions": [ { "type": { - "inverted": true, - "value": "Visible" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ - "Object" + "Object", + "__FlashColor_StartingState", + "False" ] } - ], + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [ { "type": { - "value": "Montre" + "value": "Flash::ToggleEffect" }, "parameters": [ + "", "Object", + "GetArgumentAsString(\"EffectName\")", "" ] }, @@ -144,77 +2444,26 @@ }, "parameters": [ "Object", - "\"FlashTimer\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ObjectTimer" - }, - "parameters": [ - "Object", - "\"FlashDurationTimer\"", - "Object.Behavior::PropertyFlashDuration()" + "\"Flash_Effect_Timer\"" ] - } - ], - "actions": [ + }, { "type": { - "value": "Flash::Flash::Stop" + "value": "Flash::FlashEffect::SetPropertyIsFlashing" }, "parameters": [ "Object", "Behavior", - "" + "yes" ] } ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Flash::Flash", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Make the specified object(s) blink for the given duration.", - "fullName": "Flash (blink)", - "functionType": "Action", - "name": "Flash", - "sentence": "Make _PARAM0_ blink for _PARAM2_ seconds", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "GetArgumentAsNumber(\"FlashDuration\")", - ">", - "0" - ] - } - ], + "conditions": [], "actions": [ { "type": { @@ -222,12 +2471,12 @@ }, "parameters": [ "Object", - "\"FlashDurationTimer\"" + "\"Flash_Effect_Duration_Timer\"" ] }, { "type": { - "value": "Flash::Flash::SetPropertyFlashDuration" + "value": "Flash::FlashEffect::SetPropertyFlashDuration" }, "parameters": [ "Object", @@ -238,12 +2487,13 @@ }, { "type": { - "value": "Flash::Flash::SetPropertyIsFlashing" + "value": "Flash::FlashEffect::SetPropertyEffectName" }, "parameters": [ "Object", "Behavior", - "yes" + "=", + "GetArgumentAsString(\"EffectName\")" ] } ] @@ -253,28 +2503,35 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Flash::Flash", + "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" }, { - "description": "Duration of the blinking, in seconds", + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", "name": "FlashDuration", "type": "expression" + }, + { + "description": "Name of effect", + "name": "EffectName", + "type": "string" } ], "objectGroups": [] }, { - "description": "Check if the specified objects are flashing.", - "fullName": "Is object flashing", + "description": "Check if an object is flashing an effect.", + "fullName": "Is object flashing an effect", "functionType": "Condition", "name": "IsFlashing", - "sentence": "_PARAM0_ is flashing", + "sentence": "_PARAM0_ is flashing an effect", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -295,7 +2552,7 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "Flash::FlashEffect::PropertyIsFlashing" }, "parameters": [ "Object", @@ -319,12 +2576,13 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Flash::Flash", + "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" } ], @@ -342,7 +2600,7 @@ "actions": [ { "type": { - "value": "Flash::Flash::Stop" + "value": "Flash::FlashEffect::Stop" }, "parameters": [ "Object", @@ -357,12 +2615,13 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Flash::Flash", + "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" } ], @@ -380,7 +2639,7 @@ "actions": [ { "type": { - "value": "Flash::Flash::Stop" + "value": "Flash::FlashEffect::Stop" }, "parameters": [ "Object", @@ -395,30 +2654,31 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Flash::Flash", + "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Stop the flashing of the specified object.", - "fullName": "Stop flashing", + "description": "Stop flashing an effect of an object.", + "fullName": "Stop flashing an effect", "functionType": "Action", "name": "Stop", - "sentence": "Stop flashing _PARAM0_", + "sentence": "Stop flashing an effect on _PARAM0_", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "Flash::FlashColor::PropertyIsFlashing" }, "parameters": [ "Object", @@ -429,21 +2689,86 @@ "actions": [ { "type": { - "value": "Montre" + "value": "Flash::FlashEffect::SetPropertyIsFlashing" }, "parameters": [ "Object", - "" + "Behavior", + "no" ] }, { "type": { - "value": "Flash::Flash::SetPropertyIsFlashing" + "value": "RemoveObjectTimer" }, "parameters": [ "Object", - "Behavior", - "no" + "\"Flash_Effect_Timer\"" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Duration_Timer\"" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__FlashEffect_StartingState", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "EnableEffect" + }, + "parameters": [ + "Object", + "Object.Behavior::PropertyEffectName()", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__FlashEffect_StartingState", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EnableEffect" + }, + "parameters": [ + "Object", + "Object.Behavior::PropertyEffectName()", + "" + ] + } ] } ] @@ -453,12 +2778,13 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Flash::Flash", + "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" } ], @@ -470,7 +2796,7 @@ "value": "0.1", "type": "Number", "unit": "Second", - "label": "Half period (time during which object is invisible)", + "label": "Half period (time between flashes), in seconds", "description": "", "group": "", "extraInformation": [], @@ -490,12 +2816,23 @@ { "value": "0", "type": "Number", - "label": "", - "description": "", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", "group": "", "extraInformation": [], "hidden": true, "name": "FlashDuration" + }, + { + "value": "", + "type": "String", + "label": "Name of effect", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "EffectName" } ], "sharedPropertyDescriptors": [] diff --git a/scripts/lib/ExtensionsValidatorExceptions.js b/scripts/lib/ExtensionsValidatorExceptions.js index 55e1d03f3..f133b4700 100644 --- a/scripts/lib/ExtensionsValidatorExceptions.js +++ b/scripts/lib/ExtensionsValidatorExceptions.js @@ -452,6 +452,12 @@ const extensionsAllowedProperties = { runtimeSceneAllowedProperties: [], javaScriptObjectAllowedProperties: [], }, + Flash: { + gdjsAllowedProperties: ['SpriteRuntimeObject'], + gdjsEvtToolsAllowedProperties: [], + runtimeSceneAllowedProperties: [], + javaScriptObjectAllowedProperties: [], + }, }, };